mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
qapi: Generalize command policy checking
The code to check command policy can see special feature flag 'deprecated' as command flag QCO_DEPRECATED. I want to make feature flag 'unstable' visible there as well, so I can add policy for it. To let me make it visible, add member @special_features (a bitset of QapiSpecialFeature) to QmpCommand, and adjust the generator to pass it through qmp_register_command(). Then replace "QCO_DEPRECATED in @flags" by QAPI_DEPRECATED in @special_features", and drop QCO_DEPRECATED. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: John Snow <jsnow@redhat.com> Message-Id: <20211028102520.747396-7-armbru@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
a130728554
commit
6604e4757a
6 changed files with 17 additions and 12 deletions
|
@ -230,11 +230,13 @@ static void monitor_init_qmp_commands(void)
|
|||
|
||||
qmp_init_marshal(&qmp_commands);
|
||||
|
||||
qmp_register_command(&qmp_commands, "device_add", qmp_device_add, 0);
|
||||
qmp_register_command(&qmp_commands, "device_add",
|
||||
qmp_device_add, 0, 0);
|
||||
|
||||
QTAILQ_INIT(&qmp_cap_negotiation_commands);
|
||||
qmp_register_command(&qmp_cap_negotiation_commands, "qmp_capabilities",
|
||||
qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG);
|
||||
qmp_marshal_qmp_capabilities,
|
||||
QCO_ALLOW_PRECONFIG, 0);
|
||||
}
|
||||
|
||||
/* Set the current CPU defined by the user. Callers must hold BQL. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue