Markus Armbruster 05f43a9608 qapi-event: Convert to QAPISchemaVisitor, fixing data with base
Fixes events whose data is struct with base to include the struct's
base members.  Test case is qapi-schema-test.json's event
__org.qemu_x-command:

    { 'event': '__ORG.QEMU_X-EVENT', 'data': '__org.qemu_x-Struct' }

    { 'struct': '__org.qemu_x-Struct', 'base': '__org.qemu_x-Base',
      'data': { '__org.qemu_x-member2': 'str' } }

    { 'struct': '__org.qemu_x-Base',
      'data': { '__org.qemu_x-member1': '__org.qemu_x-Enum' } }

Patch's effect on generated qapi_event_send___org_qemu_x_event():

    -void qapi_event_send___org_qemu_x_event(const char *__org_qemu_x_member2,
    +void qapi_event_send___org_qemu_x_event(__org_qemu_x_Enum __org_qemu_x_member1,
    +                                        const char *__org_qemu_x_member2,
                                             Error **errp)
     {
         QDict *qmp;
    @@ -224,6 +225,10 @@ void qapi_event_send___org_qemu_x_event(
             goto clean;
         }

    +    visit_type___org_qemu_x_Enum(v, &__org_qemu_x_member1, "__org.qemu_x-member1", &local_err);
    +    if (local_err) {
    +        goto clean;
    +    }
         visit_type_str(v, (char **)&__org_qemu_x_member2, "__org.qemu_x-member2", &local_err);
         if (local_err) {
             goto clean;

Code is generated in a different order now, but that doesn't matter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
2015-09-21 09:56:48 +02:00
..
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:01 +02:00
2015-05-05 18:39:00 +02:00
2015-05-05 18:39:00 +02:00