From 164dafd1744c69d268b89015977e19d8a9617fdf Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 27 Oct 2020 04:44:18 -0400 Subject: remove preconfig state The preconfig state is only used if -incoming is not specified, which makes the RunState state machine more tricky than it need be. However there is already an equivalent condition which works even with -incoming, namely qdev_hotplug. Use it instead of a separate runstate. Reviewed-by: Igor Mammedov Signed-off-by: Paolo Bonzini --- qapi/qmp-dispatch.c | 5 +---- qapi/run-state.json | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'qapi') diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 9a2d7dd29a..0a2b20a4e4 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -167,10 +167,7 @@ QDict *qmp_dispatch(const QmpCommandList *cmds, QObject *request, goto out; } - if (runstate_check(RUN_STATE_PRECONFIG) && - !(cmd->options & QCO_ALLOW_PRECONFIG)) { - error_setg(&err, "The command '%s' isn't permitted in '%s' state", - cmd->name, RunState_str(RUN_STATE_PRECONFIG)); + if (!qmp_command_available(cmd, &err)) { goto out; } diff --git a/qapi/run-state.json b/qapi/run-state.json index b2f77cbf3f..a47c500f83 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -50,15 +50,12 @@ # @colo: guest is paused to save/restore VM state under colo checkpoint, # VM can not get into this state unless colo capability is enabled # for migration. (since 2.8) -# @preconfig: QEMU is paused before board specific init callback is executed. -# The state is reachable only if the --preconfig CLI option is used. -# (Since 3.0) ## { 'enum': 'RunState', 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused', 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm', 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog', - 'guest-panicked', 'colo', 'preconfig' ] } + 'guest-panicked', 'colo' ] } ## # @ShutdownCause: -- cgit v1.2.3