[Qemu-devel] [PATCH v6 14/27] qapi-event: add 'if' condition to implicit event enum

Marc-André Lureau posted 27 patches 7 years, 4 months ago
There is a newer version of this series
[Qemu-devel] [PATCH v6 14/27] qapi-event: add 'if' condition to implicit event enum
Posted by Marc-André Lureau 7 years, 4 months ago
Add condition to QAPIEvent enum members based on the event 'if'.

Generated code is not changed by this patch, but with "qapi: add #if
conditions to generated code" patch.

There is no coverage of this change in qapi-schema-test.out since the
event_names enum is an implicit type created by qapi-event.py.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 scripts/qapi/events.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
index ea4dac6a05..c9beef8b4b 100644
--- a/scripts/qapi/events.py
+++ b/scripts/qapi/events.py
@@ -189,7 +189,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor):
             self._genh.add(gen_event_send_decl(name, arg_type, boxed))
             self._genc.add(gen_event_send(name, arg_type, boxed,
                                           self._enum_name))
-        self._event_names.append(QAPISchemaMember(name))
+        self._event_names.append(QAPISchemaMember(name, ifcond))
 
 
 def gen_events(schema, output_dir, prefix):
-- 
2.18.0.rc1


Re: [Qemu-devel] [PATCH v6 14/27] qapi-event: add 'if' condition to implicit event enum
Posted by Markus Armbruster 6 years, 11 months ago
Marc-André Lureau <marcandre.lureau@redhat.com> writes:

> Add condition to QAPIEvent enum members based on the event 'if'.
>
> Generated code is not changed by this patch, but with "qapi: add #if
> conditions to generated code" patch.
>
> There is no coverage of this change in qapi-schema-test.out since the
> event_names enum is an implicit type created by qapi-event.py.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  scripts/qapi/events.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
> index ea4dac6a05..c9beef8b4b 100644
> --- a/scripts/qapi/events.py
> +++ b/scripts/qapi/events.py
> @@ -189,7 +189,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor):
>              self._genh.add(gen_event_send_decl(name, arg_type, boxed))
>              self._genc.add(gen_event_send(name, arg_type, boxed,
>                                            self._enum_name))
> -        self._event_names.append(QAPISchemaMember(name))
> +        self._event_names.append(QAPISchemaMember(name, ifcond))
>  
>  
>  def gen_events(schema, output_dir, prefix):

Reviewed-by: Markus Armbruster <armbru@redhat.com>

Re: [Qemu-devel] [PATCH v6 14/27] qapi-event: add 'if' condition to implicit event enum
Posted by Markus Armbruster 6 years, 11 months ago
One more thing...

Markus Armbruster <armbru@redhat.com> writes:

> Marc-André Lureau <marcandre.lureau@redhat.com> writes:
>
>> Add condition to QAPIEvent enum members based on the event 'if'.
>>
>> Generated code is not changed by this patch, but with "qapi: add #if
>> conditions to generated code" patch.

My suggestion on PATCH 13's commit message applies.

>> There is no coverage of this change in qapi-schema-test.out since the
>> event_names enum is an implicit type created by qapi-event.py.
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  scripts/qapi/events.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
>> index ea4dac6a05..c9beef8b4b 100644
>> --- a/scripts/qapi/events.py
>> +++ b/scripts/qapi/events.py
>> @@ -189,7 +189,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor):
>>              self._genh.add(gen_event_send_decl(name, arg_type, boxed))
>>              self._genc.add(gen_event_send(name, arg_type, boxed,
>>                                            self._enum_name))
>> -        self._event_names.append(QAPISchemaMember(name))
>> +        self._event_names.append(QAPISchemaMember(name, ifcond))
>>  
>>  
>>  def gen_events(schema, output_dir, prefix):
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>