qemu-e2k/scripts
Markus Armbruster 1e6c1616a9 qapi: Generate a nicer struct for flat unions
The struct generated for a flat union is weird: the members of its
base are at the end, except for the union tag, which is at the
beginning.

Example: qapi-schema-test.json has

    { 'struct': 'UserDefUnionBase',
      'data': { 'string': 'str', 'enum1': 'EnumOne' } }

    { 'union': 'UserDefFlatUnion',
      'base': 'UserDefUnionBase',
      'discriminator': 'enum1',
      'data': { 'value1' : 'UserDefA',
                'value2' : 'UserDefB',
                'value3' : 'UserDefB' } }

We generate:

    struct UserDefFlatUnion
    {
        EnumOne enum1;
        union {
            void *data;
            UserDefA *value1;
            UserDefB *value2;
            UserDefB *value3;
        };
        char *string;
    };

Change to put all base members at the beginning, unadulterated.  Not
only is this easier to understand, it also permits casting the flat
union to its base, if that should become useful.

We now generate:

    struct UserDefFlatUnion
    {
        /* Members inherited from UserDefUnionBase: */
        char *string;
        EnumOne enum1;
        /* Own members: */
        union { /* union tag is @enum1 */
            void *data;
            UserDefA *value1;
            UserDefB *value2;
            UserDefB *value3;
        };
    };

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-09-04 15:47:13 +02:00
..
kvm kvm_stat: add kvm_stat.1 man page 2015-03-10 10:49:25 +01:00
qemu-guest-agent qemu-ga: sample fsfreeze hooks 2013-01-08 16:38:12 -06:00
qmp scripts: Add support for path as argument of qom-tree 2015-06-19 10:29:14 +02:00
tracetool trace: add DTrace reserved words for .d files 2015-03-02 15:39:43 -06:00
acpi_extract.py i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive. 2014-11-02 11:52:24 +02:00
acpi_extract_preprocess.py i386: add ACPI table files from seabios 2013-10-14 17:48:51 +03:00
analyse-9p-simpletrace.py scripts/analyse-9p-simpletrace.py: Add symbolic names for 9p operations. 2011-12-21 12:37:23 +05:30
analyze-migration.py Teach analyze-migration.py about section footers 2015-06-12 06:54:01 +02:00
check-qerror.sh qerror: add check-qerror.sh to verify alphabetical order 2012-01-18 10:23:39 -02:00
checkpatch.pl checkpatch: complain about ffs(3) calls 2015-04-28 15:36:08 +02:00
cleanup-trace-events.pl cleanup-trace-events.pl: Tighten search for trace event call 2014-09-26 09:34:38 +01:00
coverity-model.c coverity: fix address_space_rw model 2015-05-05 10:42:11 +02:00
create_config module: implement module loading 2014-02-20 13:14:18 +01:00
disas-objdump.pl disas-objdump: Pass --adjust-vma to objdump 2013-08-24 07:26:45 +02:00
dump-guest-memory.py exec: convert ram_list to QLIST 2015-02-16 17:30:20 +01:00
extract-vsssdk-headers Add a script to extract VSS SDK headers on POSIX system 2013-09-09 14:17:56 -05:00
feature_to_c.sh exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00
get_maintainer.pl get_maintainer.pl: Remove the --git-chief-penguins option 2014-12-10 11:46:43 +03:00
gtester-cat test makefile overhaul 2012-03-30 08:14:11 -05:00
hxtool vl.c: In qemu -h output, only print options for the arch we are running as 2011-12-19 10:27:33 -06:00
make-release make-release: Record SeaBIOS version 2014-03-31 15:02:04 +01:00
make_device_config.sh build: pass .d file name to scripts/make_device_config.sh, fix makefile target 2015-03-18 12:07:25 +01:00
ordereddict.py qapi: add ordereddict.py helper library 2011-07-21 16:48:14 -03:00
qapi-commands.py qapi: Drop unused and useless parameters and variables 2015-09-04 15:47:13 +02:00
qapi-event.py qapi: Drop unused and useless parameters and variables 2015-09-04 15:47:13 +02:00
qapi-types.py qapi: Generate a nicer struct for flat unions 2015-09-04 15:47:13 +02:00
qapi-visit.py qapi: Fix generated code when flat union has member 'kind' 2015-09-04 15:47:13 +02:00
qapi.py qapi: Drop unused and useless parameters and variables 2015-09-04 15:47:13 +02:00
qemu-binfmt-conf.sh scripts/qemu-binfmt-conf.sh: Add AArch64 registration 2014-03-17 16:31:53 +00:00
qemu-gdb.py scripts: add 'qemu coroutine' command to qemu-gdb.py 2015-04-28 15:36:09 +02:00
qtest.py qtest: Add scripts/qtest.py 2015-02-16 15:07:18 +00:00
refresh-pxe-roms.sh roms: rewrite scripts/refresh-pxe-roms.sh 2013-09-30 09:44:35 +02:00
shaderinclude.pl opengl: add shader build infrastructure 2015-05-05 09:03:32 +02:00
signrom.py signrom: Rewrite as python script 2012-04-16 15:41:20 +02:00
simpletrace.py simpletrace: add simpletrace.py --no-header option 2014-08-12 14:26:11 +01:00
switch-timer-api misc: Fix case Qemu -> QEMU 2014-02-15 16:10:25 +04:00
texi2pod.pl Support utf8 chars in pod docs 2012-03-24 14:10:25 +00:00
tracetool.py trace: Multi-backend tracing 2014-06-09 15:43:40 +02:00
update-acpi.sh acpi: add rules to compile ASL source 2013-10-14 17:48:51 +03:00
update-linux-headers.sh virtio-input: move sys/ioctl.h include 2015-07-16 17:34:41 +02:00
vmstate-static-checker.py vmstate-static-checker: update whitelist 2015-02-05 17:16:14 +01:00