From 93ab5844b2cd5367966d7b5bae154e0d3303b504 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 14 Oct 2020 14:11:17 +0200 Subject: chardev/spice: simplify chardev setup Initialize spice before chardevs. That allows to register the spice chardevs directly in the init function and removes the need to maintain a linked list of chardevs just for registration. Signed-off-by: Gerd Hoffmann Message-id: 20201014121120.13482-5-kraxel@redhat.com --- softmmu/vl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'softmmu/vl.c') diff --git a/softmmu/vl.c b/softmmu/vl.c index 254ee5e525..cb476aa70b 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -4148,6 +4148,11 @@ void qemu_init(int argc, char **argv, char **envp) user_creatable_add_opts_foreach, object_create_initial, &error_fatal); + /* 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_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, &error_fatal); @@ -4156,10 +4161,6 @@ void qemu_init(int argc, char **argv, char **envp) fsdev_init_func, NULL, &error_fatal); #endif - /* spice needs the timers to be initialized by this point */ - /* spice must initialize before audio as it changes the default auiodev */ - qemu_spice_init(); - /* * Note: we need to create audio and block backends before * machine_set_property(), so machine properties can refer to -- cgit v1.2.3