From: Steve Sistare <steven.sistare@oracle.com>
To: qemu-devel@nongnu.org
Cc: Yi Liu <yi.l.liu@intel.com>, Eric Auger <eric.auger@redhat.com>,
Zhenzhong Duan <zhenzhong.duan@intel.com>,
Alex Williamson <alex.williamson@redhat.com>,
Cedric Le Goater <clg@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
Philippe Mathieu-Daude <philmd@linaro.org>,
David Hildenbrand <david@redhat.com>,
Steve Sistare <steven.sistare@oracle.com>
Subject: [RFC V1 03/12] iommufd: pass name to connect
Date: Sat, 20 Jul 2024 12:15:28 -0700 [thread overview]
Message-ID: <1721502937-87102-4-git-send-email-steven.sistare@oracle.com> (raw)
In-Reply-To: <1721502937-87102-1-git-send-email-steven.sistare@oracle.com>
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
next prev parent reply other threads:[~2024-07-20 19:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-20 19:15 [RFC V1 00/12] Live update: iommufd Steve Sistare
2024-07-20 19:15 ` [RFC V1 01/12] vfio: move cpr_exec_notifier Steve Sistare
2024-07-20 19:15 ` [RFC V1 02/12] iommufd: no DMA to BARs Steve Sistare
2024-08-12 22:05 ` Alex Williamson
2024-08-13 1:39 ` Yi Liu
2024-08-13 14:53 ` Steven Sistare
2024-07-20 19:15 ` Steve Sistare [this message]
2024-07-20 19:15 ` [RFC V1 04/12] migration: cpr_find_fd_any Steve Sistare
2024-07-20 19:15 ` [RFC V1 05/12] iommufd: preserve device fd Steve Sistare
2024-07-20 19:15 ` [RFC V1 06/12] iommufd: export iommufd_cdev_get_info_iova_range Steve Sistare
2024-07-20 19:15 ` [RFC V1 07/12] iommufd: change_process kernel interface Steve Sistare
2024-07-20 19:15 ` [RFC V1 08/12] vfio/iommufd: register container for cpr Steve Sistare
2024-07-20 19:15 ` [RFC V1 09/12] vfio/iommufd: rebuild device Steve Sistare
2024-07-20 19:15 ` [RFC V1 10/12] migration/ram: old host address Steve Sistare
2024-08-16 17:57 ` Fabiano Rosas
2024-08-16 18:13 ` Steven Sistare
2024-07-20 19:15 ` [RFC V1 11/12] iommufd: update DMA virtual addresses Steve Sistare
2024-07-20 19:15 ` [RFC V1 12/12] vfio: mdev blocker Steve Sistare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1721502937-87102-4-git-send-email-steven.sistare@oracle.com \
--to=steven.sistare@oracle.com \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=david@redhat.com \
--cc=eric.auger@redhat.com \
--cc=farosas@suse.de \
--cc=mst@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=yi.l.liu@intel.com \
--cc=zhenzhong.duan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).