@@ -1327,7 +1327,7 @@
#
##
{ 'command': 'query-machine-phase', 'returns': 'MachineInitPhaseStatus',
- 'allow-preconfig': true }
+ 'allow-preconfig': true, 'allow-init-config': true }
##
# @next-machine-phase:
@@ -1351,7 +1351,8 @@
# <- { "return": {} }
#
##
-{ 'command': 'next-machine-phase', 'allow-preconfig': true }
+{ 'command': 'next-machine-phase', 'allow-preconfig': true,
+ 'allow-init-config': true }
##
# @advance-machine-phase:
@@ -1377,4 +1378,4 @@
#
##
{ 'command': 'advance-machine-phase', 'data' : {'phase': 'MachineInitPhase'},
- 'allow-preconfig': true }
+ 'allow-preconfig': true, 'allow-init-config': true }
@@ -67,7 +67,8 @@
##
{ 'command': 'device_add',
'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
- 'gen': false } # so we can get the additional arguments
+ 'gen': false, # so we can get the additional arguments
+ 'allow-init-config': true }
##
# @device_del:
@@ -232,7 +232,7 @@ static void monitor_init_qmp_commands(void)
qmp_init_marshal(&qmp_commands);
qmp_register_command(&qmp_commands, "device_add", qmp_device_add,
- QCO_NO_OPTIONS);
+ QCO_ALLOW_INIT_CONFIG);
QTAILQ_INIT(&qmp_cap_negotiation_commands);
qmp_register_command(&qmp_cap_negotiation_commands, "qmp_capabilities",
The following commands are allowed to execute during the machine 'initialized' phase (enabled with 'allow-init-config' option): 1) query-machine-phase 2) next-machine-phase 3) advance-machine-phase 3) device_add Note: for device_add command in qdev.json adding the 'allow-init-config' option has no effect because the command appears to bypass QAPI (see TODO at qapi/qdev.json:61). The option is added there solely to document the intent. For the same reason, the flags have to be explicitly set in monitor_init_qmp_commands() when the device_add command is registered. Signed-off-by: Mirela Grujic <mirela.grujic@greensocs.com> --- qapi/machine.json | 7 ++++--- qapi/qdev.json | 3 ++- monitor/misc.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-)