[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisit
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions |
Date: |
Fri, 18 Sep 2015 08:54:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 09/16/2015 05:06 AM, Markus Armbruster wrote:
>> Fixes flat unions to get the base's base members. Test case is from
>> commit 2fc0043, in qapi-schema-test.json:
>>
>> { 'union': 'UserDefFlatUnion',
>> 'base': 'UserDefUnionBase',
>> 'discriminator': 'enum1',
>> 'data': { 'value1' : 'UserDefA',
>> 'value2' : 'UserDefB',
>> 'value3' : 'UserDefB' } }
>>
>> { 'struct': 'UserDefUnionBase',
>> 'base': 'UserDefZero',
>> 'data': { 'string': 'str', 'enum1': 'EnumOne' } }
>>
>> { 'struct': 'UserDefZero',
>> 'data': { 'integer': 'int' } }
>>
>> Patch's effect on UserDefFlatUnion:
>>
>> struct UserDefFlatUnion {
>> /* Members inherited from UserDefUnionBase: */
>> + int64_t integer;
>> char *string;
>
> There is another change not listed here. When you were developing with
> scaffolding patches, you split the 'typedef struct UserDefFlatUnion {'
> into two lines in that patch, and then the diff seen by this patch when
> generating the commit message didn't see anything change. But now that
> you reverted the scaffolding out of the series, it is now THIS patch
> that is converting from inline:
>
> typedef struct UserDefFlatUnion {
> ...
> } UserDefFlatUnion;
>
> to the separate:
>
> typedef struct UserDefFlatUnion;
> ...
> struct UserDefFlatUnion {
> ...
> };
>
>
>> -def generate_fwd_struct(name):
>> +def gen_fwd_object_or_array(name):
>> return mcgen('''
>>
>> typedef struct %(name)s %(name)s;
>> -
>> -typedef struct %(name)sList {
>> - union {
>> - %(name)s *value;
>> - uint64_t padding;
>> - };
>> - struct %(name)sList *next;
>> -} %(name)sList;
>> ''',
>> name=c_name(name))
>>
>> -def generate_fwd_enum_struct(name):
>> +def gen_array(name, element_type):
>> return mcgen('''
>>
>> -typedef struct %(name)sList {
>> +struct %(name)s {
>
> My R-b still stands, but it would be nice to update this commit message
> to reflect that this change was intentional.
Can do. Thanks!
- Re: [Qemu-devel] [PATCH v8 02/26] qapi: New QAPISchema intermediate reperesentation, (continued)
[Qemu-devel] [PATCH v8 08/26] qapi-commands: Convert to QAPISchemaVisitor, Markus Armbruster, 2015/09/16
[Qemu-devel] [PATCH v8 01/26] qapi: Rename class QAPISchema to QAPISchemaParser, Markus Armbruster, 2015/09/16
[Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Markus Armbruster, 2015/09/16
- Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Daniel P. Berrange, 2015/09/16
- Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Eric Blake, 2015/09/16
- Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Eric Blake, 2015/09/17
- Re: [Qemu-devel] [PATCH v8 06/26] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions,
Markus Armbruster <=
[Qemu-devel] [PATCH v8 14/26] qapi-visit: Rearrange code a bit, Markus Armbruster, 2015/09/16
[Qemu-devel] [PATCH v8 07/26] qapi-visit: Convert to QAPISchemaVisitor, fixing bugs, Markus Armbruster, 2015/09/16
[Qemu-devel] [PATCH v8 03/26] qapi: QAPISchema code generation helper methods, Markus Armbruster, 2015/09/16
[Qemu-devel] [PATCH v8 20/26] qapi: Make output visitor return qnull() instead of NULL, Markus Armbruster, 2015/09/16
[Qemu-devel] [PATCH v8 17/26] qapi: De-duplicate parameter list generation, Markus Armbruster, 2015/09/16
[Qemu-devel] [PATCH v8 18/26] qapi-commands: De-duplicate output marshaling functions, Markus Armbruster, 2015/09/16