]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Don't parse actual fd's from query-fdsets/add-fd replies
authorPeter Krempa <pkrempa@redhat.com>
Thu, 5 May 2022 13:10:25 +0000 (15:10 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 May 2022 07:15:45 +0000 (09:15 +0200)
Libvirt doesn't use the returned value and in fact there's nothing we
could even do with them. Avoid parsing and storing them.

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_monitor.h
src/qemu/qemu_monitor_json.c

index 5c2a749282f5598cb5bcdd1e2fffe138740a48e0..e6a50e73f76892ec94a8b74dde4ba7517ce3e5e3 100644 (file)
@@ -943,7 +943,6 @@ int qemuMonitorGraphicsRelocate(qemuMonitor *mon,
 
 typedef struct _qemuMonitorAddFdInfo qemuMonitorAddFdInfo;
 struct _qemuMonitorAddFdInfo {
-    int fd;
     int fdset;
 };
 int
@@ -959,7 +958,6 @@ qemuMonitorRemoveFdset(qemuMonitor *mon,
 
 typedef struct _qemuMonitorFdsetFdInfo qemuMonitorFdsetFdInfo;
 struct _qemuMonitorFdsetFdInfo {
-    int fd;
     char *opaque;
 };
 typedef struct _qemuMonitorFdsetInfo qemuMonitorFdsetInfo;
index d9f93bd2faa3487d21a8ce6388e536ddc01bb5ed..ab15affc631fd298d3fc6aa20af58edb1be7351c 100644 (file)
@@ -3606,12 +3606,6 @@ qemuAddfdInfoParse(virJSONValue *msg,
         return -1;
     }
 
-    if (virJSONValueObjectGetNumberInt(returnObj, "fd", &fdinfo->fd) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Missing or invalid fd 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"));
@@ -3706,12 +3700,6 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg,
                 return -1;
             }
 
-            if (virJSONValueObjectGetNumberInt(fdentry, "fd", &fdinfo->fd) < 0) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               _("query-fdsets return data missing 'fd'"));
-                return -1;
-            }
-
             /* opaque is optional and may be missing */
             fdinfo->opaque = g_strdup(virJSONValueObjectGetString(fdentry, "opaque"));
         }