Patchwork [v3] ui/spice-core: report version in info spice/query-spice

login
register
mail settings
Submitter Alon Levy
Date Aug. 10, 2011, 8:21 a.m.
Message ID <1312964513-11313-1-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/109349/
State New
Headers show

Comments

Alon Levy - Aug. 10, 2011, 8:21 a.m.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
 ui/spice-core.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Patch

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 3d77c01..f22f1d6 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -372,6 +372,10 @@  void do_info_spice_print(Monitor *mon, const QObject *data)
         monitor_printf(mon, "     address: %s:%d [tls]\n", host, port);
     }
     monitor_printf(mon, "        auth: %s\n", qdict_get_str(server, "auth"));
+    monitor_printf(mon, "    compiled: %"PRId64".%"PRId64".%"PRId64"\n",
+                   qdict_get_int(server, "compiled-version-major"),
+                   qdict_get_int(server, "compiled-version-minor"),
+                   qdict_get_int(server, "compiled-version-micro"));
 
     channels = qdict_get_qlist(server, "channels");
     if (qlist_empty(channels)) {
@@ -403,6 +407,12 @@  void do_info_spice(Monitor *mon, QObject **ret_data)
     qdict_put(server, "enabled", qbool_from_int(true));
     qdict_put(server, "auth", qstring_from_str(auth));
     qdict_put(server, "host", qstring_from_str(addr ? addr : "0.0.0.0"));
+    qdict_put(server, "compiled-version-major",
+              qint_from_int((SPICE_SERVER_VERSION & 0xff0000) >> 16));
+    qdict_put(server, "compiled-version-minor",
+              qint_from_int((SPICE_SERVER_VERSION & 0xff00) >> 8));
+    qdict_put(server, "compiled-version-micro",
+              qint_from_int(SPICE_SERVER_VERSION & 0xff));
     if (port) {
         qdict_put(server, "port", qint_from_int(port));
     }