[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 10/11] vl: Disregard lack of 'allow-preconfig': true
From: |
Markus Armbruster |
Subject: |
[PATCH RFC 10/11] vl: Disregard lack of 'allow-preconfig': true |
Date: |
Thu, 2 Dec 2021 08:04:49 +0100 |
I'd like to use device cold plug as an example for how how the user
can now interleave CLI with startup. Doesn't work, because only
commands with 'allow-preconfig': true are available before phase
@machine-ready, and device_add isn't. Instead of changing just
device_add, this hack allows all commands all the time, for easy
experimentation. Some commands don't work, but this is RFC.
Hot pci-serial works:
$ qemu-system-x86_64 '{"execute": "until-phase", "arguments": {"phase":
"machine-ready"}}' '{"execute": "device_add", "arguments": {"driver":
"pci-serial"}}'
Hot isa-serial fails as it should:
$ qemu-system-x86_64 '{"execute": "until-phase", "arguments": {"phase":
"machine-ready"}}' '{"execute": "device_add", "arguments": {"driver":
"isa-serial"}}'
[...]
qemu-system-x86_64: {"execute": "device_add", "arguments": {"driver":
"isa-serial"}}: Bus 'isa.0' does not support hotplugging
Cold isa-serial works:
$ qemu-system-x86_64 '{"execute": "until-phase", "arguments": {"phase":
"machine-initialized"}}' '{"execute": "device_add", "arguments": {"driver":
"isa-serial"}}'
A command that works even in phase @no-machine:
$ qemu-system-x86_64 '{"execute": "chardev-add", "arguments": {"id":
"chr0", "backend": {"type": "null", "data": {}}}}'
{"QMP": {"version": {"qemu": {"micro": 92, "minor": 1, "major": 6},
"package": "v6.2.0-rc2-38-gff2c6103bf"}, "capabilities": ["oob"]}}
{"execute": "qmp_capabilities", "arguments": {"enable": ["oob"]}}
{"return": {}}
{"execute": "query-chardev"}
{"return": [{"frontend-open": false, "filename": "null", "label": "chr0"},
{"frontend-open": true, "filename": "stdio", "label": "compat_monitor0"}]}
A command that doesn't work there:
$ qemu-system-x86_64 '{"execute": "screendump", "arguments": {"filename":
"scr"}}'
qemu-system-x86_64: ../qapi/qmp-dispatch.c:226: qmp_dispatch: Assertion
`!oob && qemu_in_coroutine() && !(cmd->options & QCO_COROUTINE)' failed.
Aborted (core dumped)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
softmmu/qdev-monitor.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 067f6cdeab..ddb12c68e6 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -1041,11 +1041,13 @@ int qemu_global_option(const char *str)
bool qmp_command_available(const QmpCommand *cmd, Error **errp)
{
+#if 0
if (!phase_check(PHASE_MACHINE_READY) &&
!(cmd->options & QCO_ALLOW_PRECONFIG)) {
error_setg(errp, "The command '%s' is permitted only after machine
initialization has completed",
cmd->name);
return false;
}
+#endif
return true;
}
--
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 <=
- [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, 2021/12/02
- [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