From patchwork Fri Sep 2 17:34:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 113185 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 57C70B6F69 for ; Sat, 3 Sep 2011 04:24:45 +1000 (EST) Received: from localhost ([::1]:52025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzXf1-0002Nl-Vd for incoming@patchwork.ozlabs.org; Fri, 02 Sep 2011 13:36:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]:48784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzXeL-0001Hp-Av for qemu-devel@nongnu.org; Fri, 02 Sep 2011 13:35:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzXeK-00024u-7y for qemu-devel@nongnu.org; Fri, 02 Sep 2011 13:35:29 -0400 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:35536 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzXeK-00024j-0a for qemu-devel@nongnu.org; Fri, 02 Sep 2011 13:35:28 -0400 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id p82HZOFo023140; Fri, 2 Sep 2011 12:35:25 -0500 Received: (from anthony@localhost) by localhost6.localdomain6 (8.14.4/8.14.4/Submit) id p82HZNno023090; Fri, 2 Sep 2011 12:35:23 -0500 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Fri, 2 Sep 2011 12:34:55 -0500 Message-Id: <1314984898-19141-13-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314984898-19141-1-git-send-email-aliguori@us.ibm.com> References: <1314984898-19141-1-git-send-email-aliguori@us.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 70.123.132.139 Cc: Kevin Wolf , Anthony Liguori , Michael Roth , Luiz Capitulino Subject: [Qemu-devel] [PATCH 12/15] qapi: add change-vnc-listen (v2) 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 only command to change the VNC server's listening address. Signed-off-by: Anthony Liguori --- v1 -> v2 - Enhanced docs (Luiz) --- qapi-schema.json | 15 +++++++++++++++ qmp-commands.hx | 8 ++++++++ qmp.c | 7 +++++++ 3 files changed, 30 insertions(+), 0 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 350cf1c..0c6c9b8 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -109,3 +109,18 @@ # string. Existing clients are unaffected by executing this command. ## { 'command': 'change-vnc-password', 'data': {'password': 'str'} } + +## +# @change-vnc-listen: +# +# Change the host that the VNC server listens on. +# +# @target: the new server specification to listen on +# +# Since: 1.0 +# +# Notes: At this moment in time, the behavior of existing client connections +# when this command is executed is undefined. The authentication +# settings may change after executing this command. +## +{ 'command': 'change-vnc-listen', 'data': {'target': 'str'} } diff --git a/qmp-commands.hx b/qmp-commands.hx index 7df3938..5cab212 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -876,6 +876,14 @@ EQMP }, { + .name = "change-vnc-listen", + .args_type = "target:s", + .params = "target", + .help = "set vnc listening address", + .mhandler.cmd_new = qmp_marshal_input_change_vnc_listen, + }, + + { .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 f817a88..73d6172 100644 --- a/qmp.c +++ b/qmp.c @@ -35,3 +35,10 @@ void qmp_change_vnc_password(const char *password, Error **err) error_set(err, QERR_SET_PASSWD_FAILED); } } + +void qmp_change_vnc_listen(const char *target, Error **err) +{ + if (vnc_display_open(NULL, target) < 0) { + error_set(err, QERR_VNC_SERVER_FAILED, target); + } +}