From nobody Fri May 3 18:26:39 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1553601794956279.12776622993067; Tue, 26 Mar 2019 05:03:14 -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 244643092662; Tue, 26 Mar 2019 12:03:13 +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 E7D8390CFC; Tue, 26 Mar 2019 12:03:12 +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 9C394180338A; Tue, 26 Mar 2019 12:03:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2QC39Cp004373 for ; Tue, 26 Mar 2019 08:03:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id DD19F1001E6F; Tue, 26 Mar 2019 12:03:09 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C2561091EF8; Tue, 26 Mar 2019 12:03:09 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Mar 2019 13:03:03 +0100 Message-Id: <5fce0115f91369d6d8c6eeb1fd274dbee77e6038.1553601735.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 1/2] qemu: Assume that 'set_password' and 'expire_password' are supported 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.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 26 Mar 2019 12:03:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" They were added in qemu commit 7572150c189c6553c2448334116ab717680de66d released in v0.14.0. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_hotplug.c | 20 -------------------- src/qemu/qemu_monitor.c | 1 - src/qemu/qemu_monitor_json.c | 12 ------------ 3 files changed, 33 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index c1d2d00016..c7c9a584f2 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4227,15 +4227,6 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr d= river, goto cleanup; ret =3D qemuMonitorSetPassword(priv->mon, type, password, connected); - if (ret =3D=3D -2) { - if (type !=3D VIR_DOMAIN_GRAPHICS_TYPE_VNC) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Graphics password only supported for VNC")); - ret =3D -1; - } else { - ret =3D qemuMonitorSetVNCPassword(priv->mon, password); - } - } if (ret !=3D 0) goto end_job; @@ -4252,17 +4243,6 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr d= river, ret =3D qemuMonitorExpirePassword(priv->mon, type, expire); - if (ret =3D=3D -2) { - /* XXX we could fake this with a timer */ - if (auth->expires) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Expiry of passwords is not supported")); - ret =3D -1; - } else { - ret =3D 0; - } - } - end_job: if (qemuDomainObjExitMonitor(driver, vm) < 0) ret =3D -1; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0eb7f60e38..d406ecfab3 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2395,7 +2395,6 @@ qemuMonitorTypeToProtocol(int type) } -/* Returns -2 if not supported with this monitor connection */ int qemuMonitorSetPassword(qemuMonitorPtr mon, int type, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 5c16e1f3a1..77c1eaa335 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2781,7 +2781,6 @@ int qemuMonitorJSONSetVNCPassword(qemuMonitorPtr mon, return ret; } -/* Returns -1 on error, -2 if not supported */ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon, const char *protocol, const char *password, @@ -2800,11 +2799,6 @@ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon, if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; - if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { - ret =3D -2; - goto cleanup; - } - if (qemuMonitorJSONCheckError(cmd, reply) < 0) goto cleanup; @@ -2815,7 +2809,6 @@ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon, return ret; } -/* Returns -1 on error, -2 if not supported */ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon, const char *protocol, const char *expire_time) @@ -2832,11 +2825,6 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon, if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) goto cleanup; - if (qemuMonitorJSONHasError(reply, "CommandNotFound")) { - ret =3D -2; - goto cleanup; - } - if (qemuMonitorJSONCheckError(cmd, reply) < 0) goto cleanup; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 18:26:39 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1553601807350241.62263109048752; Tue, 26 Mar 2019 05:03:27 -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 C4D5A30B9E0A; Tue, 26 Mar 2019 12:03:25 +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 9928A1001E74; Tue, 26 Mar 2019 12:03:25 +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 44E863FB12; Tue, 26 Mar 2019 12:03:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2QC3Al3004381 for ; Tue, 26 Mar 2019 08:03:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id D67611001E6F; Tue, 26 Mar 2019 12:03:10 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37CCC1001E74; Tue, 26 Mar 2019 12:03:10 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Mar 2019 13:03:04 +0100 Message-Id: <1540e9fb572fd7cb61740c45b3a95a2724b5abaa.1553601735.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/2] qemu: monitor: Remove unused qemuMonitor(JSON)SetVNCPassword 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.49]); Tue, 26 Mar 2019 12:03:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 15 --------------- src/qemu/qemu_monitor.h | 2 -- src/qemu/qemu_monitor_json.c | 25 ------------------------- src/qemu/qemu_monitor_json.h | 2 -- tests/qemumonitorjsontest.c | 2 -- 5 files changed, 46 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index d406ecfab3..babcbde878 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2363,21 +2363,6 @@ qemuMonitorBlockResize(qemuMonitorPtr mon, } -int -qemuMonitorSetVNCPassword(qemuMonitorPtr mon, - const char *password) -{ - VIR_DEBUG("password=3D%p", password); - - QEMU_CHECK_MONITOR(mon); - - if (!password) - password =3D ""; - - return qemuMonitorJSONSetVNCPassword(mon, password); -} - - static const char * qemuMonitorTypeToProtocol(int type) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index fd7dcc9196..086195ff98 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -634,8 +634,6 @@ int qemuMonitorBlockResize(qemuMonitorPtr mon, const char *device, const char *nodename, unsigned long long size); -int qemuMonitorSetVNCPassword(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 77c1eaa335..743a88b914 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2755,31 +2755,6 @@ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONSetVNCPassword(qemuMonitorPtr mon, - const char *password) -{ - int ret =3D -1; - virJSONValuePtr cmd =3D qemuMonitorJSONMakeCommand("change", - "s:device", "vnc", - "s:target", "password= ", - "s:arg", password, - 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 qemuMonitorJSONSetPassword(qemuMonitorPtr mon, const char *protocol, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 62772228fe..c10513da15 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -98,8 +98,6 @@ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, const char *nodename, unsigned long long size); -int qemuMonitorJSONSetVNCPassword(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 1a8a31717f..055e201611 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1322,7 +1322,6 @@ cleanup: \ GEN_TEST_FUNC(qemuMonitorJSONSetLink, "vnet0", VIR_DOMAIN_NET_INTERFACE_LI= NK_STATE_DOWN) GEN_TEST_FUNC(qemuMonitorJSONBlockResize, "vda", "asdf", 123456) -GEN_TEST_FUNC(qemuMonitorJSONSetVNCPassword, "secret_password") GEN_TEST_FUNC(qemuMonitorJSONSetPassword, "spice", "secret_password", "dis= connect") GEN_TEST_FUNC(qemuMonitorJSONExpirePassword, "spice", "123456") GEN_TEST_FUNC(qemuMonitorJSONSetBalloon, 1024) @@ -2974,7 +2973,6 @@ 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(qemuMonitorJSONSetPassword); DO_TEST_GEN(qemuMonitorJSONExpirePassword); DO_TEST_GEN(qemuMonitorJSONSetBalloon); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list