aboutsummaryrefslogtreecommitdiff
path: root/softmmu/qdev-monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'softmmu/qdev-monitor.c')
-rw-r--r--softmmu/qdev-monitor.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 8c072e3efc..3f1e67267d 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -25,6 +25,7 @@
#include "sysemu/arch_init.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-qdev.h"
+#include "qapi/qmp/dispatch.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qemu/config-file.h"
@@ -983,3 +984,14 @@ int qemu_global_option(const char *str)
return 0;
}
+
+bool qmp_command_available(const QmpCommand *cmd, Error **errp)
+{
+ if (!qdev_hotplug &&
+ !(cmd->options & QCO_ALLOW_PRECONFIG)) {
+ error_setg(errp, "The command '%s' is permitted only after machine initialization has completed",
+ cmd->name);
+ return false;
+ }
+ return true;
+}