From patchwork Thu Jan 14 16:50:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 42908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A715CB7CCD for ; Fri, 15 Jan 2010 03:55:32 +1100 (EST) Received: from localhost ([127.0.0.1]:40067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVSyn-0000lE-UH for incoming@patchwork.ozlabs.org; Thu, 14 Jan 2010 11:55:29 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NVSvT-0007Ai-3I for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:52:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NVSvN-00076b-DN for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:52:02 -0500 Received: from [199.232.76.173] (port=44448 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NVSvN-00076N-6b for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:51:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3835) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NVSvM-0002At-MU for qemu-devel@nongnu.org; Thu, 14 Jan 2010 11:51:56 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0EGptFw013277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Jan 2010 11:51:55 -0500 Received: from localhost (vpn-10-170.rdu.redhat.com [10.11.10.170]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0EGpsWL025994; Thu, 14 Jan 2010 11:51:54 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 14 Jan 2010 14:50:52 -0200 Message-Id: <1263487859-6318-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1263487859-6318-1-git-send-email-lcapitulino@redhat.com> References: <1263487859-6318-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: armbru@redhat.com Subject: [Qemu-devel] [PATCH 1/8] VNC: Use 'enabled' key instead of 'status' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently the 'status' key is a string whose value can be "disabled" or "enabled", change it to the QMP's standard 'enabled' key, which is a bool. Note that 'status' in being dropped and this wouldn't be allowed if QMP were stable. Signed-off-by: Luiz Capitulino --- vnc.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vnc.c b/vnc.c index 58eac73..ef86ef7 100644 --- a/vnc.c +++ b/vnc.c @@ -254,7 +254,7 @@ void do_info_vnc_print(Monitor *mon, const QObject *data) QList *clients; server = qobject_to_qdict(data); - if (strcmp(qdict_get_str(server, "status"), "disabled") == 0) { + if (qdict_get_bool(server, "enabled") == 0) { monitor_printf(mon, "Server: disabled\n"); return; } @@ -282,7 +282,7 @@ void do_info_vnc_print(Monitor *mon, const QObject *data) * * The main QDict contains the following: * - * - "status": "disabled" or "enabled" + * - "enabled": true or false * - "host": server's IP address * - "service": server's port number * - "auth": authentication method (optional) @@ -297,13 +297,13 @@ void do_info_vnc_print(Monitor *mon, const QObject *data) * * Example: * - * { "status": "enabled", "host": "0.0.0.0", "service": "50402", "auth": "vnc", + * { "enabled": true, "host": "0.0.0.0", "service": "50402", "auth": "vnc", * "clients": [ { "host": "127.0.0.1", "service": "50401" } ] } */ void do_info_vnc(Monitor *mon, QObject **ret_data) { if (vnc_display == NULL || vnc_display->display == NULL) { - *ret_data = qobject_from_jsonf("{ 'status': 'disabled' }"); + *ret_data = qobject_from_jsonf("{ 'enabled': false }"); } else { QDict *qdict; QList *clist; @@ -319,7 +319,7 @@ void do_info_vnc(Monitor *mon, QObject **ret_data) } } - *ret_data = qobject_from_jsonf("{ 'status': 'enabled', 'clients': %p }", + *ret_data = qobject_from_jsonf("{ 'enabled': true, 'clients': %p }", QOBJECT(clist)); assert(*ret_data != NULL);