summaryrefslogtreecommitdiffstats
path: root/qapi/qmp-dispatch.c
diff options
context:
space:
mode:
authorPaolo Bonzini2020-10-27 09:44:18 +0100
committerPaolo Bonzini2020-12-15 18:51:48 +0100
commit164dafd1744c69d268b89015977e19d8a9617fdf (patch)
tree7c3f6a9c5dfb766bdd25cfa87f37201095cd674f /qapi/qmp-dispatch.c
parentMerge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request... (diff)
downloadqemu-164dafd1744c69d268b89015977e19d8a9617fdf.tar.gz
qemu-164dafd1744c69d268b89015977e19d8a9617fdf.tar.xz
qemu-164dafd1744c69d268b89015977e19d8a9617fdf.zip
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 <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qapi/qmp-dispatch.c')
-rw-r--r--qapi/qmp-dispatch.c5
1 files changed, 1 insertions, 4 deletions
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;
}