From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909544; cv=none; d=zoho.com; s=zohoarc; b=HqMV5SlurXBffyES4epmSceR/1ilTIvaf2Ge3pgWMFJtIsqEOs6strZSaWRXry9JTA4thnpIOFTlFBzWAaBDwaPvpkVHjzOJzSt4cdJYNgvU3Tl0SlkOUZNiU0WPxo2RPuU8Uik7z7ItTmJfw1ODOpGuHgMep+lftE6uV5o3El8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909544; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lVZO6X5WxjMo4LlOlDD2LB/Vputy0U0UlbN0c1h1WVY=; b=IGq6Xx7cmbomeeBtaw0mB3JTbQMKQwE2vhB2SRnE59c/rAPVCQgt7mh/ZGeMZfTISAKt4W/SREMdwpbozkHGFTSFNtTMN52dI4AXTpO9yc0vkRT9AyaSH+gUyz8pZB0ddCDskZ9H5vPYMS2xwYEnrhOYcyLh0keot8J56eymEJI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568909544995817.0251457508573; Thu, 19 Sep 2019 09:12:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39D874FCD6; Thu, 19 Sep 2019 16:12:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15A5A5D704; Thu, 19 Sep 2019 16:12:23 +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 C5874180085A; Thu, 19 Sep 2019 16:12:22 +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 x8JGASNq032254 for ; Thu, 19 Sep 2019 12:10:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4265B60C57; Thu, 19 Sep 2019 16:10:28 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98B0E60C80 for ; Thu, 19 Sep 2019 16:10:27 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:16 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/8] qemu: monitor: Remove legacy monitor commands for FD manipulation 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: , 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 19 Sep 2019 16:12:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The handlers for 'add-fd' and 'remove-fd' are unused now and riddled with legacy cruft. Purge them. Last use was removed in f2019083de3430101b94d4991a38fd947a08fd32. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 53 ------------------------- src/qemu/qemu_monitor.h | 4 +- src/qemu/qemu_monitor_json.c | 75 ------------------------------------ src/qemu/qemu_monitor_json.h | 3 -- 4 files changed, 1 insertion(+), 134 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index aa230b3306..865bdbfed1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2789,59 +2789,6 @@ qemuMonitorCloseFileHandle(qemuMonitorPtr mon, } -/* Add the open file descriptor FD into the non-negative set FDSET. - * If NAME is present, it will be passed along for logging purposes. - * Returns the counterpart fd that qemu received, or -1 on error. */ -int -qemuMonitorAddFd(qemuMonitorPtr mon, int fdset, int fd, const char *name) -{ - VIR_DEBUG("fdset=3D%d, fd=3D%d, name=3D%s", fdset, fd, NULLSTR(name)); - - QEMU_CHECK_MONITOR(mon); - - if (fd < 0 || fdset < 0) { - virReportError(VIR_ERR_INVALID_ARG, "%s", - _("fd and fdset must be valid")); - return -1; - } - - if (!mon->hasSendFD) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("qemu is not using a unix socket monitor, " - "cannot send fd %s"), NULLSTR(name)); - return -1; - } - - return qemuMonitorJSONAddFd(mon, fdset, fd, name); -} - - -/* Remove one of qemu's fds from the given FDSET, or if FD is - * negative, remove the entire set. Preserve any previous error on - * entry. Returns 0 on success, -1 on error. */ -int -qemuMonitorRemoveFd(qemuMonitorPtr mon, int fdset, int fd) -{ - int ret =3D -1; - virErrorPtr error; - - VIR_DEBUG("fdset=3D%d, fd=3D%d", fdset, fd); - - error =3D virSaveLastError(); - - QEMU_CHECK_MONITOR_GOTO(mon, cleanup); - - ret =3D qemuMonitorJSONRemoveFd(mon, fdset, fd); - - cleanup: - if (error) { - virSetError(error); - virFreeError(error); - } - return ret; -} - - int qemuMonitorAddNetdev(qemuMonitorPtr mon, const char *netdevstr, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 70000a1c72..7fdda01bdd 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -874,14 +874,12 @@ int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon, int qemuMonitorSendFileHandle(qemuMonitorPtr mon, const char *fdname, int fd); -int qemuMonitorAddFd(qemuMonitorPtr mon, int fdset, int fd, const char *na= me); -/* These two functions preserve previous error and only set their own +/* This function preserves previous error and only set their own * error if no error was set before. */ int qemuMonitorCloseFileHandle(qemuMonitorPtr mon, const char *fdname); -int qemuMonitorRemoveFd(qemuMonitorPtr mon, int fdset, int fd); int qemuMonitorAddNetdev(qemuMonitorPtr mon, const char *netdevstr, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e4404f0199..ae2b3c1992 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3850,81 +3850,6 @@ int qemuMonitorJSONCloseFileHandle(qemuMonitorPtr mo= n, } -int -qemuMonitorJSONAddFd(qemuMonitorPtr mon, int fdset, int fd, const char *na= me) -{ - int ret; - virJSONValuePtr cmd =3D qemuMonitorJSONMakeCommand("add-fd", - "i:fdset-id", fdset, - "S:opaque", name, - NULL); - virJSONValuePtr reply =3D NULL; - if (!cmd) - return -1; - - ret =3D qemuMonitorJSONCommandWithFd(mon, cmd, fd, &reply); - - if (ret =3D=3D 0) { - /* qemu 1.2 lacks the functionality we need; but we have to - * probe to find that out. Don't log errors in that case. */ - if (STREQ_NULLABLE(name, "/dev/null") && - qemuMonitorJSONHasError(reply, "GenericError")) { - ret =3D -2; - goto cleanup; - } - ret =3D qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_OBJECT= ); - } - if (ret =3D=3D 0) { - virJSONValuePtr data =3D virJSONValueObjectGetObject(reply, "retur= n"); - - if (virJSONValueObjectGetNumberInt(data, "fd", &ret) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("incomplete return information")); - goto error; - } - } - - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - return ret; - - error: - /* Best effort cleanup - kill the entire fdset (even if it has - * earlier successful fd registrations), since we don't know which - * fd qemu got, and don't want to leave the fd leaked in qemu. */ - qemuMonitorJSONRemoveFd(mon, fdset, -1); - ret =3D -1; - goto cleanup; -} - - -int -qemuMonitorJSONRemoveFd(qemuMonitorPtr mon, int fdset, int fd) -{ - int ret =3D -1; - virJSONValuePtr cmd =3D qemuMonitorJSONMakeCommand("remove-fd", - "i:fdset-id", fdset, - fd < 0 ? NULL : "i:fd= ", - fd, NULL); - virJSONValuePtr reply =3D NULL; - if (!cmd) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; - - if (qemuMonitorJSONCheckError(cmd, reply) < 0) - goto cleanup; - - ret =3D 0; - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - return ret; -} - - int qemuMonitorJSONAddNetdev(qemuMonitorPtr mon, const char *netdevstr) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 61e64e831b..af4e15594e 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -203,12 +203,9 @@ int qemuMonitorJSONRemovePCIDevice(qemuMonitorPtr mon, int qemuMonitorJSONSendFileHandle(qemuMonitorPtr mon, const char *fdname, int fd); -int qemuMonitorJSONAddFd(qemuMonitorPtr mon, int fdset, int fd, - const char *name); int qemuMonitorJSONCloseFileHandle(qemuMonitorPtr mon, const char *fdname); -int qemuMonitorJSONRemoveFd(qemuMonitorPtr mon, int fdset, int fd); int qemuMonitorJSONAddNetdev(qemuMonitorPtr mon, const char *netdevstr); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909532; cv=none; d=zoho.com; s=zohoarc; b=ikOGHQxMsRW/MHnlIyPHcfpE/LmayVTU43Pw6BS5ZX8XjL8FH7CytsjQWvn9VzH07GLEmeSBP8kb8DSKFx3jCnxz/daLePbURiEjJY6Jrgza/B2f35B5p79qVzIDrClxrfBTie5f4UswwB/CSKMVlYOvYUcemj+JB2fJCzb6qS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909532; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/oxMSWHLBDnHr0xxdhws+CMrsXBrQslsZ/QjcByQkDw=; b=jtSFqyUzS21A5Ju91LiKpSPBEQ6qRCaFfJD5j6gtUMYwk3ZxeEC8C3mKRFiZ/b4YpLmGzPdxjJnQM+nOLnRbo2DY7q0WN4SBAdHOVV+C95BIBDE1A3tYoAcQzyMnguTC94jjNV5aApQM2j7wYeiZBV48zJyF+B+pgtgC/788TlE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568909532468679.7883910721474; Thu, 19 Sep 2019 09:12:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2BA7308FE8F; Thu, 19 Sep 2019 16:12:10 +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 7948960C80; Thu, 19 Sep 2019 16:12:10 +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 1F9EB4EE6A; Thu, 19 Sep 2019 16:12:10 +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 x8JGATJE032264 for ; Thu, 19 Sep 2019 12:10:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B60A60C57; Thu, 19 Sep 2019 16:10:29 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id E839760BF1 for ; Thu, 19 Sep 2019 16:10:28 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:17 +0200 Message-Id: <9156273118753b1429ec81c4accc4399ed31dfc2.1568909221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] qemu: monitor: Remove qemuMonitorHMPCommand macro 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 19 Sep 2019 16:12:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" qemuMonitorHMPCommandWithFd is only called via qemuMonitorHMPCommand macro, so we can remove the macro and the extra unused cruft from the function. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 9 ++++----- src/qemu/qemu_monitor.h | 9 +++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 865bdbfed1..a50aea199d 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1254,10 +1254,9 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, int -qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, - const char *cmd, - int scm_fd, - char **reply) +qemuMonitorHMPCommand(qemuMonitorPtr mon, + const char *cmd, + char **reply) { char *json_cmd =3D NULL; int ret =3D -1; @@ -1272,7 +1271,7 @@ qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, _("Unable to unescape command")); goto cleanup; } - ret =3D qemuMonitorJSONHumanCommandWithFd(mon, json_cmd, scm_fd, reply= ); + ret =3D qemuMonitorJSONHumanCommandWithFd(mon, json_cmd, -1, reply); cleanup: VIR_FREE(json_cmd); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 7fdda01bdd..7385fafeea 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -429,12 +429,9 @@ int qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mo= n, virDomainVideoDefPtr video, const char *videoName) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, - const char *cmd, - int scm_fd, - char **reply); -#define qemuMonitorHMPCommand(mon, cmd, reply) \ - qemuMonitorHMPCommandWithFd(mon, cmd, -1, reply) +int qemuMonitorHMPCommand(qemuMonitorPtr mon, + const char *cmd, + char **reply); int qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, long long seconds, unsigned int micros, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909545; cv=none; d=zoho.com; s=zohoarc; b=korwcDg9RTVgAnv4Lcz0hg6Vjjv5LbVdh1g1SN5fW3QY1w73ZTCw0t4iITnqqKxVgLBu4AYTbANS0SekD7jlOd5oI5QB2pxBfhk2REQjJ/IYMdVAfaZUEsbtdgGZ4RAvST0qZPEJVir7Ys6P4vcmKbK2cFnu4+vRoXjuu/+AxNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909545; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Aw3BgHCcZ/VZb19EcOix7MQrf9Nt0RCxWDTxfLeTnBM=; b=XY8HsomtrmtFlPdAtniiO+x9c4FVGzqvWnsfjQ0JbOSwfP2iDroYZYb2LT6XdOozCjl89CH7LyhyhWKFFjhptypdu8yaR0mHB7pVtey/23LX8vISMie/UubmO7Ij8660pV83LEN+x/qPvs8yoCSknjhK5ir5RGJzWqfzRdoc+dA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568909545148503.9258517823023; Thu, 19 Sep 2019 09:12:25 -0700 (PDT) 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 84CA68A1C92; Thu, 19 Sep 2019 16:12:23 +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 5FD475DA21; Thu, 19 Sep 2019 16:12:23 +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 13D974EE6F; Thu, 19 Sep 2019 16:12:23 +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 x8JGAWAW032279 for ; Thu, 19 Sep 2019 12:10:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6673560BF1; Thu, 19 Sep 2019 16:10:32 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id E468760C57 for ; Thu, 19 Sep 2019 16:10:29 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:18 +0200 Message-Id: <2c99a8082bdd60413fe3c359b376d88b70077775.1568909221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/8] qemu: monitor: Remove support for HMP commands with fds 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: , 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.6.2 (mx1.redhat.com [10.5.110.69]); Thu, 19 Sep 2019 16:12:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The remaining HMP commands don't require fd passing so we can purge filedescriptor passing support from qemuMonitorJSONHumanCommandWitFd and rename it. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor_json.c | 11 +++++------ src/qemu/qemu_monitor_json.h | 7 +++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index a50aea199d..6a09ba91ed 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1271,7 +1271,7 @@ qemuMonitorHMPCommand(qemuMonitorPtr mon, _("Unable to unescape command")); goto cleanup; } - ret =3D qemuMonitorJSONHumanCommandWithFd(mon, json_cmd, -1, reply); + ret =3D qemuMonitorJSONHumanCommand(mon, json_cmd, reply); cleanup: VIR_FREE(json_cmd); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index ae2b3c1992..22f6fc4947 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1555,10 +1555,9 @@ static void qemuMonitorJSONHandleRdmaGidStatusChange= d(qemuMonitorPtr mon, int -qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon, - const char *cmd_str, - int scm_fd, - char **reply_str) +qemuMonitorJSONHumanCommand(qemuMonitorPtr mon, + const char *cmd_str, + char **reply_str) { virJSONValuePtr cmd =3D NULL; virJSONValuePtr reply =3D NULL; @@ -1569,7 +1568,7 @@ qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon, "s:command-line", cmd_str, NULL); - if (!cmd || qemuMonitorJSONCommandWithFd(mon, cmd, scm_fd, &reply) < 0) + if (!cmd || qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { @@ -4634,7 +4633,7 @@ int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mo= n, int ret =3D -1; if (hmp) { - return qemuMonitorJSONHumanCommandWithFd(mon, cmd_str, -1, reply_s= tr); + return qemuMonitorJSONHumanCommand(mon, cmd_str, reply_str); } else { if (!(cmd =3D virJSONValueFromString(cmd_str))) goto cleanup; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index af4e15594e..5330697885 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -41,10 +41,9 @@ int qemuMonitorJSONIOProcess(qemuMonitorPtr mon, size_t len, qemuMonitorMessagePtr msg); -int qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon, - const char *cmd, - int scm_fd, - char **reply); +int qemuMonitorJSONHumanCommand(qemuMonitorPtr mon, + const char *cmd, + char **reply); int qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909555; cv=none; d=zoho.com; s=zohoarc; b=JUBB3uq0wZyhs9BcKMeTgEtp48M2S8M3D3CBvG/DRJUKDwliJWWLzYo3wZDWzc65yCjwEkHxEi1GqOD6JYpSJMKO7r6FOM+Z7RgT9SXT2blojkfTrvQd3goEnaIot2cFSREbbuGrB83NAHSnc36kgwQbc4NAHNmW4zN/cQRSjas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909555; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=epZU7tWM0hLGcXVUSrEaiuc0RZsraN5+zVt1jnAYzr4=; b=HsqAMlj5YQQGBIJLhLvL8h0eDy0Sqr6+fy+X2xfJt8DbwOGoVPzPZ84U7xqnGM+xkJz2TyzIjdPyeditPYJnlfarqBVmSSsvhb0aTBIewZbEXhps5Pw4JbdoYND0nTYceV0nU3WzeRRPukvwmEuZB5Z5gnU6243lMmvDWz/+4i0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568909555780628.1447018739583; Thu, 19 Sep 2019 09:12:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18B7C8A1C9C; Thu, 19 Sep 2019 16:12:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E56D660628; Thu, 19 Sep 2019 16:12:32 +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 A440018037CD; Thu, 19 Sep 2019 16:12:32 +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 x8JGAXic032285 for ; Thu, 19 Sep 2019 12:10:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3900D60C18; Thu, 19 Sep 2019 16:10:33 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id B322F60BF1 for ; Thu, 19 Sep 2019 16:10:32 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:19 +0200 Message-Id: <5962f499b1ea0fc8ce7be50687295accf3c33e3a.1568909221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/8] qemu: monitor: Don't escape HMP commands just to unescape them right away 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Thu, 19 Sep 2019 16:12:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Historically HMP commands needed to be escaped to work properly. The backdoor for calling HMP commands via QMP must unescape them so that arguments aren't messed up. Since we now only support the QMP passthrough the escape->unescape dance is pointless. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 17 +---------------- src/qemu/qemu_monitor_text.c | 28 +++++----------------------- 2 files changed, 6 insertions(+), 39 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6a09ba91ed..c15b194bb5 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1258,24 +1258,9 @@ qemuMonitorHMPCommand(qemuMonitorPtr mon, const char *cmd, char **reply) { - char *json_cmd =3D NULL; - int ret =3D -1; - QEMU_CHECK_MONITOR(mon); - /* hack to avoid complicating each call to text monitor functions */ - json_cmd =3D qemuMonitorUnescapeArg(cmd); - if (!json_cmd) { - VIR_DEBUG("Could not unescape command: %s", cmd); - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to unescape command")); - goto cleanup; - } - ret =3D qemuMonitorJSONHumanCommand(mon, json_cmd, reply); - - cleanup: - VIR_FREE(json_cmd); - return ret; + return qemuMonitorJSONHumanCommand(mon, cmd, reply); } diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index a15c3df76e..7bc28e54c0 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -38,15 +38,10 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon, char *cmd =3D NULL; char *reply =3D NULL; int ret =3D -1; - char *safe_str; - - safe_str =3D qemuMonitorEscapeArg(drivestr); - if (!safe_str) - return -1; /* 'dummy' here is just a placeholder since there is no PCI * address required when attaching drives to a controller */ - if (virAsprintf(&cmd, "drive_add dummy %s", safe_str) < 0) + if (virAsprintf(&cmd, "drive_add dummy %s", drivestr) < 0) goto cleanup; if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) @@ -85,7 +80,6 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon, cleanup: VIR_FREE(cmd); VIR_FREE(reply); - VIR_FREE(safe_str); return ret; } @@ -95,13 +89,9 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon, { char *cmd =3D NULL; char *reply =3D NULL; - char *safedev; int ret =3D -1; - if (!(safedev =3D qemuMonitorEscapeArg(drivestr))) - goto cleanup; - - if (virAsprintf(&cmd, "drive_del %s", safedev) < 0) + if (virAsprintf(&cmd, "drive_del %s", drivestr) < 0) goto cleanup; if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) @@ -129,7 +119,6 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon, cleanup: VIR_FREE(cmd); VIR_FREE(reply); - VIR_FREE(safedev); return ret; } @@ -140,10 +129,8 @@ qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, char *cmd =3D NULL; char *reply =3D NULL; int ret =3D -1; - char *safename; - if (!(safename =3D qemuMonitorEscapeArg(name)) || - virAsprintf(&cmd, "savevm \"%s\"", safename) < 0) + if (virAsprintf(&cmd, "savevm \"%s\"", name) < 0) goto cleanup; if (qemuMonitorHMPCommand(mon, cmd, &reply)) @@ -166,7 +153,6 @@ qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, ret =3D 0; cleanup: - VIR_FREE(safename); VIR_FREE(cmd); VIR_FREE(reply); return ret; @@ -179,8 +165,7 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, con= st char *name) int ret =3D -1; char *safename; - if (!(safename =3D qemuMonitorEscapeArg(name)) || - virAsprintf(&cmd, "loadvm \"%s\"", safename) < 0) + if (virAsprintf(&cmd, "loadvm \"%s\"", name) < 0) goto cleanup; if (qemuMonitorHMPCommand(mon, cmd, &reply)) @@ -223,10 +208,8 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, = const char *name) char *cmd =3D NULL; char *reply =3D NULL; int ret =3D -1; - char *safename; - if (!(safename =3D qemuMonitorEscapeArg(name)) || - virAsprintf(&cmd, "delvm \"%s\"", safename) < 0) + if (virAsprintf(&cmd, "delvm \"%s\"", name) < 0) goto cleanup; if (qemuMonitorHMPCommand(mon, cmd, &reply)) goto cleanup; @@ -249,7 +232,6 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, c= onst char *name) ret =3D 0; cleanup: - VIR_FREE(safename); VIR_FREE(cmd); VIR_FREE(reply); return ret; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909563; cv=none; d=zoho.com; s=zohoarc; b=iQk06sTa7ugW/SftoNsEt04AIEJFF0kzhtYQ+hISoHrkH7O1GJq51LO/tBpV/9fOZ6btR7wntPcxzIGDqqvO9Id8oxZVqjl/W90gQntTlTe3yFnmBdd+YM5mu/KYToe1z9ClPl8IphTdJ9gVW06+zzdtNtqArC+LCaLXhZ01oiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909563; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=dPBIS6scpn95iVn7P/arFEoR8tJvriEnDa7Hc7geDJ8=; b=hWpZMdcL4xdXccVFy87OaStUunZSwzMcvOXiSOztxOcrfj7aAavmLdZdIVNKGvtQoIyOcEHqV9SaxL9cnynYPA1dxNqD4u8PMH6yHFR6BobPDTMJYieWJHSs63ETVCPoGish1NwYCdjrJPLyRdQCT6PnPyE51dsG45G5vaIH9pY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568909563457955.922967197843; Thu, 19 Sep 2019 09:12:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A8B97302C095; Thu, 19 Sep 2019 16:12:41 +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 7EBC210027B9; Thu, 19 Sep 2019 16:12:41 +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 3A6594EE6D; Thu, 19 Sep 2019 16:12:41 +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 x8JGAYBO032295 for ; Thu, 19 Sep 2019 12:10:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0A55C60C18; Thu, 19 Sep 2019 16:10:34 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86B5660BF1 for ; Thu, 19 Sep 2019 16:10:33 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:20 +0200 Message-Id: <2ccf90cdde64a58154e0d6f4fde847f1d091abac.1568909221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/8] qemu: monitor: Remove HMP command (un)escaping infrastructure 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 19 Sep 2019 16:12:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We don't need to escape the commands any more since we use QMP passthrough, which means we can delete the functions. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 93 ------------------------------------ src/qemu/qemu_monitor.h | 3 -- tests/qemumonitortestutils.c | 6 +-- 3 files changed, 1 insertion(+), 101 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index c15b194bb5..f52a381982 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -197,99 +197,6 @@ VIR_ENUM_IMPL(qemuMonitorDumpStatus, "none", "active", "completed", "failed", ); -char * -qemuMonitorEscapeArg(const char *in) -{ - int len =3D 0; - size_t i, j; - char *out; - - /* To pass through the QEMU monitor, we need to use escape - sequences: \r, \n, \", \\ - */ - - for (i =3D 0; in[i] !=3D '\0'; i++) { - switch (in[i]) { - case '\r': - case '\n': - case '"': - case '\\': - len +=3D 2; - break; - default: - len +=3D 1; - break; - } - } - - if (VIR_ALLOC_N(out, len + 1) < 0) - return NULL; - - for (i =3D j =3D 0; in[i] !=3D '\0'; i++) { - switch (in[i]) { - case '\r': - out[j++] =3D '\\'; - out[j++] =3D 'r'; - break; - case '\n': - out[j++] =3D '\\'; - out[j++] =3D 'n'; - break; - case '"': - case '\\': - out[j++] =3D '\\'; - out[j++] =3D in[i]; - break; - default: - out[j++] =3D in[i]; - break; - } - } - out[j] =3D '\0'; - - return out; -} - - -char * -qemuMonitorUnescapeArg(const char *in) -{ - size_t i, j; - char *out; - int len =3D strlen(in); - char next; - - if (VIR_ALLOC_N(out, len + 1) < 0) - return NULL; - - for (i =3D j =3D 0; i < len; ++i) { - next =3D in[i]; - if (in[i] =3D=3D '\\') { - ++i; - switch (in[i]) { - case 'r': - next =3D '\r'; - break; - case 'n': - next =3D '\n'; - break; - case '"': - case '\\': - next =3D in[i]; - break; - default: - /* invalid input (including trailing '\' at end of in) */ - VIR_FREE(out); - return NULL; - } - } - out[j++] =3D next; - } - out[j] =3D '\0'; - - return out; -} - #if DEBUG_RAW_IO # include diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 7385fafeea..af1ec56525 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -382,9 +382,6 @@ struct _qemuMonitorCallbacks { qemuMonitorDomainRdmaGidStatusChangedCallback domainRdmaGidStatusChang= ed; }; -char *qemuMonitorEscapeArg(const char *in); -char *qemuMonitorUnescapeArg(const char *in); - qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm, virDomainChrSourceDefPtr config, bool retry, diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 4cc07b8772..e9dff123f8 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -187,7 +187,6 @@ int ATTRIBUTE_FMT_PRINTF(2, 3) qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...) { va_list msgargs; - VIR_AUTOFREE(char *) tmp =3D NULL; VIR_AUTOFREE(char *) msg =3D NULL; VIR_AUTOFREE(char *) jsonmsg =3D NULL; int ret =3D -1; @@ -197,13 +196,10 @@ qemuMonitorReportError(qemuMonitorTestPtr test, const= char *errmsg, ...) if (virVasprintf(&msg, errmsg, msgargs) < 0) goto cleanup; - if (!(tmp =3D qemuMonitorEscapeArg(msg))) - goto cleanup; - if (virAsprintf(&jsonmsg, "{ \"error\": " " { \"desc\": \"%s\", " " \"class\": \"UnexpectedCommand\" } }", - tmp) < 0) + msg) < 0) goto cleanup; ret =3D qemuMonitorTestAddResponse(test, jsonmsg); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909573; cv=none; d=zoho.com; s=zohoarc; b=ENJF/B6uAa3ylvzHqhxxjZJjLl1nUF7/D2DtbQg589juPwuyCF5tJV+EJdKdKpCWZdv9pJ4PnFqauFaHG7BgWtjuNAzGLhks4ngz1x2y3dYOGnd554mcSWTf9ec0x4pEMT6pBU3vcVin1+BLEBqLMl1X4v/ekbE8mbaiMeKAPK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909573; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=GVa1Y7f7CtDqC8o5hereRT9N7928OKhwHZNS2sL9m6w=; b=CxCo7nZC901BRJdOyZGvrTu0BDUJPP9XRoUsjAHmKS0nW6U5+kcvO4zptP6miPB3D0ARuzetpH0EQgXL8lgX3YmwiZBaqnCQIe4xWtu0bMsMGLPZKfAiBN7htuEZK9RJnQyu5GuQyIxYbTOl0gnhfGAPNXqPU+926XTgYZQ5C9I= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568909573595104.03206912072744; Thu, 19 Sep 2019 09:12:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F05D830084AD; Thu, 19 Sep 2019 16:12:50 +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 C278960C18; Thu, 19 Sep 2019 16:12:50 +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 7C70A4EE96; Thu, 19 Sep 2019 16:12:50 +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 x8JGAYgp032301 for ; Thu, 19 Sep 2019 12:10:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id CDF8660C18; Thu, 19 Sep 2019 16:10:34 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56F7860BF1 for ; Thu, 19 Sep 2019 16:10:34 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:21 +0200 Message-Id: <0a163e731d2ff0ffb187483c88c527c628a72078.1568909221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/8] qemu: monitor: Don't include text monitor in json monitor 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 19 Sep 2019 16:12:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" It was necessary for fallback functions but last one was deleted in d828b744acae967c79513631425c685faf356be0. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor_json.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 22f6fc4947..891d2c3089 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -28,7 +28,6 @@ #include #include -#include "qemu_monitor_text.h" #include "qemu_monitor_json.h" #include "qemu_alias.h" #include "qemu_capabilities.h" --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909555; cv=none; d=zoho.com; s=zohoarc; b=lTgYgb4WP9bpBWXCmwr0jdlhbzqDotFj2mpa21+vyBN3btlF3yWt6W21COD4xqhAXUZu6w22v3nnHkhKwpm48l65SlSG4g0LtaaAsrKSkf/kRgShCURQRto2MZ97U+K36bysY+RZvCDUIFRWQLwXeUgLnKpduJVOfeOo+h1OuZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909555; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0RgppFh4XO8N9m3T7/wVTZFWeEOvclttPUR5B89dSHk=; b=bbRpMWLTQsPmf6sO/QxIP5W0ouaJZvwlpvlMT9RJz0yEpP0ZCNTnJbY3DuLRejp/nN/sKEdvUBZuVUwx/yPeFezVykCDdLug2TPexWUChNzRlL1DcI7gh4u7b4F2XIKbnzVhkTdVDlvamni9pLA5gj40GopUABe08Q63JAArcVM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156890955513093.81770442762752; Thu, 19 Sep 2019 09:12:35 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3CBD53086202; Thu, 19 Sep 2019 16:12:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 008F060F9F; Thu, 19 Sep 2019 16:12:33 +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 B591B18037C9; Thu, 19 Sep 2019 16:12:32 +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 x8JGAZQm032314 for ; Thu, 19 Sep 2019 12:10:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9E21560C18; Thu, 19 Sep 2019 16:10:35 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 272FC60BF1 for ; Thu, 19 Sep 2019 16:10:34 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:22 +0200 Message-Id: <6a40e066f6632fc338a82ba5d02d2578ee1957ae.1568909221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/8] qemu: monitor: Don't handle HMP in qemuMonitorJSONArbitraryCommand 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 19 Sep 2019 16:12:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Call to qemuMonitorJSONHumanCommand directly from qemuMonitorArbitraryCommand. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 5 ++++- src/qemu/qemu_monitor_json.c | 19 +++++++------------ src/qemu/qemu_monitor_json.h | 3 +-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index f52a381982..af4c41fa16 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3191,7 +3191,10 @@ qemuMonitorArbitraryCommand(qemuMonitorPtr mon, QEMU_CHECK_MONITOR(mon); - return qemuMonitorJSONArbitraryCommand(mon, cmd, reply, hmp); + if (hmp) + return qemuMonitorJSONHumanCommand(mon, cmd, reply); + else + return qemuMonitorJSONArbitraryCommand(mon, cmd, reply); } diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 891d2c3089..b8ec9ac59a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4624,25 +4624,20 @@ qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, const char *cmd_str, - char **reply_str, - bool hmp) + char **reply_str) { virJSONValuePtr cmd =3D NULL; virJSONValuePtr reply =3D NULL; int ret =3D -1; - if (hmp) { - return qemuMonitorJSONHumanCommand(mon, cmd_str, reply_str); - } else { - if (!(cmd =3D virJSONValueFromString(cmd_str))) - goto cleanup; + if (!(cmd =3D virJSONValueFromString(cmd_str))) + goto cleanup; - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; + if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) + goto cleanup; - if (!(*reply_str =3D virJSONValueToString(reply, false))) - goto cleanup; - } + if (!(*reply_str =3D virJSONValueToString(reply, false))) + goto cleanup; ret =3D 0; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 5330697885..a608410703 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -286,8 +286,7 @@ char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, const char *cmd_str, - char **reply_str, - bool hmp); + char **reply_str); int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 17:01:45 2024 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568909581; cv=none; d=zoho.com; s=zohoarc; b=BpUiu0b8xvdoerVnmg7WKpIuZJ09pZX1TtPEJXw2EA0/0NvU7wN6AZMEWNwohThPi+CMMB4WtLPSS5pY0zSX2iiMNxrFqODsQBPSvLuUuxJLOVV8TcG+oRWdEWt71S40zDHKQ7PEvcHX+A0cRVAlOsUpf2A2GhTmkv9VjUlAhV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568909581; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5162V6uC+rhoH6BazFAwLKhHYvORE4FPVnWk/ETkhVo=; b=lVR/ApbzK5SK/XDK9HJgvlMT/dvF3OLKL6L7gZfZgZcQxU32wOUlte95xoPTTH98Mf3E9D19kGISKSy7/0/wmX1TJi2ibYlxgUpCr6OEYjDt7K1e1HooXwaRAol6kx7EVyO2HoB2nUg75GqsMnulpwOVWSf0abUTseI5f9Q9DfI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568909581289104.42714928754981; Thu, 19 Sep 2019 09:13:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB4937FDFC; Thu, 19 Sep 2019 16:12:58 +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 9E45C60F8C; Thu, 19 Sep 2019 16:12:58 +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 587E84EEBA; Thu, 19 Sep 2019 16:12:58 +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 x8JGAaYm032321 for ; Thu, 19 Sep 2019 12:10:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6FD6A60C18; Thu, 19 Sep 2019 16:10:36 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC16C60BF1 for ; Thu, 19 Sep 2019 16:10:35 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Sep 2019 18:10:23 +0200 Message-Id: <7db90e36811f0c0c851c1fc102da47dfea7e5c59.1568909221.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/8] qemu: monitor: Remove qemuMonitorHMPCommand in favor of qemuMonitorJSONHumanCommand 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 19 Sep 2019 16:13:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Use the function directly rather than having a wrapper. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 11 ----------- src/qemu/qemu_monitor.h | 3 --- src/qemu/qemu_monitor_text.c | 11 ++++++----- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index af4c41fa16..b6d2936872 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1160,17 +1160,6 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, } -int -qemuMonitorHMPCommand(qemuMonitorPtr mon, - const char *cmd, - char **reply) -{ - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONHumanCommand(mon, cmd, reply); -} - - /* Ensure proper locking around callbacks. */ #define QEMU_MONITOR_CALLBACK(mon, ret, callback, ...) \ do { \ diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index af1ec56525..b781a8cc89 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -426,9 +426,6 @@ int qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, virDomainVideoDefPtr video, const char *videoName) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorHMPCommand(qemuMonitorPtr mon, - const char *cmd, - char **reply); int qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, long long seconds, unsigned int micros, diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 7bc28e54c0..b1abcacdd0 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -23,6 +23,7 @@ #include "qemu_monitor_text.h" +#include "qemu_monitor_json.h" #include "viralloc.h" #include "virlog.h" #include "virerror.h" @@ -44,7 +45,7 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon, if (virAsprintf(&cmd, "drive_add dummy %s", drivestr) < 0) goto cleanup; - if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) + if (qemuMonitorJSONHumanCommand(mon, cmd, &reply) < 0) goto cleanup; if (strstr(reply, "unknown command:")) { @@ -94,7 +95,7 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon, if (virAsprintf(&cmd, "drive_del %s", drivestr) < 0) goto cleanup; - if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) + if (qemuMonitorJSONHumanCommand(mon, cmd, &reply) < 0) goto cleanup; if (strstr(reply, "unknown command:")) { @@ -133,7 +134,7 @@ qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, if (virAsprintf(&cmd, "savevm \"%s\"", name) < 0) goto cleanup; - if (qemuMonitorHMPCommand(mon, cmd, &reply)) + if (qemuMonitorJSONHumanCommand(mon, cmd, &reply)) goto cleanup; if (strstr(reply, "Error while creating snapshot") || @@ -168,7 +169,7 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, con= st char *name) if (virAsprintf(&cmd, "loadvm \"%s\"", name) < 0) goto cleanup; - if (qemuMonitorHMPCommand(mon, cmd, &reply)) + if (qemuMonitorJSONHumanCommand(mon, cmd, &reply)) goto cleanup; if (strstr(reply, "No block device supports snapshots")) { @@ -211,7 +212,7 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, c= onst char *name) if (virAsprintf(&cmd, "delvm \"%s\"", name) < 0) goto cleanup; - if (qemuMonitorHMPCommand(mon, cmd, &reply)) + if (qemuMonitorJSONHumanCommand(mon, cmd, &reply)) goto cleanup; if (strstr(reply, "No block device supports snapshots")) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list