[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 08/11] vl: Implement qemu_until_phase() running to arbitrary
From: |
Markus Armbruster |
Subject: |
[PATCH RFC 08/11] vl: Implement qemu_until_phase() running to arbitrary phase |
Date: |
Thu, 2 Dec 2021 08:04:47 +0100 |
A later patch will want to use qemu_until_phase() to advance from one
arbitrary phase to another. The previous commit implement advancing
from arbitrary phase to PHASE_MACHINE_READY. This one implements
advancing to a phase given as argument.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
softmmu/vl.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index b7f15d9f86..148c39e22c 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -963,7 +963,8 @@ static void qemu_machine_creation_done(void)
assert(machine->cgs->ready);
}
}
-static void qemu_until_phase(void);
+
+static void qemu_until_phase(MachineInitPhase phase);
void qemu_init(int argc, char **argv, char **envp)
{
@@ -1035,16 +1036,21 @@ void qemu_init(int argc, char **argv, char **envp)
}
}
- qemu_until_phase();
+ qemu_until_phase(PHASE_MACHINE_READY);
}
-void qemu_until_phase(void)
+void qemu_until_phase(MachineInitPhase phase)
{
MachineClass *machine_class;
FILE *vmstate_dump_file = NULL;
+ assert(phase >= phase_get());
+
switch (phase_get()) {
case PHASE_NO_MACHINE:
+ if (phase == PHASE_NO_MACHINE) {
+ break;
+ }
qemu_process_early_options();
@@ -1080,6 +1086,9 @@ void qemu_until_phase(void)
/* fall through */
case PHASE_MACHINE_CREATED:
+ if (phase == PHASE_MACHINE_CREATED) {
+ break;
+ }
/*
* Note: uses machine properties such as kernel-irqchip, must run
@@ -1090,6 +1099,9 @@ void qemu_until_phase(void)
/* fall through */
case PHASE_ACCEL_CREATED:
+ if (phase == PHASE_ACCEL_CREATED) {
+ break;
+ }
/*
* Beware, QOM objects created before this point miss global and
@@ -1139,6 +1151,9 @@ void qemu_until_phase(void)
/* fall through */
case PHASE_MACHINE_INITIALIZED:
+ if (phase == PHASE_MACHINE_INITIALIZED) {
+ break;
+ }
qemu_machine_creation_done();
assert(phase_get() == PHASE_MACHINE_READY);
--
2.31.1
- [PATCH RFC 00/11] vl: Explore redesign of startup, Markus Armbruster, 2021/12/02
- [PATCH RFC 02/11] vl: Drop x-exit-preconfig, Markus Armbruster, 2021/12/02
- [PATCH RFC 10/11] vl: Disregard lack of 'allow-preconfig': true, Markus Armbruster, 2021/12/02
- [PATCH RFC 06/11] vl: Factor qemu_until_phase() out of qemu_init(), Markus Armbruster, 2021/12/02
- [PATCH RFC 07/11] vl: Implement qemu_until_phase() running from arbitrary phase, Markus Armbruster, 2021/12/02
- [PATCH RFC 03/11] vl: Hardcode a QMP monitor on stdio for now, Markus Armbruster, 2021/12/02
- [PATCH RFC 08/11] vl: Implement qemu_until_phase() running to arbitrary phase,
Markus Armbruster <=
- [PATCH RFC 11/11] vl: Enter main loop in phase @machine-initialized, Markus Armbruster, 2021/12/02
- [PATCH RFC 05/11] vl: Demonstrate (bad) CLI wrapped around QMP, Markus Armbruster, 2021/12/02
- [PATCH RFC 04/11] vl: Hardcode a VGA device for now, Markus Armbruster, 2021/12/02
- [PATCH RFC 09/11] vl: New QMP command until-phase, Markus Armbruster, 2021/12/02
- [PATCH RFC 01/11] vl: Cut off the CLI with an axe, Markus Armbruster, 2021/12/02
- Re: [PATCH RFC 00/11] vl: Explore redesign of startup, Markus Armbruster, 2021/12/02
- Re: [PATCH RFC 00/11] vl: Explore redesign of startup, Damien Hedde, 2021/12/07