From 9bafe07bc8b00ce9ba5ea6f4c590239c579d83ee Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 28 Oct 2021 12:25:14 +0200 Subject: qapi: Eliminate QCO_NO_OPTIONS for a slight simplification Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela Reviewed-by: John Snow Message-Id: <20211028102520.747396-4-armbru@redhat.com> --- monitor/misc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'monitor') diff --git a/monitor/misc.c b/monitor/misc.c index ffe7966..3556b17 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -230,8 +230,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); + qmp_register_command(&qmp_commands, "device_add", qmp_device_add, 0); QTAILQ_INIT(&qmp_cap_negotiation_commands); qmp_register_command(&qmp_cap_negotiation_commands, "qmp_capabilities", -- cgit v1.1 From 6604e4757a1fc5832f87b5f9244efccabb49be8e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 28 Oct 2021 12:25:17 +0200 Subject: qapi: Generalize command policy checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Philippe Mathieu-Daudé Acked-by: John Snow Message-Id: <20211028102520.747396-7-armbru@redhat.com> Reviewed-by: Juan Quintela Reviewed-by: Eric Blake --- monitor/misc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'monitor') diff --git a/monitor/misc.c b/monitor/misc.c index 3556b17..c2d227a 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -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. */ -- cgit v1.1