[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/15] qapi: add change-vnc-password (v2)
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 11/15] qapi: add change-vnc-password (v2) |
Date: |
Fri, 2 Sep 2011 12:34:54 -0500 |
This is a new QMP only command that only changes the VNC password.
Signed-off-by: Anthony Liguori <address@hidden>
---
v1 -> v2
- fix schema documentation
---
qapi-schema.json | 13 +++++++++++++
qmp-commands.hx | 8 ++++++++
qmp.c | 11 ++++++++++-
3 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index f159d81..350cf1c 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -96,3 +96,16 @@
{ 'command': 'set-blockdev-password',
'data': {'device': 'str', 'password': 'str'} }
+##
+# @change-vnc-password:
+#
+# Change the VNC server password.
+#
+# @password: the new password to use with VNC authentication
+#
+# Since: 1.0
+#
+# 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 1de5af5..7df3938 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -868,6 +868,14 @@ Example:
EQMP
{
+ .name = "change-vnc-password",
+ .args_type = "password:s",
+ .params = "password",
+ .help = "set vnc password",
+ .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
+ },
+
+ {
.name = "set_password",
.args_type = "protocol:s,password:s,connected:s?",
.params = "protocol password action-if-connected",
diff --git a/qmp.c b/qmp.c
index 8aa9c66..f817a88 100644
--- a/qmp.c
+++ b/qmp.c
@@ -12,9 +12,11 @@
*/
#include "qemu-common.h"
-#include "sysemu.h"
#include "qmp-commands.h"
+#include "sysemu.h"
+#include "console.h"
+
NameInfo *qmp_query_name(Error **errp)
{
NameInfo *info = g_malloc0(sizeof(*info));
@@ -26,3 +28,10 @@ NameInfo *qmp_query_name(Error **errp)
return info;
}
+
+void qmp_change_vnc_password(const char *password, Error **err)
+{
+ if (vnc_display_password(NULL, password) < 0) {
+ error_set(err, QERR_SET_PASSWD_FAILED);
+ }
+}
--
1.7.4.1
- [Qemu-devel] [PATCH 02/15] qerror: add qerror_report_err() (v2), (continued)
- [Qemu-devel] [PATCH 02/15] qerror: add qerror_report_err() (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 03/15] qapi: add code generation support for middle mode, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 04/15] qapi: use middle mode in QMP server (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 05/15] qapi: convert query-name, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 07/15] monitor: expose readline state, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 08/15] qerror: add additional parameter to QERR_DEVICE_ENCRYPTED, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 06/15] block: add unsafe_probe, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 09/15] qapi: convert eject (qmp and hmp) to QAPI, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 10/15] qapi: convert block_passwd and add set-blockdev-password, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 11/15] qapi: add change-vnc-password (v2),
Anthony Liguori <=
- [Qemu-devel] [PATCH 12/15] qapi: add change-vnc-listen (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 13/15] qapi: introduce drive-change (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 14/15] qapi: convert change (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 15/15] vnc: don't demote authentication protocol when disabling login, Anthony Liguori, 2011/09/02
- Re: [Qemu-devel] [PATCH 00/15] Convert commands to QAPI (batch 1) (v2), Alexander Graf, 2011/09/07