From 23394b4c393c832aa3891533587ff97e04c70883 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 18 Oct 2019 10:14:51 +0200 Subject: qapi: Add feature flags to commands Similarly to features for struct types introduce the feature flags also for commands. This will allow notifying management layers of fixes and compatible changes in the behaviour of a command which may not be detectable any other way. The changes were heavily inspired by commit 6a8c0b51025. Signed-off-by: Peter Krempa Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20191018081454.21369-3-armbru@redhat.com> --- scripts/qapi/introspect.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/qapi/introspect.py') diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 4f257591de..b3a463dd8b 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -211,13 +211,18 @@ const QLitObject %(c_name)s = %(c_string)s; for m in variants.variants]}, ifcond) def visit_command(self, name, info, ifcond, arg_type, ret_type, gen, - success_response, boxed, allow_oob, allow_preconfig): + success_response, boxed, allow_oob, allow_preconfig, + features): arg_type = arg_type or self._schema.the_empty_object_type ret_type = ret_type or self._schema.the_empty_object_type obj = {'arg-type': self._use_type(arg_type), 'ret-type': self._use_type(ret_type)} if allow_oob: obj['allow-oob'] = allow_oob + + if features: + obj['features'] = [(f.name, {'if': f.ifcond}) for f in features] + self._gen_qlit(name, 'command', obj, ifcond) def visit_event(self, name, info, ifcond, arg_type, boxed): -- cgit 1.4.1