qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v5 3/3] qmp: add new qmp display-reload


From: Zihao Chang
Subject: [PATCH v5 3/3] qmp: add new qmp display-reload
Date: Thu, 11 Mar 2021 18:54:24 +0800

This patch provides a new qmp to reload display configuration
without restart VM, but only reloading the vnc tls certificates
is implemented.
Example:
{"execute": "display-reload", "arguments":{"vnc-tls-certs": true}}

Signed-off-by: Zihao Chang <changzihao1@huawei.com>
---
 monitor/qmp-cmds.c | 13 +++++++++++++
 qapi/ui.json       | 19 +++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index c7df8c0ee268..0f791f974f30 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -334,3 +334,16 @@ MemoryInfo *qmp_query_memory_size_summary(Error **errp)
 
     return mem_info;
 }
+
+void qmp_display_reload(bool has_vnc_tls_certs, bool vnc_tls_certs,
+                        Error **errp)
+{
+    Error *local_err = NULL;
+
+    if (has_vnc_tls_certs && vnc_tls_certs) {
+        if (!vnc_display_reload_certs(NULL, &local_err)) {
+            error_propagate(errp, local_err);
+            return;
+        }
+    }
+}
diff --git a/qapi/ui.json b/qapi/ui.json
index d08d72b43923..97b38aa1666e 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1179,3 +1179,22 @@
 ##
 { 'command': 'query-display-options',
   'returns': 'DisplayOptions' }
+
+##
+# @display-reload:
+#
+# Reload display configuration
+#
+# Returns: Nothing on success
+#
+# Since: 6.0
+#
+# Example:
+#
+# -> { "execute": "display-reload",
+#      "arguments": { "vnc-tls-certs": true } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'display-reload',
+  'data': { '*vnc-tls-certs': 'bool' } }
-- 
2.28.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]