aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-09-09 10:12:18 +0200
committerMichael Roth <michael.roth@amd.com>2021-10-15 17:54:16 -0500
commitf22c225e2359429508d65f581b9bdf457a0ac069 (patch)
treea2e4a375931211576a5aa9b75386a343c75ac8a6
parent916372e48faf47ce0950d4cf2ae7d0b63c803227 (diff)
downloadqemu-f22c225e2359429508d65f581b9bdf457a0ac069.zip
qemu-f22c225e2359429508d65f581b9bdf457a0ac069.tar.gz
qemu-f22c225e2359429508d65f581b9bdf457a0ac069.tar.bz2
hmp: Unbreak "change vnc"
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> (cherry picked from commit 6193344f9337f8b76cd44ce94a32c9900d907d35) Signed-off-by: Michael Roth <michael.roth@amd.com>
-rw-r--r--monitor/hmp-cmds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index cc15d9b..384cd18 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1492,7 +1492,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;