[PATCH 02/20] qemu_fd: Add function to retrieve fdset ID

Jim Fehlig via Devel posted 20 patches 3 months, 2 weeks ago
[PATCH 02/20] qemu_fd: Add function to retrieve fdset ID
Posted by Jim Fehlig via Devel 3 months, 2 weeks ago
Add new function qemuFDPassGetId() for retrieving the fdset ID
of provided qemuFDPass object.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---
 src/qemu/qemu_fd.c | 18 ++++++++++++++++++
 src/qemu/qemu_fd.h |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c
index e847056573..3ae4a87a20 100644
--- a/src/qemu/qemu_fd.c
+++ b/src/qemu/qemu_fd.c
@@ -276,6 +276,24 @@ qemuFDPassGetPath(qemuFDPass *fdpass)
 }
 
 
+/**
+ * qemuFDPassGetId:
+ * @fdpass: The fd passing helper struct
+ * @id: An out parameter for providing the fdset ID
+ *
+ * Returns 0 on success, -1 on error.
+ */
+int
+qemuFDPassGetId(qemuFDPass *fdpass, unsigned int *id)
+{
+    if (!fdpass)
+        return -1;
+
+    *id = fdpass->fdSetID;
+    return 0;
+}
+
+
 struct _qemuFDPassDirect {
     int fd;
     char *name;
diff --git a/src/qemu/qemu_fd.h b/src/qemu/qemu_fd.h
index cd0ff2c690..dfcd5fb754 100644
--- a/src/qemu/qemu_fd.h
+++ b/src/qemu/qemu_fd.h
@@ -58,6 +58,9 @@ qemuFDPassTransferMonitorRollback(qemuFDPass *fdpass,
 const char *
 qemuFDPassGetPath(qemuFDPass *fdpass);
 
+int
+qemuFDPassGetId(qemuFDPass *fdpass, unsigned int *id);
+
 
 typedef struct _qemuFDPassDirect qemuFDPassDirect;
 
-- 
2.35.3
Re: [PATCH 02/20] qemu_fd: Add function to retrieve fdset ID
Posted by Daniel P. Berrangé 1 month, 2 weeks ago
On Thu, Aug 08, 2024 at 05:37:55PM -0600, Jim Fehlig via Devel wrote:
> Add new function qemuFDPassGetId() for retrieving the fdset ID
> of provided qemuFDPass object.
> 
> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> ---
>  src/qemu/qemu_fd.c | 18 ++++++++++++++++++
>  src/qemu/qemu_fd.h |  3 +++
>  2 files changed, 21 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|