@@ -275,6 +275,7 @@ CharDriverState *qemu_chr_open_spice(QemuOpts *opts)
return chr;
}
+
static int port_can_read(void *opaque)
{
CharDriverState *chr = opaque;
@@ -388,3 +389,15 @@ 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);
+ }
+}
@@ -47,6 +47,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data);
CharDriverState *qemu_chr_open_spice(QemuOpts *opts);
CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts);
+void qemu_spice_register_ports(void);
#else /* CONFIG_SPICE */
#include "monitor.h"
@@ -714,6 +714,8 @@ void qemu_spice_init(void)
g_free(x509_key_file);
g_free(x509_cert_file);
g_free(x509_cacert_file);
+
+ qemu_spice_register_ports();
}
int qemu_spice_add_interface(SpiceBaseInstance *sin)
Do the delayed registration of spicevmc ports after Spice server is initialized. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> --- spice-qemu-char.c | 13 +++++++++++++ ui/qemu-spice.h | 1 + ui/spice-core.c | 2 ++ 3 files changed, 16 insertions(+)