From nobody Sat Feb 7 12:11:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1511212940575268.003126735618; Mon, 20 Nov 2017 13:22:20 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 646D434CD; Mon, 20 Nov 2017 21:22:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 11B944F9DD; Mon, 20 Nov 2017 21:22:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8F4C64BB79; Mon, 20 Nov 2017 21:22:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAKLLQuu026050 for ; Mon, 20 Nov 2017 16:21:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id CF38260C80; Mon, 20 Nov 2017 21:21:26 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-167.phx2.redhat.com [10.3.117.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93FCB60BE0 for ; Mon, 20 Nov 2017 21:21:26 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Mon, 20 Nov 2017 16:21:13 -0500 Message-Id: <20171120212121.7565-3-jferlan@redhat.com> In-Reply-To: <20171120212121.7565-1-jferlan@redhat.com> References: <20171120212121.7565-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 02/10] qemu: Alter dump-guest-memory command generation X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 20 Nov 2017 21:22:19 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 --- 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 =3D NULL; virJSONValuePtr reply =3D NULL; =20 - if (dumpformat) { - cmd =3D qemuMonitorJSONMakeCommand("dump-guest-memory", - "b:paging", false, - "s:protocol", protocol, - "s:format", dumpformat, - NULL); - } else { - cmd =3D qemuMonitorJSONMakeCommand("dump-guest-memory", - "b:paging", false, - "s:protocol", protocol, - NULL); - } - + cmd =3D qemuMonitorJSONMakeCommand("dump-guest-memory", + "b:paging", false, + "s:protocol", protocol, + "S:format", dumpformat, + NULL); if (!cmd) return -1; =20 --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list