]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Alter dump-guest-memory command generation
authorJohn Ferlan <jferlan@redhat.com>
Fri, 17 Nov 2017 19:25:01 +0000 (14:25 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 4 Jan 2018 17:15:49 +0000 (12:15 -0500)
The qemuMonitorJSONMakeCommand can properly handle a NULL string
by using the "S:" parameter instead of "s:", so let's use that
of having in if/else condition that only adds the "s:".

src/qemu/qemu_monitor_json.c

index ea1b8e1f5f2a55a9bff6439ae44e1fc9a3ffae18..5ddd85575052cf9eec361d4825f2daecc7d538cb 100644 (file)
@@ -3170,19 +3170,11 @@ qemuMonitorJSONDump(qemuMonitorPtr mon,
     virJSONValuePtr cmd = NULL;
     virJSONValuePtr reply = NULL;
 
-    if (dumpformat) {
-        cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
-                                         "b:paging", false,
-                                         "s:protocol", protocol,
-                                         "s:format", dumpformat,
-                                         NULL);
-    } else {
-        cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
-                                         "b:paging", false,
-                                         "s:protocol", protocol,
-                                         NULL);
-    }
-
+    cmd = qemuMonitorJSONMakeCommand("dump-guest-memory",
+                                     "b:paging", false,
+                                     "s:protocol", protocol,
+                                     "S:format", dumpformat,
+                                     NULL);
     if (!cmd)
         return -1;