From nobody Wed May 14 15:49:21 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15203476367441005.7276992248965; Tue, 6 Mar 2018 06:47:16 -0800 (PST) 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 5F9723AA11; Tue, 6 Mar 2018 14:47:15 +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 32C8E62461; Tue, 6 Mar 2018 14:47:15 +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 DA6B44A474; Tue, 6 Mar 2018 14:47:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w26El7VN027263 for ; Tue, 6 Mar 2018 09:47:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id F029961F5C; Tue, 6 Mar 2018 14:47:07 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-18.phx2.redhat.com [10.3.116.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id B05B061F2B for ; Tue, 6 Mar 2018 14:47:07 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 6 Mar 2018 09:46:59 -0500 Message-Id: <20180306144702.17094-2-jferlan@redhat.com> In-Reply-To: <20180306144702.17094-1-jferlan@redhat.com> References: <20180306144702.17094-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] qemu: Alter current VNC set password to be legacy 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 06 Mar 2018 14:47:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The QEMU "change" QMP command interface is being deprecated according to qapi-schema.json, so this patch will keep the current API available for legacy/older QEMU binaries with a future patch introducing the newer change-vnc-password QMP command interface. Signed-off-by: John Ferlan --- src/qemu/qemu_hotplug.c | 2 +- src/qemu/qemu_monitor.c | 6 +++--- src/qemu/qemu_monitor.h | 4 ++-- src/qemu/qemu_monitor_json.c | 6 ++++-- src/qemu/qemu_monitor_json.h | 4 ++-- tests/qemumonitorjsontest.c | 4 ++-- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index e0a5300f0..0ee9b2bfc 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5341,7 +5341,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr dr= iver, _("Graphics password only supported for VNC")); ret =3D -1; } else { - ret =3D qemuMonitorSetVNCPassword(priv->mon, password); + ret =3D qemuMonitorSetVNCPasswordLegacy(priv->mon, password); } } if (ret !=3D 0) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1d67a9778..56c8345d5 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2370,8 +2370,8 @@ qemuMonitorBlockResize(qemuMonitorPtr mon, =20 =20 int -qemuMonitorSetVNCPassword(qemuMonitorPtr mon, - const char *password) +qemuMonitorSetVNCPasswordLegacy(qemuMonitorPtr mon, + const char *password) { VIR_DEBUG("password=3D%p", password); =20 @@ -2381,7 +2381,7 @@ qemuMonitorSetVNCPassword(qemuMonitorPtr mon, password =3D ""; =20 if (mon->json) - return qemuMonitorJSONSetVNCPassword(mon, password); + return qemuMonitorJSONSetVNCPasswordLegacy(mon, password); else return qemuMonitorTextSetVNCPassword(mon, password); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index adfa87aba..cf9ab7cb3 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -595,8 +595,8 @@ int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr = mon, int qemuMonitorBlockResize(qemuMonitorPtr mon, const char *dev_name, unsigned long long size); -int qemuMonitorSetVNCPassword(qemuMonitorPtr mon, - const char *password); +int qemuMonitorSetVNCPasswordLegacy(qemuMonitorPtr mon, + const char *password); int qemuMonitorSetPassword(qemuMonitorPtr mon, int type, const char *password, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 08dfffdf6..ad81b70db 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2356,8 +2356,10 @@ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, return ret; } =20 -int qemuMonitorJSONSetVNCPassword(qemuMonitorPtr mon, - const char *password) + +int +qemuMonitorJSONSetVNCPasswordLegacy(qemuMonitorPtr mon, + const char *password) { int ret =3D -1; virJSONValuePtr cmd =3D qemuMonitorJSONMakeCommand("change", diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index ec243becc..dec7a5cf9 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -92,8 +92,8 @@ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, const char *devce, unsigned long long size); =20 -int qemuMonitorJSONSetVNCPassword(qemuMonitorPtr mon, - const char *password); +int qemuMonitorJSONSetVNCPasswordLegacy(qemuMonitorPtr mon, + const char *password); int qemuMonitorJSONSetPassword(qemuMonitorPtr mon, const char *protocol, const char *password, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 908ec3a3c..f9c59f2f0 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1316,7 +1316,7 @@ cleanup: \ =20 GEN_TEST_FUNC(qemuMonitorJSONSetLink, "vnet0", VIR_DOMAIN_NET_INTERFACE_LI= NK_STATE_DOWN) GEN_TEST_FUNC(qemuMonitorJSONBlockResize, "vda", 123456) -GEN_TEST_FUNC(qemuMonitorJSONSetVNCPassword, "secret_password") +GEN_TEST_FUNC(qemuMonitorJSONSetVNCPasswordLegacy, "secret_password") GEN_TEST_FUNC(qemuMonitorJSONSetPassword, "spice", "secret_password", "dis= connect") GEN_TEST_FUNC(qemuMonitorJSONExpirePassword, "spice", "123456") GEN_TEST_FUNC(qemuMonitorJSONSetBalloon, 1024) @@ -2905,7 +2905,7 @@ mymain(void) DO_TEST_SIMPLE("rtc-reset-reinjection", qemuMonitorJSONRTCResetReinjec= tion); DO_TEST_GEN(qemuMonitorJSONSetLink); DO_TEST_GEN(qemuMonitorJSONBlockResize); - DO_TEST_GEN(qemuMonitorJSONSetVNCPassword); + DO_TEST_GEN(qemuMonitorJSONSetVNCPasswordLegacy); DO_TEST_GEN(qemuMonitorJSONSetPassword); DO_TEST_GEN(qemuMonitorJSONExpirePassword); DO_TEST_GEN(qemuMonitorJSONSetBalloon); --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list