@@ -19,6 +19,7 @@
#define QEMU_SPICE_MODULE_H
struct QemuSpiceOps {
+ void (*init)(void);
int (*migrate_info)(const char *h, int p, int t, const char *s);
};
@@ -26,7 +26,6 @@
#include <spice.h>
#include "qemu/config-file.h"
-void qemu_spice_init(void);
void qemu_spice_input_init(void);
void qemu_spice_display_init(void);
int qemu_spice_display_add_client(int csock, int skipauth, int tls);
@@ -74,10 +73,6 @@ static inline void qemu_spice_display_init(void)
abort();
}
-static inline void qemu_spice_init(void)
-{
-}
-
#endif /* CONFIG_SPICE */
static inline bool qemu_using_spice(Error **errp)
@@ -4151,7 +4151,7 @@ void qemu_init(int argc, char **argv, char **envp)
/* spice needs the timers to be initialized by this point */
/* spice must initialize before audio as it changes the default auiodev */
/* spice must initialize before chardevs (for spicevmc and spiceport) */
- qemu_spice_init();
+ qemu_spice.init();
qemu_opts_foreach(qemu_find_opts("chardev"),
chardev_init_func, NULL, &error_fatal);
@@ -633,7 +633,7 @@ static void vm_change_state_handler(void *opaque, int running,
}
}
-void qemu_spice_init(void)
+static void qemu_spice_init(void)
{
QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head);
const char *password, *str, *x509_dir, *addr,
@@ -994,6 +994,7 @@ int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd)
}
static struct QemuSpiceOps real_spice_ops = {
+ .init = qemu_spice_init,
.migrate_info = qemu_spice_migrate_info,
};
@@ -22,6 +22,10 @@
int using_spice;
+static void qemu_spice_init_stub(void)
+{
+}
+
static int qemu_spice_migrate_info_stub(const char *h, int p, int t,
const char *s)
{
@@ -29,5 +33,6 @@ static int qemu_spice_migrate_info_stub(const char *h, int p, int t,
}
struct QemuSpiceOps qemu_spice = {
+ .init = qemu_spice_init_stub,
.migrate_info = qemu_spice_migrate_info_stub,
};