From: Zihao Chang <changzihao1@huawei.com>
To: <qemu-devel@nongnu.org>
Cc: berrange@redhat.com, oscar.zhangbo@huawei.com,
changzihao1@huawei.com, armbru@redhat.com,
xiexiangyou@huawei.com, yebiaoxiang@huawei.com,
kraxel@redhat.com
Subject: [PATCH v7 3/3] qmp: add new qmp display-reload
Date: Mon, 15 Mar 2021 21:16:09 +0800 [thread overview]
Message-ID: <20210315131609.2208-4-changzihao1@huawei.com> (raw)
In-Reply-To: <20210315131609.2208-1-changzihao1@huawei.com>
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":{"type": "vnc", "tls-certs": true}}
Signed-off-by: Zihao Chang <changzihao1@huawei.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
---
monitor/qmp-cmds.c | 13 ++++++++++
qapi/ui.json | 61 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index c7df8c0ee268..e059e285ab6f 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(DisplayReloadOptions *arg, Error **errp)
+{
+ switch (arg->type) {
+ case DISPLAY_RELOAD_TYPE_VNC:
+ if (arg->u.vnc.has_tls_certs && arg->u.vnc.tls_certs) {
+ vnc_display_reload_certs(NULL, errp);
+ }
+ break;
+ default:
+ abort();
+ }
+}
diff --git a/qapi/ui.json b/qapi/ui.json
index d08d72b43923..c77cfa8bb900 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1179,3 +1179,64 @@
##
{ 'command': 'query-display-options',
'returns': 'DisplayOptions' }
+
+##
+# @DisplayReloadType:
+#
+# Available DisplayReload types.
+#
+# @vnc: VNC display
+#
+# Since: 6.0
+#
+##
+{ 'enum': 'DisplayReloadType',
+ 'data': ['vnc'] }
+
+##
+# @DisplayReloadOptionsVNC:
+#
+# Specify the VNC reload options.
+#
+# @tls-certs: reload tls certs or not.
+#
+# Since: 6.0
+#
+##
+{ 'struct': 'DisplayReloadOptionsVNC',
+ 'data': { '*tls-certs': 'bool' } }
+
+##
+# @DisplayReloadOptions:
+#
+# Options of the display configuration reload.
+#
+# @type: Specify the display type.
+#
+# Since: 6.0
+#
+##
+{ 'union': 'DisplayReloadOptions',
+ 'base': {'type': 'DisplayReloadType'},
+ 'discriminator': 'type',
+ 'data': { 'vnc': 'DisplayReloadOptionsVNC' }}
+
+##
+# @display-reload:
+#
+# Reload display configuration.
+#
+# Returns: Nothing on success.
+#
+# Since: 6.0
+#
+# Example:
+#
+# -> { "execute": "display-reload",
+# "arguments": { "type": "vnc", "tls-certs": true } }
+# <- { "return": {} }
+#
+##
+{ 'command': 'display-reload',
+ 'data': 'DisplayReloadOptions',
+ 'boxed' : true }
--
2.28.0
next prev parent reply other threads:[~2021-03-15 13:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 13:16 [PATCH v7 0/3] vnc: support reload x509 certificates Zihao Chang
2021-03-15 13:16 ` [PATCH v7 1/3] crypto: add reload for QCryptoTLSCredsClass Zihao Chang
2021-03-15 13:32 ` Daniel P. Berrangé
2021-03-15 13:16 ` [PATCH v7 2/3] vnc: support reload x509 certificates for vnc Zihao Chang
2021-03-15 13:16 ` Zihao Chang [this message]
2021-03-15 13:31 ` [PATCH v7 3/3] qmp: add new qmp display-reload Daniel P. Berrangé
2021-03-15 18:07 ` [PATCH v7 0/3] vnc: support reload x509 certificates Gerd Hoffmann
2021-03-16 8:13 ` Zihao Chang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210315131609.2208-4-changzihao1@huawei.com \
--to=changzihao1@huawei.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=oscar.zhangbo@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=xiexiangyou@huawei.com \
--cc=yebiaoxiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.