9cc71e44f4
- Stable fixes from upstream * Patches added: block-introduce-max_hw_iov-for-use-in-sc.patch hmp-Unbreak-change-vnc.patch qemu-nbd-Change-default-cache-mode-to-wr.patch target-arm-Don-t-skip-M-profile-reset-en.patch vhost-vsock-fix-migration-issue-when-seq.patch virtio-mem-pci-Fix-memory-leak-when-crea.patch virtio-net-fix-use-after-unmap-free-for-.patch OBS-URL: https://build.opensuse.org/request/show/924265 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=675
60 lines
1.9 KiB
Diff
60 lines
1.9 KiB
Diff
From: Markus Armbruster <armbru@redhat.com>
|
|
Date: Thu, 9 Sep 2021 10:12:18 +0200
|
|
Subject: hmp: Unbreak "change vnc"
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Git-commit: 6193344f9337f8b76cd44ce94a32c9900d907d35
|
|
|
|
HMP command "change vnc" can take the password as argument, or prompt
|
|
for it:
|
|
|
|
(qemu) change vnc password 123
|
|
(qemu) change vnc password
|
|
Password: ***
|
|
(qemu)
|
|
|
|
This regressed in commit cfb5387a1d "hmp: remove "change vnc TARGET"
|
|
command", v6.0.0.
|
|
|
|
(qemu) change vnc passwd 123
|
|
Password: ***
|
|
(qemu) change vnc passwd
|
|
(qemu)
|
|
|
|
The latter passes NULL to qmp_change_vnc_password(), which is a no-no.
|
|
Looks like it puts the display into "password required, but none set"
|
|
state.
|
|
|
|
The logic error is easy to miss in review, but testing should've
|
|
caught it.
|
|
|
|
Fix the obvious way.
|
|
|
|
Fixes: cfb5387a1de2acda23fb5c97d2378b9e7ddf8025
|
|
Cc: qemu-stable@nongnu.org
|
|
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Message-Id: <20210909081219.308065-2-armbru@redhat.com>
|
|
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
|
|
Signed-off-by: Li Zhang <li.zhang@suse.com>
|
|
---
|
|
monitor/hmp-cmds.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
|
|
index e00255f7ee707c9a430268183a6b..a7e197a90bf7f5ad8c71140c6d55 100644
|
|
--- a/monitor/hmp-cmds.c
|
|
+++ b/monitor/hmp-cmds.c
|
|
@@ -1496,7 +1496,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
|
|
}
|
|
if (strcmp(target, "passwd") == 0 ||
|
|
strcmp(target, "password") == 0) {
|
|
- if (arg) {
|
|
+ if (!arg) {
|
|
MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
|
|
monitor_read_password(hmp_mon, hmp_change_read_arg, NULL);
|
|
return;
|