[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 9/9] qapi: Allow some commands to be executed in machine 'ini
From: |
Mirela Grujic |
Subject: |
[RFC PATCH 9/9] qapi: Allow some commands to be executed in machine 'initialized' phase |
Date: |
Thu, 13 May 2021 10:25:49 +0200 |
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(-)
diff --git a/qapi/machine.json b/qapi/machine.json
index 31872aae72..c77ea03acb 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -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 }
diff --git a/qapi/qdev.json b/qapi/qdev.json
index b83178220b..2706ef3efa 100644
--- a/qapi/qdev.json
+++ b/qapi/qdev.json
@@ -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:
diff --git a/monitor/misc.c b/monitor/misc.c
index 55f3744053..88a0edff0a 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -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",
--
2.25.1
- [RFC PATCH 3/9] rename MachineInitPhase enumeration constants, (continued)
- [RFC PATCH 3/9] rename MachineInitPhase enumeration constants, Mirela Grujic, 2021/05/13
- [RFC PATCH 4/9] qapi: Implement 'query-machine-phase' command, Mirela Grujic, 2021/05/13
- [RFC PATCH 5/9] qapi: Implement 'next-machine-phase' command, Mirela Grujic, 2021/05/13
- [RFC PATCH 6/9] qapi: Implement 'advance-machine-phase' command, Mirela Grujic, 2021/05/13
- [RFC PATCH 7/9] qdev-monitor: Restructure and fix the check for command availability, Mirela Grujic, 2021/05/13
- [RFC PATCH 9/9] qapi: Allow some commands to be executed in machine 'initialized' phase,
Mirela Grujic <=
- [RFC PATCH 8/9] qapi: Introduce 'allow-init-config' option, Mirela Grujic, 2021/05/13
- Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Paolo Bonzini, 2021/05/13
- Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Mirela Grujic, 2021/05/14
- Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Paolo Bonzini, 2021/05/14
- Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Daniel P . Berrangé, 2021/05/14
- Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Paolo Bonzini, 2021/05/14
- Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Igor Mammedov, 2021/05/24
- Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Igor Mammedov, 2021/05/24
Re: [RFC PATCH 0/9] Initial support for machine creation via QMP, Markus Armbruster, 2021/05/21