@@ -72,7 +72,7 @@ static void iommufd_backend_class_init(ObjectClass *oc, void *data)
object_class_property_add_str(oc, "fd", NULL, iommufd_backend_set_fd);
}
-bool iommufd_backend_connect(IOMMUFDBackend *be, Error **errp)
+bool iommufd_backend_connect(IOMMUFDBackend *be, const char *name, Error **errp)
{
int fd;
@@ -90,7 +90,7 @@ bool iommufd_backend_connect(IOMMUFDBackend *be, Error **errp)
return true;
}
-void iommufd_backend_disconnect(IOMMUFDBackend *be)
+void iommufd_backend_disconnect(IOMMUFDBackend *be, const char *name)
{
if (!be->users) {
goto out;
@@ -71,7 +71,7 @@ static bool iommufd_cdev_connect_and_bind(VFIODevice *vbasedev, Error **errp)
.flags = 0,
};
- if (!iommufd_backend_connect(iommufd, errp)) {
+ if (!iommufd_backend_connect(iommufd, vbasedev->name, errp)) {
return false;
}
@@ -99,7 +99,7 @@ static bool iommufd_cdev_connect_and_bind(VFIODevice *vbasedev, Error **errp)
err_bind:
iommufd_cdev_kvm_device_del(vbasedev);
err_kvm_device_add:
- iommufd_backend_disconnect(iommufd);
+ iommufd_backend_disconnect(iommufd, vbasedev->name);
return false;
}
@@ -107,7 +107,7 @@ static void iommufd_cdev_unbind_and_disconnect(VFIODevice *vbasedev)
{
/* Unbind is automatically conducted when device fd is closed */
iommufd_cdev_kvm_device_del(vbasedev);
- iommufd_backend_disconnect(vbasedev->iommufd);
+ iommufd_backend_disconnect(vbasedev->iommufd, vbasedev->name);
}
static int iommufd_cdev_getfd(const char *sysfs_path, Error **errp)
@@ -37,8 +37,9 @@ struct IOMMUFDBackend {
/*< public >*/
};
-bool iommufd_backend_connect(IOMMUFDBackend *be, Error **errp);
-void iommufd_backend_disconnect(IOMMUFDBackend *be);
+bool iommufd_backend_connect(IOMMUFDBackend *be, const char *name,
+ Error **errp);
+void iommufd_backend_disconnect(IOMMUFDBackend *be, const char *name);
bool iommufd_backend_alloc_ioas(IOMMUFDBackend *be, uint32_t *ioas_id,
Error **errp);
Pass device name to iommufd_backend_connect and iommufd_backend_disconnect, for use by CPR in a subsequent patch. No functional change. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> --- backends/iommufd.c | 4 ++-- hw/vfio/iommufd.c | 6 +++--- include/sysemu/iommufd.h | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-)