]> git.proxmox.com Git - qemu.git/commitdiff
spice-qemu-char: register spicevmc ports during qemu_spice_init()
authorMarc-André Lureau <marcandre.lureau@gmail.com>
Wed, 5 Dec 2012 15:15:36 +0000 (16:15 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 17 Dec 2012 13:01:41 +0000 (14:01 +0100)
Do the delayed registration of spicevmc ports after Spice server is
initialized.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
spice-qemu-char.c
ui/qemu-spice.h
ui/spice-core.c

index 4eb85ae7984ed02c0371ebe1f89cc203b657891d..b2586c263d97bcde231564607e22b5d882501892 100644 (file)
@@ -293,4 +293,16 @@ CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts)
 
     return chr;
 }
+
+void qemu_spice_register_ports(void)
+{
+    SpiceCharDriver *s;
+
+    QLIST_FOREACH(s, &spice_chars, next) {
+        if (s->sin.portname == NULL) {
+            continue;
+        }
+        vmc_register_interface(s);
+    }
+}
 #endif
index 5669767de03f887da05a94898249607089e331a4..642f0126906e9a11dd1975ac5839b2a6bce6d610 100644 (file)
@@ -48,6 +48,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data);
 CharDriverState *qemu_chr_open_spice(QemuOpts *opts);
 #if SPICE_SERVER_VERSION >= 0x000c02
 CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts);
+void qemu_spice_register_ports(void);
 #endif
 
 #else  /* CONFIG_SPICE */
index 59ce5f6370dbf4afb7b88e4d49896b502517d17e..ac46deb2be9b9d4029d62bb29be3a3c82ef42af3 100644 (file)
@@ -714,6 +714,10 @@ void qemu_spice_init(void)
     g_free(x509_key_file);
     g_free(x509_cert_file);
     g_free(x509_cacert_file);
+
+#if SPICE_SERVER_VERSION >= 0x000c02
+    qemu_spice_register_ports();
+#endif
 }
 
 int qemu_spice_add_interface(SpiceBaseInstance *sin)