diff options
author | Markus Armbruster <armbru@redhat.com> | 2023-01-09 20:03:13 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2023-01-19 13:30:01 +0100 |
commit | 9949b06e2e95f821a76215194413bb78aa782d53 (patch) | |
tree | 07ecea26e7eb81386997f4c0eb46b999bf43a3dd /monitor/qmp-cmds.c | |
parent | 61d7f2a9569b56ac1970d52fe3c7683e70998ed8 (diff) |
ui: Move QMP commands from monitor to new ui/ui-qmp-cmds.c
This moves these commands from MAINTAINERS section "QMP" to
"Graphics".
Command add-client applies to socket character devices in addition to
display devices. Move it anyway. Aside: the way @protocol character
device IDs and display types is bad design.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230109190321.1056914-10-armbru@redhat.com>
Diffstat (limited to 'monitor/qmp-cmds.c')
-rw-r--r-- | monitor/qmp-cmds.c | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 6d6df86607..61449f1b58 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -36,9 +36,7 @@ #include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-commands-stats.h" -#include "qapi/qapi-commands-ui.h" #include "qapi/type-helpers.h" -#include "qapi/qmp/qerror.h" #include "exec/ramlist.h" #include "hw/mem/memory-device.h" #include "hw/acpi/acpi_dev_interface.h" @@ -168,89 +166,6 @@ void qmp_system_wakeup(Error **errp) qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, errp); } -void qmp_set_password(SetPasswordOptions *opts, Error **errp) -{ - int rc; - - if (opts->protocol == DISPLAY_PROTOCOL_SPICE) { - if (!qemu_using_spice(errp)) { - return; - } - rc = qemu_spice.set_passwd(opts->password, - opts->connected == SET_PASSWORD_ACTION_FAIL, - opts->connected == SET_PASSWORD_ACTION_DISCONNECT); - } else { - assert(opts->protocol == DISPLAY_PROTOCOL_VNC); - if (opts->connected != SET_PASSWORD_ACTION_KEEP) { - /* vnc supports "connected=keep" only */ - error_setg(errp, QERR_INVALID_PARAMETER, "connected"); - return; - } - /* - * Note that setting an empty password will not disable login - * through this interface. - */ - rc = vnc_display_password(opts->u.vnc.display, opts->password); - } - - if (rc != 0) { - error_setg(errp, "Could not set password"); - } -} - -void qmp_expire_password(ExpirePasswordOptions *opts, Error **errp) -{ - time_t when; - int rc; - const char *whenstr = opts->time; - const char *numstr = NULL; - uint64_t num; - - if (strcmp(whenstr, "now") == 0) { - when = 0; - } else if (strcmp(whenstr, "never") == 0) { - when = TIME_MAX; - } else if (whenstr[0] == '+') { - when = time(NULL); - numstr = whenstr + 1; - } else { - when = 0; - numstr = whenstr; - } - - if (numstr) { - if (qemu_strtou64(numstr, NULL, 10, &num) < 0) { - error_setg(errp, "Parameter 'time' doesn't take value '%s'", - whenstr); - return; - } - when += num; - } - - if (opts->protocol == DISPLAY_PROTOCOL_SPICE) { - if (!qemu_using_spice(errp)) { - return; - } - rc = qemu_spice.set_pw_expire(when); - } else { - assert(opts->protocol == DISPLAY_PROTOCOL_VNC); - rc = vnc_display_pw_expire(opts->u.vnc.display, when); - } - - if (rc != 0) { - error_setg(errp, "Could not set password expire time"); - } -} - -#ifdef CONFIG_VNC -void qmp_change_vnc_password(const char *password, Error **errp) -{ - if (vnc_display_password(NULL, password) < 0) { - error_setg(errp, "Could not set password"); - } -} -#endif - void qmp_add_client(const char *protocol, const char *fdname, bool has_skipauth, bool skipauth, bool has_tls, bool tls, Error **errp) @@ -305,7 +220,6 @@ void qmp_add_client(const char *protocol, const char *fdname, } } - MemoryDeviceInfoList *qmp_query_memory_devices(Error **errp) { return qmp_memory_device_list(); @@ -344,38 +258,6 @@ 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(); - } -} - -void qmp_display_update(DisplayUpdateOptions *arg, Error **errp) -{ - switch (arg->type) { - case DISPLAY_UPDATE_TYPE_VNC: -#ifdef CONFIG_VNC - vnc_display_update(&arg->u.vnc, errp); -#else - error_setg(errp, "vnc is invalid, missing 'CONFIG_VNC'"); -#endif - break; - default: - abort(); - } -} - static int qmp_x_query_rdma_foreach(Object *obj, void *opaque) { RdmaProvider *rdma; |