[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 055/113] vl: move various initialization routines out of qemu_init
From: |
Paolo Bonzini |
Subject: |
[PULL 055/113] vl: move various initialization routines out of qemu_init |
Date: |
Wed, 2 Dec 2020 03:07:51 -0500 |
Some very simple initialization routines can be nested in existing
subsystem-level functions, do that to simplify qemu_init.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/core/machine.c | 3 +++
include/hw/qdev-core.h | 8 --------
migration/migration.c | 4 ++++
softmmu/qdev-monitor.c | 6 ------
softmmu/vl.c | 5 -----
5 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index cd298fac13..5260155962 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -874,6 +874,9 @@ static void machine_initfn(Object *obj)
MachineState *ms = MACHINE(obj);
MachineClass *mc = MACHINE_GET_CLASS(obj);
+ container_get(obj, "/peripheral");
+ container_get(obj, "/peripheral-anon");
+
ms->dump_guest_core = true;
ms->mem_merge = true;
ms->enable_graphics = true;
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 5e737195b5..b77a2f1da7 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -785,14 +785,6 @@ BusState *sysbus_get_default(void);
char *qdev_get_fw_dev_path(DeviceState *dev);
char *qdev_get_own_fw_dev_path_from_handler(BusState *bus, DeviceState *dev);
-/**
- * @qdev_machine_init
- *
- * Initialize platform devices before machine init. This is a hack until full
- * support for composition is added.
- */
-void qdev_machine_init(void);
-
/**
* device_legacy_reset:
*
diff --git a/migration/migration.c b/migration/migration.c
index 87a9b59f83..d9e94f4080 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -182,6 +182,10 @@ void migration_object_init(void)
error_report_err(err);
exit(1);
}
+
+ blk_mig_init();
+ ram_mig_init();
+ dirty_bitmap_mig_init();
}
void migration_shutdown(void)
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index bf79d0bbcd..d060e765da 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -943,12 +943,6 @@ BlockBackend *blk_by_qdev_id(const char *id, Error **errp)
return blk;
}
-void qdev_machine_init(void)
-{
- qdev_get_peripheral_anon();
- qdev_get_peripheral();
-}
-
QemuOptsList qemu_device_opts = {
.name = "device",
.implied_opt_name = "driver",
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 9caff9fe8e..8640ddd3ec 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4280,10 +4280,6 @@ void qemu_init(int argc, char **argv, char **envp)
exit(1);
}
- blk_mig_init();
- ram_mig_init();
- dirty_bitmap_mig_init();
-
qemu_opts_foreach(qemu_find_opts("mon"),
mon_init_func, NULL, &error_fatal);
@@ -4316,7 +4312,6 @@ void qemu_init(int argc, char **argv, char **envp)
reading from the other reads, because timer polling functions query
clock values from the log. */
replay_checkpoint(CHECKPOINT_INIT);
- qdev_machine_init();
current_machine->boot_order = boot_order;
--
2.26.2
- [PULL 049/113] make ram_size local to vl.c, (continued)
- [PULL 049/113] make ram_size local to vl.c, Paolo Bonzini, 2020/12/02
- [PULL 053/113] vl: remove bogus check, Paolo Bonzini, 2020/12/02
- [PULL 044/113] nios2: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 048/113] sparc64: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 052/113] vl: extract validation of -smp to machine.c, Paolo Bonzini, 2020/12/02
- [PULL 063/113] vl: load plugins as late as possible, Paolo Bonzini, 2020/12/02
- [PULL 054/113] vl: split various early command line options to a separate function, Paolo Bonzini, 2020/12/02
- [PULL 058/113] vl: extract various command line validation snippets to a new function, Paolo Bonzini, 2020/12/02
- [PULL 039/113] i386: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 047/113] s390x: do not use ram_size global, Paolo Bonzini, 2020/12/02
- [PULL 055/113] vl: move various initialization routines out of qemu_init,
Paolo Bonzini <=
- [PULL 062/113] vl: create "-net nic -net user" default earlier, Paolo Bonzini, 2020/12/02
- [PULL 057/113] vl: move prelaunch part of qemu_init to new functions, Paolo Bonzini, 2020/12/02
- [PULL 059/113] vl: preconfig and loadvm are mutually exclusive, Paolo Bonzini, 2020/12/02
- [PULL 050/113] hw/char/serial: Clean up unnecessary code, Paolo Bonzini, 2020/12/02
- [PULL 064/113] vl: extract default devices to separate functions, Paolo Bonzini, 2020/12/02
- [PULL 071/113] vl: initialize displays before preconfig loop, Paolo Bonzini, 2020/12/02
- [PULL 070/113] vl: separate qemu_resolve_machine_memdev, Paolo Bonzini, 2020/12/02
- [PULL 066/113] vl: separate qemu_create_early_backends, Paolo Bonzini, 2020/12/02
- [PULL 076/113] vl: extract softmmu/datadir.c, Paolo Bonzini, 2020/12/02
- [PULL 080/113] vl: clean up -boot variables, Paolo Bonzini, 2020/12/02