aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/container-base.c
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2023-11-02 15:12:30 +0800
committerCédric Le Goater <clg@redhat.com>2023-12-19 19:03:38 +0100
commited2f7f80170251e7cdd2965a13ee97527d1fbec8 (patch)
treebcdb5322bc52268f2ad5cd6297f7b2a6b7174efd /hw/vfio/container-base.c
parentb08501a999e2448f500a46d68da503be55186b04 (diff)
downloadqemu-ed2f7f80170251e7cdd2965a13ee97527d1fbec8.zip
qemu-ed2f7f80170251e7cdd2965a13ee97527d1fbec8.tar.gz
qemu-ed2f7f80170251e7cdd2965a13ee97527d1fbec8.tar.bz2
vfio/common: Introduce vfio_container_init/destroy helper
This adds two helper functions vfio_container_init/destroy which will be used by both legacy and iommufd containers to do base container specific initialization and release. No functional change intended. Suggested-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio/container-base.c')
-rw-r--r--hw/vfio/container-base.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/vfio/container-base.c b/hw/vfio/container-base.c
index 55d3a35..e929435 100644
--- a/hw/vfio/container-base.c
+++ b/hw/vfio/container-base.c
@@ -30,3 +30,12 @@ int vfio_container_dma_unmap(VFIOContainerBase *bcontainer,
g_assert(bcontainer->ops->dma_unmap);
return bcontainer->ops->dma_unmap(bcontainer, iova, size, iotlb);
}
+
+void vfio_container_init(VFIOContainerBase *bcontainer, const VFIOIOMMUOps *ops)
+{
+ bcontainer->ops = ops;
+}
+
+void vfio_container_destroy(VFIOContainerBase *bcontainer)
+{
+}