OSDN Git Service

spice: move display_init() to QemuSpiceOps.
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 19 Oct 2020 07:52:14 +0000 (09:52 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 21 Oct 2020 13:46:14 +0000 (15:46 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20201019075224.14803-5-kraxel@redhat.com

include/ui/qemu-spice-module.h
include/ui/qemu-spice.h
softmmu/vl.c
ui/spice-core.c
ui/spice-module.c

index b182bc4..dbe0903 100644 (file)
@@ -20,6 +20,7 @@
 
 struct QemuSpiceOps {
     void (*init)(void);
+    void (*display_init)(void);
     int (*migrate_info)(const char *h, int p, int t, const char *s);
 };
 
index e6df0a8..a3fd1ea 100644 (file)
@@ -66,13 +66,6 @@ static inline int qemu_spice_display_add_client(int csock, int skipauth,
     return -1;
 }
 
-static inline void qemu_spice_display_init(void)
-{
-    /* This must never be called if CONFIG_SPICE is disabled */
-    error_report("spice support is disabled");
-    abort();
-}
-
 #endif /* CONFIG_SPICE */
 
 static inline bool qemu_using_spice(Error **errp)
index 65c34a6..8a06fe8 100644 (file)
@@ -4447,7 +4447,7 @@ void qemu_init(int argc, char **argv, char **envp)
 #endif
 
     if (using_spice) {
-        qemu_spice_display_init();
+        qemu_spice.display_init();
     }
 
     if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) {
index 6ef66eb..82d5dbd 100644 (file)
@@ -995,6 +995,7 @@ int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd)
 
 static struct QemuSpiceOps real_spice_ops = {
     .init         = qemu_spice_init,
+    .display_init = qemu_spice_display_init,
     .migrate_info = qemu_spice_migrate_info,
 };
 
index a30fa45..56868aa 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/error-report.h"
 #include "ui/qemu-spice-module.h"
 
 int using_spice;
@@ -26,6 +27,13 @@ static void qemu_spice_init_stub(void)
 {
 }
 
+static void qemu_spice_display_init_stub(void)
+{
+    /* This must never be called if CONFIG_SPICE is disabled */
+    error_report("spice support is disabled");
+    abort();
+}
+
 static int qemu_spice_migrate_info_stub(const char *h, int p, int t,
                                         const char *s)
 {
@@ -34,5 +42,6 @@ static int qemu_spice_migrate_info_stub(const char *h, int p, int t,
 
 struct QemuSpiceOps qemu_spice = {
     .init         = qemu_spice_init_stub,
+    .display_init = qemu_spice_display_init_stub,
     .migrate_info = qemu_spice_migrate_info_stub,
 };