From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXMjo-0004S3-8K for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:39:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXMji-0004Oz-UZ for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:39:51 -0500 Received: from [199.232.76.173] (port=43478 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXMji-0004Ot-R1 for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:39:46 -0500 Received: from mail-qy0-f197.google.com ([209.85.221.197]:40718) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXMji-0004s0-Ji for qemu-devel@nongnu.org; Tue, 19 Jan 2010 17:39:46 -0500 Received: by qyk35 with SMTP id 35so1358126qyk.19 for ; Tue, 19 Jan 2010 14:39:46 -0800 (PST) Message-ID: <4B5634AE.3040800@codemonkey.ws> Date: Tue, 19 Jan 2010 16:39:42 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/8] VNC: Use 'enabled' key instead of 'status' References: <1263487859-6318-1-git-send-email-lcapitulino@redhat.com> <1263487859-6318-2-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1263487859-6318-2-git-send-email-lcapitulino@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: qemu-devel@nongnu.org, armbru@redhat.com On 01/14/2010 10:50 AM, Luiz Capitulino wrote: > 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 > Applied all. Thanks. Regards, Anthony Liguori > --- > 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); > >