From 2b54aa879ea8490e25107dfc51a6ee268c84c273 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Mon, 17 Oct 2011 16:41:22 -0200 Subject: qapi: Convert query-vnc There are three important remarks in relation to the non-qapi command: 1. This commit also fixes the behavior of the 'query-vnc' and 'info vnc' commands to return an error when qemu is built without VNC support (ie. --disable-vnc). The non-qapi command would return the OK response in QMP and no response in HMP 2. The qapi version explicitly marks the fields 'host', 'family', 'service' and 'auth' as optional. Their are not documented as optional in the non-qapi command doc, but they would not be returned if vnc support is disabled. The qapi version maintains the same semantics, but documents those fields correctly 3. The 'clients' field, which is a list, is marked as optional but is always returned. If there are no clients connected an empty list is returned. This is not the Right Way to this in the qapi but it's how the non-qapi command used to work Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- qmp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qmp.c') diff --git a/qmp.c b/qmp.c index e84922bff0..3a58cfe35f 100644 --- a/qmp.c +++ b/qmp.c @@ -95,3 +95,13 @@ void qmp_cpu(int64_t index, Error **errp) { /* Just do nothing */ } + +#ifndef CONFIG_VNC +/* If VNC support is enabled, the "true" query-vnc command is + defined in the VNC subsystem */ +VncInfo *qmp_query_vnc(Error **errp) +{ + error_set(errp, QERR_FEATURE_DISABLED, "vnc"); + return NULL; +}; +#endif -- cgit v1.2.1