[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 067/113] vl: separate qemu_create_late_backends
From: |
Paolo Bonzini |
Subject: |
[PULL 067/113] vl: separate qemu_create_late_backends |
Date: |
Wed, 2 Dec 2020 03:08:03 -0500 |
"Late" backends are created after the machine.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
softmmu/vl.c | 64 ++++++++++++++++++++++++++--------------------------
1 file changed, 32 insertions(+), 32 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index aafcbec356..d9fe9f63c0 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2759,11 +2759,41 @@ static void qemu_create_early_backends(void)
* The remainder of object creation happens after the
* creation of chardev, fsdev, net clients and device data types.
*/
-static bool object_create_delayed(const char *type, QemuOpts *opts)
+static bool object_create_late(const char *type, QemuOpts *opts)
{
return !object_create_early(type, opts);
}
+static void qemu_create_late_backends(void)
+{
+ if (qtest_chrdev) {
+ qtest_server_init(qtest_chrdev, qtest_log, &error_fatal);
+ }
+
+ net_init_clients(&error_fatal);
+
+ qemu_opts_foreach(qemu_find_opts("object"),
+ user_creatable_add_opts_foreach,
+ object_create_late, &error_fatal);
+
+ if (tpm_init() < 0) {
+ exit(1);
+ }
+
+ qemu_opts_foreach(qemu_find_opts("mon"),
+ mon_init_func, NULL, &error_fatal);
+
+ if (foreach_device_config(DEV_SERIAL, serial_parse) < 0)
+ exit(1);
+ if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0)
+ exit(1);
+ if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
+ exit(1);
+
+ /* now chardevs have been created we may have semihosting to connect */
+ qemu_semihosting_connect_chardevs();
+ qemu_semihosting_console_init();
+}
static bool set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size,
MachineClass *mc)
@@ -3377,7 +3407,6 @@ void qemu_init(int argc, char **argv, char **envp)
ram_addr_t maxram_size;
uint64_t ram_slots = 0;
FILE *vmstate_dump_file = NULL;
- Error *err = NULL;
bool have_custom_ram_size;
qemu_add_opts(&qemu_drive_opts);
@@ -4392,10 +4421,6 @@ void qemu_init(int argc, char **argv, char **envp)
*/
migration_object_init();
- if (qtest_chrdev) {
- qtest_server_init(qtest_chrdev, qtest_log, &error_fatal);
- }
-
opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
if (opts) {
boot_order = qemu_opt_get(opts, "order");
@@ -4423,32 +4448,7 @@ void qemu_init(int argc, char **argv, char **envp)
semihosting_arg_fallback(kernel_filename, kernel_cmdline);
}
- if (net_init_clients(&err) < 0) {
- error_report_err(err);
- exit(1);
- }
-
- qemu_opts_foreach(qemu_find_opts("object"),
- user_creatable_add_opts_foreach,
- object_create_delayed, &error_fatal);
-
- if (tpm_init() < 0) {
- exit(1);
- }
-
- qemu_opts_foreach(qemu_find_opts("mon"),
- mon_init_func, NULL, &error_fatal);
-
- if (foreach_device_config(DEV_SERIAL, serial_parse) < 0)
- exit(1);
- if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0)
- exit(1);
- if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
- exit(1);
-
- /* now chardevs have been created we may have semihosting to connect */
- qemu_semihosting_connect_chardevs();
- qemu_semihosting_console_init();
+ qemu_create_late_backends();
current_machine->boot_order = boot_order;
--
2.26.2
- [PULL 084/113] kernel-doc: add support for ____cacheline_aligned_in_smp attribute, (continued)
- [PULL 084/113] kernel-doc: add support for ____cacheline_aligned_in_smp attribute, Paolo Bonzini, 2020/12/02
- [PULL 086/113] scripts: kernel-doc: proper handle @foo->bar(), Paolo Bonzini, 2020/12/02
- [PULL 088/113] scripts: kernel-doc: accept blank lines on parameter description, Paolo Bonzini, 2020/12/02
- [PULL 090/113] scripts/kernel-doc: parse __ETHTOOL_DECLARE_LINK_MODE_MASK, Paolo Bonzini, 2020/12/02
- [PULL 087/113] scripts: kernel-doc: accept negation like !@var, Paolo Bonzini, 2020/12/02
- [PULL 069/113] vl: separate qemu_apply_machine_options, Paolo Bonzini, 2020/12/02
- [PULL 051/113] treewide: do not use short-form boolean options, Paolo Bonzini, 2020/12/02
- [PULL 056/113] vl: extract qemu_init_subsystems, Paolo Bonzini, 2020/12/02
- [PULL 060/113] vl: extract various command line desugaring snippets to a new function, Paolo Bonzini, 2020/12/02
- [PULL 061/113] qemu-option: restrict qemu_opts_set to merge-lists QemuOpts, Paolo Bonzini, 2020/12/02
- [PULL 067/113] vl: separate qemu_create_late_backends,
Paolo Bonzini <=
- [PULL 072/113] vl: move -global check earlier, Paolo Bonzini, 2020/12/02
- [PULL 073/113] migration, vl: start migration via qmp_migrate_incoming, Paolo Bonzini, 2020/12/02
- [PULL 068/113] vl: separate qemu_create_machine, Paolo Bonzini, 2020/12/02
- [PULL 079/113] vl: remove serial_max_hds, Paolo Bonzini, 2020/12/02
- [PULL 075/113] hmp: introduce cmd_available, Paolo Bonzini, 2020/12/02
- [PULL 077/113] vl: extract machine done notifiers, Paolo Bonzini, 2020/12/02
- [PULL 094/113] kernel-doc: add support for ____cacheline_aligned attribute, Paolo Bonzini, 2020/12/02
- [PULL 096/113] Revert "scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments", Paolo Bonzini, 2020/12/02
- [PULL 083/113] kernel-doc: fix processing nested structs with attributes, Paolo Bonzini, 2020/12/02
- [PULL 082/113] docs: temporarily disable the kernel-doc extension, Paolo Bonzini, 2020/12/02