summaryrefslogtreecommitdiff
path: root/hmp.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2011-10-20 17:01:33 -0200
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-27 11:48:47 -0200
commitb30e67c5a9654673e65f5df03210398db21cb6f9 (patch)
tree0c179c16292aa81c527b13db4092ee78e5e77dde /hmp.c
parentd95e4355cd454324f59fb2d885fe7633087ccea4 (diff)
downloadqemu-b30e67c5a9654673e65f5df03210398db21cb6f9.tar.gz
qemu-b30e67c5a9654673e65f5df03210398db21cb6f9.tar.bz2
qemu-b30e67c5a9654673e65f5df03210398db21cb6f9.zip
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.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/hmp.c b/hmp.c
index 6d86fe3d1c..aae13c093b 100644
--- a/hmp.c
+++ b/hmp.c
@@ -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);