[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC V1 03/12] iommufd: pass name to connect
From: |
Steve Sistare |
Subject: |
[RFC V1 03/12] iommufd: pass name to connect |
Date: |
Sat, 20 Jul 2024 12:15:28 -0700 |
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(-)
diff --git a/backends/iommufd.c b/backends/iommufd.c
index 84fefbc..fc37386 100644
--- a/backends/iommufd.c
+++ b/backends/iommufd.c
@@ -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;
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index c2f158e..255966a 100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
@@ -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)
diff --git a/include/sysemu/iommufd.h b/include/sysemu/iommufd.h
index 9edfec6..aa195d1 100644
--- a/include/sysemu/iommufd.h
+++ b/include/sysemu/iommufd.h
@@ -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);
--
1.8.3.1
- [RFC V1 00/12] Live update: iommufd, Steve Sistare, 2024/07/20
- [RFC V1 10/12] migration/ram: old host address, Steve Sistare, 2024/07/20
- [RFC V1 07/12] iommufd: change_process kernel interface, Steve Sistare, 2024/07/20
- [RFC V1 05/12] iommufd: preserve device fd, Steve Sistare, 2024/07/20
- [RFC V1 02/12] iommufd: no DMA to BARs, Steve Sistare, 2024/07/20
- [RFC V1 08/12] vfio/iommufd: register container for cpr, Steve Sistare, 2024/07/20
- [RFC V1 03/12] iommufd: pass name to connect,
Steve Sistare <=
- [RFC V1 09/12] vfio/iommufd: rebuild device, Steve Sistare, 2024/07/20
- [RFC V1 12/12] vfio: mdev blocker, Steve Sistare, 2024/07/20
- [RFC V1 06/12] iommufd: export iommufd_cdev_get_info_iova_range, Steve Sistare, 2024/07/20
- [RFC V1 11/12] iommufd: update DMA virtual addresses, Steve Sistare, 2024/07/20
- [RFC V1 04/12] migration: cpr_find_fd_any, Steve Sistare, 2024/07/20
- [RFC V1 01/12] vfio: move cpr_exec_notifier, Steve Sistare, 2024/07/20