summaryrefslogtreecommitdiffstats
path: root/hmp.c
diff options
context:
space:
mode:
authorPeter Maydell2015-03-08 10:47:55 +0100
committerPeter Maydell2015-03-08 10:47:55 +0100
commit033c7ddf86fe4315069ac4cf3cfab9bc6035dee7 (patch)
tree9a0fcb113fc5ce223b2b1fcc2596b004571c0d35 /hmp.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20150303-1' into s... (diff)
parenthmp: info spice: take out webdav (diff)
downloadqemu-033c7ddf86fe4315069ac4cf3cfab9bc6035dee7.tar.gz
qemu-033c7ddf86fe4315069ac4cf3cfab9bc6035dee7.tar.xz
qemu-033c7ddf86fe4315069ac4cf3cfab9bc6035dee7.zip
Merge remote-tracking branch 'remotes/spice/tags/pull-spice-20150304-1' into staging
misc spice/qxl fixes. # gpg: Signature made Wed Mar 4 13:57:42 2015 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/spice/tags/pull-spice-20150304-1: hmp: info spice: take out webdav hmp: info spice: Show string channel name qxl: drop update_displaychangelistener call for secondary qxl devices vga: refactor vram_size clamping and rounding qxl: refactor rounding up to a nearest power of 2 spice: fix invalid memory access to vga.vram qxl: document minimal video memory for new modes Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hmp.c')
-rw-r--r--hmp.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/hmp.c b/hmp.c
index 735097c03b..71c28bc816 100644
--- a/hmp.c
+++ b/hmp.c
@@ -29,6 +29,10 @@
#include "block/qapi.h"
#include "qemu-io.h"
+#ifdef CONFIG_SPICE
+#include <spice/enums.h>
+#endif
+
static void hmp_handle_error(Monitor *mon, Error **errp)
{
assert(errp);
@@ -545,6 +549,25 @@ void hmp_info_spice(Monitor *mon, const QDict *qdict)
{
SpiceChannelList *chan;
SpiceInfo *info;
+ const char *channel_name;
+ const char * const channel_names[] = {
+ [SPICE_CHANNEL_MAIN] = "main",
+ [SPICE_CHANNEL_DISPLAY] = "display",
+ [SPICE_CHANNEL_INPUTS] = "inputs",
+ [SPICE_CHANNEL_CURSOR] = "cursor",
+ [SPICE_CHANNEL_PLAYBACK] = "playback",
+ [SPICE_CHANNEL_RECORD] = "record",
+ [SPICE_CHANNEL_TUNNEL] = "tunnel",
+ [SPICE_CHANNEL_SMARTCARD] = "smartcard",
+ [SPICE_CHANNEL_USBREDIR] = "usbredir",
+ [SPICE_CHANNEL_PORT] = "port",
+#if 0
+ /* minimum spice-protocol is 0.12.3, webdav was added in 0.12.7,
+ * no easy way to #ifdef (SPICE_CHANNEL_* is a enum). Disable
+ * as quick fix for build failures with older versions. */
+ [SPICE_CHANNEL_WEBDAV] = "webdav",
+#endif
+ };
info = qmp_query_spice(NULL);
@@ -581,6 +604,15 @@ void hmp_info_spice(Monitor *mon, const QDict *qdict)
chan->value->connection_id);
monitor_printf(mon, " channel: %" PRId64 ":%" PRId64 "\n",
chan->value->channel_type, chan->value->channel_id);
+
+ channel_name = "unknown";
+ if (chan->value->channel_type > 0 &&
+ chan->value->channel_type < ARRAY_SIZE(channel_names) &&
+ channel_names[chan->value->channel_type]) {
+ channel_name = channel_names[chan->value->channel_type];
+ }
+
+ monitor_printf(mon, " channel name: %s\n", channel_name);
}
}