Skip to content

Commit afd0b40

Browse files
elmarcokraxel
authored andcommitted
spice-qemu-char: register spicevmc ports during qemu_spice_init()
Do the delayed registration of spicevmc ports after Spice server is initialized. Signed-off-by: Gerd Hoffmann <[email protected]>
1 parent 7a5448c commit afd0b40

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

spice-qemu-char.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,16 @@ CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts)
293293

294294
return chr;
295295
}
296+
297+
void qemu_spice_register_ports(void)
298+
{
299+
SpiceCharDriver *s;
300+
301+
QLIST_FOREACH(s, &spice_chars, next) {
302+
if (s->sin.portname == NULL) {
303+
continue;
304+
}
305+
vmc_register_interface(s);
306+
}
307+
}
296308
#endif

ui/qemu-spice.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void do_info_spice(Monitor *mon, QObject **ret_data);
4848
CharDriverState *qemu_chr_open_spice(QemuOpts *opts);
4949
#if SPICE_SERVER_VERSION >= 0x000c02
5050
CharDriverState *qemu_chr_open_spice_port(QemuOpts *opts);
51+
void qemu_spice_register_ports(void);
5152
#endif
5253

5354
#else /* CONFIG_SPICE */

ui/spice-core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,10 @@ void qemu_spice_init(void)
714714
g_free(x509_key_file);
715715
g_free(x509_cert_file);
716716
g_free(x509_cacert_file);
717+
718+
#if SPICE_SERVER_VERSION >= 0x000c02
719+
qemu_spice_register_ports();
720+
#endif
717721
}
718722

719723
int qemu_spice_add_interface(SpiceBaseInstance *sin)

0 commit comments

Comments
 (0)