From patchwork Wed Jan 18 17:41:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 136666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 48254B6F68 for ; Thu, 19 Jan 2012 04:42:40 +1100 (EST) Received: from localhost ([::1]:57366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnZWv-0007q6-VF for incoming@patchwork.ozlabs.org; Wed, 18 Jan 2012 12:42:37 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnZWY-0007OD-NN for qemu-devel@nongnu.org; Wed, 18 Jan 2012 12:42:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnZWW-0000P7-U4 for qemu-devel@nongnu.org; Wed, 18 Jan 2012 12:42:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnZWW-0000Oz-JZ for qemu-devel@nongnu.org; Wed, 18 Jan 2012 12:42:12 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0IHgBaW022131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Jan 2012 12:42:11 -0500 Received: from localhost (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0IHg9UE025301; Wed, 18 Jan 2012 12:42:11 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 18 Jan 2012 15:41:17 -0200 Message-Id: <1326908484-13389-8-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1326908484-13389-1-git-send-email-lcapitulino@redhat.com> References: <1326908484-13389-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 07/14] qapi: Introduce change-vnc-password X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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(-) 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); + } +}