diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-20 17:01:33 -0200 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-27 11:48:47 -0200 |
commit | d1f29646f21321e60d1be4e72ac3b6caaa0239cc (patch) | |
tree | 0c179c16292aa81c527b13db4092ee78e5e77dde /hmp.c | |
parent | 2b54aa879ea8490e25107dfc51a6ee268c84c273 (diff) | |
download | qemu-d1f29646f21321e60d1be4e72ac3b6caaa0239cc.zip qemu-d1f29646f21321e60d1be4e72ac3b6caaa0239cc.tar.gz qemu-d1f29646f21321e60d1be4e72ac3b6caaa0239cc.tar.bz2 |
qapi: Convert query-spice
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -306,6 +306,49 @@ out: qapi_free_VncInfo(info); } +void hmp_info_spice(Monitor *mon) +{ + SpiceChannelList *chan; + SpiceInfo *info; + + info = qmp_query_spice(NULL); + + if (!info->enabled) { + monitor_printf(mon, "Server: disabled\n"); + goto out; + } + + monitor_printf(mon, "Server:\n"); + if (info->has_port) { + monitor_printf(mon, " address: %s:%" PRId64 "\n", + info->host, info->port); + } + if (info->has_tls_port) { + monitor_printf(mon, " address: %s:%" PRId64 " [tls]\n", + info->host, info->tls_port); + } + monitor_printf(mon, " auth: %s\n", info->auth); + monitor_printf(mon, " compiled: %s\n", info->compiled_version); + + if (!info->has_channels || info->channels == NULL) { + monitor_printf(mon, "Channels: none\n"); + } else { + for (chan = info->channels; chan; chan = chan->next) { + monitor_printf(mon, "Channel:\n"); + monitor_printf(mon, " address: %s:%s%s\n", + chan->value->host, chan->value->port, + chan->value->tls ? " [tls]" : ""); + monitor_printf(mon, " session: %" PRId64 "\n", + chan->value->connection_id); + monitor_printf(mon, " channel: %" PRId64 ":%" PRId64 "\n", + chan->value->channel_type, chan->value->channel_id); + } + } + +out: + qapi_free_SpiceInfo(info); +} + void hmp_quit(Monitor *mon, const QDict *qdict) { monitor_suspend(mon); |