From: John Ferlan Date: Fri, 17 Nov 2017 19:25:01 +0000 (-0500) Subject: qemu: Alter dump-guest-memory command generation X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b372983d14cc9be1ce5c8aeac85a66a9ca0f11b2;p=libvirt.git qemu: Alter dump-guest-memory command generation 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:". --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index ea1b8e1f5f..5ddd855750 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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;