]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuMonitorAddFileHandleToSet: Remove return of 'qemuMonitorAddFdInfo'
authorPeter Krempa <pkrempa@redhat.com>
Thu, 5 May 2022 15:06:10 +0000 (17:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 May 2022 07:15:45 +0000 (09:15 +0200)
The only caller doesn't use the fdset info any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_fd.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h

index 88039e8596e14c000a6a567d7e241b5e6b916780..25f69c4f97ca60b78f391c429d86727441166ec8 100644 (file)
@@ -266,13 +266,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,
index 316cff5b9b6b8cfc4f13de9fdeb3be4ed55a6ee9..39004201c0c3a2457a94148afaf7a8969450ae22 100644 (file)
@@ -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);
 }
 
 
index e6a50e73f76892ec94a8b74dde4ba7517ce3e5e3..79d8486d080031c917b9da467e42593c40f05cf6 100644 (file)
@@ -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,
index e763f613d1312c34b146fb8f54708cac8dd4e24d..a092bf420f664a4a62bc0b8aed66ddcce9f034bd 100644 (file)
@@ -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)
index 982fbad44e1950d80f15e8e9e79d5abf6be44d1f..3c442d669f2fd37e0679fe574b855c346d65e4ed 100644 (file)
@@ -253,8 +253,7 @@ int
 qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon,
                                   int fd,
                                   int fdset,
-                                  const char *opaque,
-                                  qemuMonitorAddFdInfo *info);
+                                  const char *opaque);
 
 int
 qemuMonitorJSONRemoveFdset(qemuMonitor *mon,