aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/common.c
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2023-11-02 15:12:41 +0800
committerCédric Le Goater <clg@redhat.com>2023-12-19 19:03:38 +0100
commit1eb31f13b24c49884d8256f96a6664df2dd0824d (patch)
treec794cfeb38a3c4d4443f0decc164591a08f631c4 /hw/vfio/common.c
parentf79baf8c9575ac3193ca86ec508791c86d96b13e (diff)
downloadqemu-1eb31f13b24c49884d8256f96a6664df2dd0824d.zip
qemu-1eb31f13b24c49884d8256f96a6664df2dd0824d.tar.gz
qemu-1eb31f13b24c49884d8256f96a6664df2dd0824d.tar.bz2
vfio/container: Implement attach/detach_device
No functional change intended. Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.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/common.c')
-rw-r--r--hw/vfio/common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 8ef2e79..483ba82 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1498,3 +1498,19 @@ retry:
return info;
}
+
+int vfio_attach_device(char *name, VFIODevice *vbasedev,
+ AddressSpace *as, Error **errp)
+{
+ const VFIOIOMMUOps *ops = &vfio_legacy_ops;
+
+ return ops->attach_device(name, vbasedev, as, errp);
+}
+
+void vfio_detach_device(VFIODevice *vbasedev)
+{
+ if (!vbasedev->bcontainer) {
+ return;
+ }
+ vbasedev->bcontainer->ops->detach_device(vbasedev);
+}