Skip to content
Snippets Groups Projects
Commit 9cc07651 authored by Zihao Chang's avatar Zihao Chang Committed by Gerd Hoffmann
Browse files

qmp: add new qmp display-reload


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: default avatarZihao Chang <changzihao1@huawei.com>
Message-Id: <20210316075845.1476-4-changzihao1@huawei.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 1f08e341
No related branches found
No related tags found
No related merge requests found
......@@ -334,3 +334,20 @@ 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:
#ifdef CONFIG_VNC
if (arg->u.vnc.has_tls_certs && arg->u.vnc.tls_certs) {
vnc_display_reload_certs(NULL, errp);
}
#else
error_setg(errp, "vnc is invalid, missing 'CONFIG_VNC'");
#endif
break;
default:
abort();
}
}
......@@ -1168,3 +1168,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 }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment