aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ui/qemu-spice-module.h5
-rw-r--r--include/ui/qemu-spice.h5
-rw-r--r--monitor/misc.c2
-rw-r--r--ui/spice-core.c5
-rw-r--r--ui/spice-module.c10
5 files changed, 21 insertions, 6 deletions
diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h
index 1af0e659a1..7a9963dd58 100644
--- a/include/ui/qemu-spice-module.h
+++ b/include/ui/qemu-spice-module.h
@@ -18,6 +18,11 @@
#ifndef QEMU_SPICE_MODULE_H
#define QEMU_SPICE_MODULE_H
+struct QemuSpiceOps {
+ int (*migrate_info)(const char *h, int p, int t, const char *s);
+};
+
extern int using_spice;
+extern struct QemuSpiceOps qemu_spice;
#endif
diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
index ab523788b9..3157016c2b 100644
--- a/include/ui/qemu-spice.h
+++ b/include/ui/qemu-spice.h
@@ -60,11 +60,6 @@ static inline int qemu_spice_set_pw_expire(time_t expires)
{
return -1;
}
-static inline int qemu_spice_migrate_info(const char *h, int p, int t,
- const char *s)
-{
- return -1;
-}
static inline int qemu_spice_display_add_client(int csock, int skipauth,
int tls)
diff --git a/monitor/misc.c b/monitor/misc.c
index 4a859fb24a..32e6a8c13d 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -437,7 +437,7 @@ void qmp_client_migrate_info(const char *protocol, const char *hostname,
return;
}
- if (qemu_spice_migrate_info(hostname,
+ if (qemu_spice.migrate_info(hostname,
has_port ? port : -1,
has_tls_port ? tls_port : -1,
cert_subject)) {
diff --git a/ui/spice-core.c b/ui/spice-core.c
index a7fa574358..b03d743cf9 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -993,8 +993,13 @@ int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd)
return spice_display_is_running;
}
+static struct QemuSpiceOps real_spice_ops = {
+ .migrate_info = qemu_spice_migrate_info,
+};
+
static void spice_register_config(void)
{
+ qemu_spice = real_spice_ops;
qemu_add_opts(&qemu_spice_opts);
}
opts_init(spice_register_config);
diff --git a/ui/spice-module.c b/ui/spice-module.c
index f86b0ac517..f1939545a6 100644
--- a/ui/spice-module.c
+++ b/ui/spice-module.c
@@ -21,3 +21,13 @@
#include "ui/qemu-spice-module.h"
int using_spice;
+
+static int qemu_spice_migrate_info_stub(const char *h, int p, int t,
+ const char *s)
+{
+ return -1;
+}
+
+struct QemuSpiceOps qemu_spice = {
+ .migrate_info = qemu_spice_migrate_info_stub,
+};