[pve-devel] [PATCH 16/31] PVE: qapi: modify spice query

Dietmar Maurer dietmar at proxmox.com
Fri Mar 6 12:29:56 CET 2020


From: Wolfgang Bumiller <w.bumiller at proxmox.com>

Provide the last ticket in the SpiceInfo struct optionally.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 qapi/ui.json    | 3 +++
 ui/spice-core.c | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/qapi/ui.json b/qapi/ui.json
index e04525d8b4..6127990e23 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -211,11 +211,14 @@
 #
 # @channels: a list of @SpiceChannel for each active spice channel
 #
+# @ticket: The last ticket set with set_password
+#
 # Since: 0.14.0
 ##
 { 'struct': 'SpiceInfo',
   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
+           '*ticket': 'str',
            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']},
   'if': 'defined(CONFIG_SPICE)' }
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index ca04965ead..243466c13d 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -539,6 +539,11 @@ SpiceInfo *qmp_query_spice(Error **errp)
     micro = SPICE_SERVER_VERSION & 0xff;
     info->compiled_version = g_strdup_printf("%d.%d.%d", major, minor, micro);
 
+    if (auth_passwd) {
+        info->has_ticket = true;
+        info->ticket =  g_strdup(auth_passwd);
+    }
+
     if (port) {
         info->has_port = true;
         info->port = port;
-- 
2.20.1




More information about the pve-devel mailing list