Skip to content

Commit dea1fb8

Browse files
committed
softmmu: initialize spice and audio earlier
audiodev must be initialized before machine_set_property so the machine can have audiodev property aliases. spice must initialize before audiodev because the default audiodev is spice only in case spice is actually enabled. Signed-off-by: Gerd Hoffmann <[email protected]> Message-id: [email protected]
1 parent 8859f07 commit dea1fb8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

softmmu/vl.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4131,12 +4131,17 @@ void qemu_init(int argc, char **argv, char **envp)
41314131
fsdev_init_func, NULL, &error_fatal);
41324132
#endif
41334133

4134+
/* spice needs the timers to be initialized by this point */
4135+
/* spice must initialize before audio as it changes the default auiodev */
4136+
qemu_spice_init();
4137+
41344138
/*
4135-
* Note: we need to create block backends before
4139+
* Note: we need to create audio and block backends before
41364140
* machine_set_property(), so machine properties can refer to
41374141
* them.
41384142
*/
41394143
configure_blockdev(&bdo_queue, machine_class, snapshot);
4144+
audio_init_audiodevs();
41404145

41414146
machine_opts = qemu_get_machine_opts();
41424147
qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
@@ -4230,9 +4235,6 @@ void qemu_init(int argc, char **argv, char **envp)
42304235
semihosting_arg_fallback(kernel_filename, kernel_cmdline);
42314236
}
42324237

4233-
/* spice needs the timers to be initialized by this point */
4234-
qemu_spice_init();
4235-
42364238
cpu_ticks_init();
42374239

42384240
if (default_net) {
@@ -4342,8 +4344,6 @@ void qemu_init(int argc, char **argv, char **envp)
43424344
create_default_memdev(current_machine, mem_path);
43434345
}
43444346

4345-
audio_init_audiodevs();
4346-
43474347
/* from here on runstate is RUN_STATE_PRELAUNCH */
43484348
machine_run_board_init(current_machine);
43494349

0 commit comments

Comments
 (0)