[PATCH 09/37] qemuMonitorAddFileHandleToSet: Remove return of 'qemuMonitorAddFdInfo'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The only caller doesn't use the fdset info any more.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_fd.c           |  5 +----
 src/qemu/qemu_monitor.c      |  6 ++----
 src/qemu/qemu_monitor.h      |  7 +------
 src/qemu/qemu_monitor_json.c | 37 ++++++------------------------------
 src/qemu/qemu_monitor_json.h |  3 +--
 5 files changed, 11 insertions(+), 47 deletions(-)

diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c
index fe81cc650f..cbdf1c938f 100644
--- a/src/qemu/qemu_fd.c
+++ b/src/qemu/qemu_fd.c
@@ -264,13 +264,10 @@ qemuFDPassTransferMonitor(qemuFDPass *fdpass,

     for (i = 0; i < fdpass->nfds; i++) {
         if (fdpass->useFDSet) {
-            qemuMonitorAddFdInfo fdsetinfo;
-
             if (qemuMonitorAddFileHandleToSet(mon,
                                               fdpass->fds[i].fd,
                                               fdpass->fdSetID,
-                                              fdpass->fds[i].opaque,
-                                              &fdsetinfo) < 0)
+                                              fdpass->fds[i].opaque) < 0)
                 return -1;
         } else {
             if (qemuMonitorSendFileHandle(mon,
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 316cff5b9b..39004201c0 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2506,7 +2506,6 @@ qemuMonitorGraphicsRelocate(qemuMonitor *mon,
  * @fd: file descriptor to pass to qemu
  * @fdset: the fdset to register this fd with, -1 to create a new fdset
  * @opaque: opaque data to associated with this fd
- * @info: structure that will be updated with the fd and fdset returned by qemu
  *
  * Attempts to register a file descriptor with qemu that can then be referenced
  * via the file path /dev/fdset/$FDSETID
@@ -2515,8 +2514,7 @@ int
 qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
                               int fd,
                               int fdset,
-                              const char *opaque,
-                              qemuMonitorAddFdInfo *info)
+                              const char *opaque)
 {
     VIR_DEBUG("fd=%d,fdset=%i,opaque=%s", fd, fdset, opaque);

@@ -2528,7 +2526,7 @@ qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
         return -1;
     }

-    return qemuMonitorJSONAddFileHandleToSet(mon, fd, fdset, opaque, info);
+    return qemuMonitorJSONAddFileHandleToSet(mon, fd, fdset, opaque);
 }


diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index e6a50e73f7..79d8486d08 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -941,16 +941,11 @@ int qemuMonitorGraphicsRelocate(qemuMonitor *mon,
                                 int tlsPort,
                                 const char *tlsSubject);

-typedef struct _qemuMonitorAddFdInfo qemuMonitorAddFdInfo;
-struct _qemuMonitorAddFdInfo {
-    int fdset;
-};
 int
 qemuMonitorAddFileHandleToSet(qemuMonitor *mon,
                               int fd,
                               int fdset,
-                              const char *opaque,
-                              qemuMonitorAddFdInfo *info);
+                              const char *opaque);

 int
 qemuMonitorRemoveFdset(qemuMonitor *mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 6939eaea17..ddef9c6b53 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -3594,34 +3594,11 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon,
 }


-static int
-qemuAddfdInfoParse(virJSONValue *msg,
-                   qemuMonitorAddFdInfo *fdinfo)
-{
-    virJSONValue *returnObj;
-
-    if (!(returnObj = virJSONValueObjectGetObject(msg, "return"))) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Missing or invalid return data in add-fd response"));
-        return -1;
-    }
-
-    if (virJSONValueObjectGetNumberInt(returnObj, "fdset-id", &fdinfo->fdset) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Missing or invalid fdset-id in add-fd response"));
-        return -1;
-    }
-
-    return 0;
-}
-
-
-/* if fdset is negative, qemu will create a new fdset and add the fd to that */
-int qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
-                                      int fd,
-                                      int fdset,
-                                      const char *opaque,
-                                      qemuMonitorAddFdInfo *fdinfo)
+int
+qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
+                                  int fd,
+                                  int fdset,
+                                  const char *opaque)
 {
     g_autoptr(virJSONValue) args = NULL;
     g_autoptr(virJSONValue) reply = NULL;
@@ -3644,12 +3621,10 @@ int qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
     if (qemuMonitorJSONCheckError(cmd, reply) < 0)
         return -1;

-    if (qemuAddfdInfoParse(reply, fdinfo) < 0)
-        return -1;
-
     return 0;
 }

+
 static int
 qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg,
                                 qemuMonitorFdsets **fdsets)
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 982fbad44e..3c442d669f 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -253,8 +253,7 @@ int
 qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
                                   int fd,
                                   int fdset,
-                                  const char *opaque,
-                                  qemuMonitorAddFdInfo *info);
+                                  const char *opaque);

 int
 qemuMonitorJSONRemoveFdset(qemuMonitor *mon,
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux