aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-10-21 05:25:58 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-10 12:15:11 -0500
commite0d17dfd22348eab63c5e19b7ee9c9212c2b8af8 (patch)
tree342bf50f0e243a707b80d6f96dc6f8d8dbcd0bd7
parent0546c0609cb5a8d90c1cbac8e0d64b5a048bbb19 (diff)
downloadqemu-e0d17dfd22348eab63c5e19b7ee9c9212c2b8af8.zip
qemu-e0d17dfd22348eab63c5e19b7ee9c9212c2b8af8.tar.gz
qemu-e0d17dfd22348eab63c5e19b7ee9c9212c2b8af8.tar.bz2
vl: move various initialization routines out of qemu_init
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>
-rw-r--r--hw/core/machine.c3
-rw-r--r--include/hw/qdev-core.h8
-rw-r--r--migration/migration.c4
-rw-r--r--softmmu/qdev-monitor.c6
-rw-r--r--softmmu/vl.c5
5 files changed, 7 insertions, 19 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index bd97fc2..83f45a9 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -877,6 +877,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 6ac86db..9fbb22a 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -788,14 +788,6 @@ 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:
*
* Reset a single device (by calling the reset method).
diff --git a/migration/migration.c b/migration/migration.c
index 87a9b59..d9e94f4 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 301089e..c2816c5 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -928,12 +928,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 9caff9f..8640ddd 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;