From 1eb31f13b24c49884d8256f96a6664df2dd0824d Mon Sep 17 00:00:00 2001 From: Eric Auger Date: Thu, 2 Nov 2023 15:12:41 +0800 Subject: vfio/container: Implement attach/detach_device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'hw/vfio/common.c') 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); +} -- cgit v1.1