[PATCH v2 02/10] qemu: Alter dump-guest-memory command generation

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

 



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:".

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_json.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 64394f76fe..2c01c99bf6 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -3165,19 +3165,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;
 
-- 
2.13.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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