aboutsummaryrefslogtreecommitdiff
path: root/ui/ui-qmp-cmds.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-03-01 19:40:14 +0100
committerJuan Quintela <quintela@redhat.com>2023-04-24 15:01:46 +0200
commitf9e1ef7482f1ee289b04f4b45702a1701bc8929d (patch)
treeecd4dcfb6649c0c5c8cd9c15805a7fd152cb7b38 /ui/ui-qmp-cmds.c
parentc938157713e723165a42cb6e8364adb6fcbd0e22 (diff)
spice: move client_migrate_info command to ui/
It has nothing to do with migration, except for the "migrate" in the name of the command. Move it with the rest of the ui commands. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'ui/ui-qmp-cmds.c')
-rw-r--r--ui/ui-qmp-cmds.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c
index dbc4afcd73..a37a7024f3 100644
--- a/ui/ui-qmp-cmds.c
+++ b/ui/ui-qmp-cmds.c
@@ -175,3 +175,32 @@ void qmp_display_update(DisplayUpdateOptions *arg, Error **errp)
abort();
}
}
+
+void qmp_client_migrate_info(const char *protocol, const char *hostname,
+ bool has_port, int64_t port,
+ bool has_tls_port, int64_t tls_port,
+ const char *cert_subject,
+ Error **errp)
+{
+ if (strcmp(protocol, "spice") == 0) {
+ if (!qemu_using_spice(errp)) {
+ return;
+ }
+
+ if (!has_port && !has_tls_port) {
+ error_setg(errp, QERR_MISSING_PARAMETER, "port/tls-port");
+ return;
+ }
+
+ if (qemu_spice.migrate_info(hostname,
+ has_port ? port : -1,
+ has_tls_port ? tls_port : -1,
+ cert_subject)) {
+ error_setg(errp, "Could not set up display for migration");
+ return;
+ }
+ return;
+ }
+
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'");
+}