diff mbox series

[v3,3/3] qmp: add new qmp display-reload

Message ID 20210207074710.1029-4-changzihao1@huawei.com (mailing list archive)
State New, archived
Headers show
Series vnc: support reload x509 certificates | expand

Commit Message

Zihao Chang Feb. 7, 2021, 7:47 a.m. UTC
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 | 12 ++++++++++++
 qapi/ui.json       | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)

Comments

Gerd Hoffmann Feb. 17, 2021, 1:21 p.m. UTC | #1
> +##
> +# @DiaplayReloadInfo:

Display

> +{ 'struct': 'DiaplayReloadInfo',

Same here.

take care,
  Gerd
diff mbox series

Patch

diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index c7df8c0ee268..edf543a4febf 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -334,3 +334,15 @@  MemoryInfo *qmp_query_memory_size_summary(Error **errp)
 
     return mem_info;
 }
+
+void qmp_display_reload(DiaplayReloadInfo *arg, Error **errp)
+{
+    Error *local_err = NULL;
+
+    if (arg->has_vnc_tls_certs && arg->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..019283aad208 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1179,3 +1179,35 @@ 
 ##
 { 'command': 'query-display-options',
   'returns': 'DisplayOptions' }
+
+##
+# @DiaplayReloadInfo:
+#
+# The basic information for reload Display configuration
+#
+# @vnc-tls-certs: whether to reload tls certs
+#
+# Since: 6.0
+##
+{ 'struct': 'DiaplayReloadInfo',
+  'data': { '*vnc-tls-certs': 'bool' } }
+
+##
+# @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': 'DiaplayReloadInfo',
+  'boxed' : true }