[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/14] spice: move qemu_spice_init() to QemuSpiceOps.
From: |
Gerd Hoffmann |
Subject: |
[PATCH 03/14] spice: move qemu_spice_init() to QemuSpiceOps. |
Date: |
Mon, 19 Oct 2020 09:52:13 +0200 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/ui/qemu-spice-module.h | 1 +
include/ui/qemu-spice.h | 5 -----
softmmu/vl.c | 2 +-
ui/spice-core.c | 3 ++-
ui/spice-module.c | 5 +++++
5 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/ui/qemu-spice-module.h b/include/ui/qemu-spice-module.h
index 7a9963dd5810..b182bc4c21a6 100644
--- a/include/ui/qemu-spice-module.h
+++ b/include/ui/qemu-spice-module.h
@@ -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);
};
diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
index 3157016c2bb4..e6df0a8715b0 100644
--- a/include/ui/qemu-spice.h
+++ b/include/ui/qemu-spice.h
@@ -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)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index cb476aa70bcc..65c34a6b8a2e 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -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);
diff --git a/ui/spice-core.c b/ui/spice-core.c
index b03d743cf9b9..6ef66eb387de 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -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,
};
diff --git a/ui/spice-module.c b/ui/spice-module.c
index f1939545a684..a30fa452ea93 100644
--- a/ui/spice-module.c
+++ b/ui/spice-module.c
@@ -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,
};
--
2.27.0
- [PATCH 01/14] spice: add module helpers, (continued)
- [PATCH 01/14] spice: add module helpers, Gerd Hoffmann, 2020/10/19
- [PATCH 12/14] spice: flip modules switch, Gerd Hoffmann, 2020/10/19
- [PATCH 14/14] opengl: build opengl helper code modular, Gerd Hoffmann, 2020/10/19
- [PATCH 09/14] spice: load module when enabled on the cmdline, Gerd Hoffmann, 2020/10/19
- [PATCH 02/14] spice: add QemuSpiceOps, move migrate_info, Gerd Hoffmann, 2020/10/19
- [PATCH 13/14] opengl: build egl-headless display modular, Gerd Hoffmann, 2020/10/19
- [PATCH 11/14] modules: add spice dependencies, Gerd Hoffmann, 2020/10/19
- [PATCH 10/14] modules: dependencies infrastructure, Gerd Hoffmann, 2020/10/19
- [PATCH 06/14] spice: move auth functions to QemuSpiceOps., Gerd Hoffmann, 2020/10/19
- [PATCH 03/14] spice: move qemu_spice_init() to QemuSpiceOps.,
Gerd Hoffmann <=
- [PATCH 07/14] spice: move display_add_client() to QemuSpiceOps., Gerd Hoffmann, 2020/10/19
- [PATCH 05/14] spice: move add_interface() to QemuSpiceOps., Gerd Hoffmann, 2020/10/19
- Re: [PATCH 00/14] ui: build spice and opengl as module., Marc-André Lureau, 2020/10/20
- Re: [PATCH 00/14] ui: build spice and opengl as module., Bruce Rogers, 2020/10/26