[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/7] VNC: Use 'enabled' key instead of 'status'
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 1/7] VNC: Use 'enabled' key instead of 'status' |
Date: |
Fri, 8 Jan 2010 19:47:10 -0200 |
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 <address@hidden>
---
vnc.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/vnc.c b/vnc.c
index c54c6e0..529abec 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);
--
1.6.6
- [Qemu-devel] [RFC 0/7]: Add VNC connect/disconnect events, Luiz Capitulino, 2010/01/08
- [Qemu-devel] [PATCH 1/7] VNC: Use 'enabled' key instead of 'status',
Luiz Capitulino <=
- [Qemu-devel] [PATCH 2/7] VNC: Make 'auth' key mandatory, Luiz Capitulino, 2010/01/08
- [Qemu-devel] [PATCH 3/7] VNC: Rename client's 'username' key, Luiz Capitulino, 2010/01/08
- [Qemu-devel] [PATCH 4/7] VNC: Add 'family' key, Luiz Capitulino, 2010/01/08
- [Qemu-devel] [PATCH 5/7] VNC: Cache client info at connection time, Luiz Capitulino, 2010/01/08
- [Qemu-devel] [PATCH 6/7] QMP: Introduce QMP disconnect event, Luiz Capitulino, 2010/01/08
- [Qemu-devel] [PATCH 7/7] QMP: Introduce QMP connect event, Luiz Capitulino, 2010/01/08
- [Qemu-devel] Re: [RFC 0/7]: Add VNC connect/disconnect events, Daniel P. Berrange, 2010/01/11