summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-12-08 11:45:55 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2012-01-18 10:23:39 -0200
commit270b243f91cdae380eb02396e57452c15dbcef86 (patch)
treeb18d5ce1084d8d88bbc87547a07d0128d846a52c
parent7060b478d3f3a8bc7a282292609ff5aec6de1958 (diff)
downloadqemu-270b243f91cdae380eb02396e57452c15dbcef86.tar.gz
qemu-270b243f91cdae380eb02396e57452c15dbcef86.tar.bz2
qemu-270b243f91cdae380eb02396e57452c15dbcef86.zip
qapi: Introduce change-vnc-password
New QMP command to change the VNC password. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--qapi-schema.json14
-rw-r--r--qmp-commands.hx6
-rw-r--r--qmp.c7
3 files changed, 27 insertions, 0 deletions
diff --git a/qapi-schema.json b/qapi-schema.json
index 42682eb2e2..fe935a9d7e 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1352,3 +1352,17 @@
# Since: 0.14.0
##
{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
+
+##
+# @change-vnc-password:
+#
+# Change the VNC server password.
+#
+# @target: the new password to use with VNC authentication
+#
+# Since: 1.1
+#
+# Notes: An empty password in this command will set the password to the empty
+# string. Existing clients are unaffected by executing this command.
+##
+{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 185bebabee..886d589fd5 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2018,3 +2018,9 @@ EQMP
.args_type = "path:s,property:s",
.mhandler.cmd_new = qmp_qom_get,
},
+
+ {
+ .name = "change-vnc-password",
+ .args_type = "password:s",
+ .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
+ },
diff --git a/qmp.c b/qmp.c
index 8b7b37999d..f218485ef1 100644
--- a/qmp.c
+++ b/qmp.c
@@ -343,3 +343,10 @@ void qmp_expire_password(const char *protocol, const char *whenstr,
error_set(errp, QERR_INVALID_PARAMETER, "protocol");
}
+
+void qmp_change_vnc_password(const char *password, Error **errp)
+{
+ if (vnc_display_password(NULL, password) < 0) {
+ error_set(errp, QERR_SET_PASSWD_FAILED);
+ }
+}