[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 03/14] vl: support machine-initialized target in phase_until()
From: |
Damien Hedde |
Subject: |
[PATCH v4 03/14] vl: support machine-initialized target in phase_until() |
Date: |
Wed, 23 Feb 2022 10:06:55 +0100 |
phase_until() now supports the following transitions:
+ accel-created -> machine-initialized
+ machine-initialized -> machine-ready
As a consequence we can now support the use of qmp_exit_preconfig()
from phases _accel-created_ and _machine-initialized_.
This commit is a preparation to support cold plugging a device
using qapi (which will be introduced in a following commit). For this
we need fine grain control of the phase.
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
softmmu/vl.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 5689d0be88..50337d68b9 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2737,8 +2737,8 @@ static void qemu_machine_creation_done(void)
void qmp_x_exit_preconfig(Error **errp)
{
- if (phase_check(PHASE_MACHINE_INITIALIZED)) {
- error_setg(errp, "The command is permitted only before machine
initialization");
+ if (phase_check(PHASE_MACHINE_READY)) {
+ error_setg(errp, "The command is permitted only before machine is
ready");
return;
}
phase_until(PHASE_MACHINE_READY, errp);
@@ -2759,7 +2759,17 @@ bool phase_until(MachineInitPhase phase, Error **errp)
case PHASE_ACCEL_CREATED:
qemu_init_board();
/* We are now in PHASE_MACHINE_INITIALIZED. */
+ /*
+ * Handle CLI devices now in order leave the function in a state
+ * where we can cold plug devices with QMP. The following call
+ * handles the CLI options:
+ * + -fw_cfg (has side effects on device cold plug)
+ * + -device
+ */
qemu_create_cli_devices();
+ break;
+
+ case PHASE_MACHINE_INITIALIZED:
/*
* At this point all CLI options are handled apart:
* + -S (autostart)
--
2.35.1
- [PATCH v4 00/14] Initial support for machine creation via QMP, Damien Hedde, 2022/02/23
- [PATCH v4 05/14] qapi/device_add: handle the rom_order_override when cold-plugging, Damien Hedde, 2022/02/23
- [PATCH v4 10/14] none-machine: allow several cpus, Damien Hedde, 2022/02/23
- [PATCH v4 08/14] none-machine: add 'ram-addr' property, Damien Hedde, 2022/02/23
- [PATCH v4 02/14] machine&vl: introduce phase_until() to handle phase transitions, Damien Hedde, 2022/02/23
- [PATCH v4 06/14] qapi/device_add: Allow execution in machine initialized phase, Damien Hedde, 2022/02/23
- [PATCH v4 07/14] none-machine: add the NoneMachineState structure, Damien Hedde, 2022/02/23
- [PATCH v4 01/14] machine: add phase_get() and document phase_check()/advance(), Damien Hedde, 2022/02/23
- [PATCH v4 03/14] vl: support machine-initialized target in phase_until(),
Damien Hedde <=
- [PATCH v4 12/14] add sysbus-mmio-map qapi command, Damien Hedde, 2022/02/23
- [PATCH v4 04/14] qapi/device_add: compute is_hotplug flag, Damien Hedde, 2022/02/23
- [PATCH v4 09/14] none-machine: allow cold plugging sysbus devices, Damien Hedde, 2022/02/23
- [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/23
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Igor Mammedov, 2022/02/23
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/23
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Igor Mammedov, 2022/02/24
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/24
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Igor Mammedov, 2022/02/25
- Re: [PATCH v4 13/14] hw/mem/system-memory: add a memory sysbus device, Damien Hedde, 2022/02/25