From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwISM-0004qP-FJ for qemu-devel@nongnu.org; Wed, 24 Aug 2011 14:45:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwISL-0006b8-3c for qemu-devel@nongnu.org; Wed, 24 Aug 2011 14:45:42 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:35465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwISL-0006Td-0q for qemu-devel@nongnu.org; Wed, 24 Aug 2011 14:45:41 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p7OIEu6i028284 for ; Wed, 24 Aug 2011 14:14:56 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7OIha1T218090 for ; Wed, 24 Aug 2011 14:43:36 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7OIhWM6011304 for ; Wed, 24 Aug 2011 15:43:32 -0300 From: Anthony Liguori Date: Wed, 24 Aug 2011 13:43:05 -0500 Message-Id: <1314211389-28915-11-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1314211389-28915-1-git-send-email-aliguori@us.ibm.com> References: <1314211389-28915-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 10/14] qapi: add change-vnc-password List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Michael Roth , Luiz Capitulino This is a new QMP only command that only changes the VNC password. Signed-off-by: Anthony Liguori --- 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..3b2229f 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. +# +# @target: 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 909c778..d60f72f 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