From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnDXc-0000Iz-FW for qemu-devel@nongnu.org; Tue, 17 Jan 2012 13:13:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnDXb-0003jv-HD for qemu-devel@nongnu.org; Tue, 17 Jan 2012 13:13:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnDXb-0003jo-6p for qemu-devel@nongnu.org; Tue, 17 Jan 2012 13:13:51 -0500 Date: Tue, 17 Jan 2012 16:13:45 -0200 From: Luiz Capitulino Message-ID: <20120117161345.4defb186@doriath> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2] qapi: Introduce change-vnc-password List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org New QMP command to change the VNC password. Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino Signed-off-by: Luiz Capitulino --- qapi-schema.json | 14 ++++++++++++++ qmp-commands.hx | 6 ++++++ qmp.c | 7 +++++++ 3 files changed, 27 insertions(+), 0 deletions(-) v2 o don't disable login when password="" (set it to the empty string instead) PS: Sending this alone because it was the only relevant change in conversions round 4 series: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg00950.html diff --git a/qapi-schema.json b/qapi-schema.json index 42682eb..fe935a9 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 185beba..886d589 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 8b7b379..f218485 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); + } +} -- 1.7.9.rc0.dirty