[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 39/59] qapi: Allow enums in anonymous unions
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 39/59] qapi: Allow enums in anonymous unions |
Date: |
Fri, 19 Sep 2014 15:41:58 +0100 |
From: Max Reitz <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
scripts/qapi-types.py | 2 ++
scripts/qapi-visit.py | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index b463232..d2f815b 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -177,6 +177,8 @@ const int %(name)s_qtypes[QTYPE_MAX] = {
qtype = "QTYPE_QDICT"
elif find_union(qapi_type):
qtype = "QTYPE_QDICT"
+ elif find_enum(qapi_type):
+ qtype = "QTYPE_QSTRING"
else:
assert False, "Invalid anonymous union member"
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index c129697..df9f7fb 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -263,7 +263,8 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const
char *name, Error **e
for key in members:
assert (members[key] in builtin_types
or find_struct(members[key])
- or find_union(members[key])), "Invalid anonymous union member"
+ or find_union(members[key])
+ or find_enum(members[key])), "Invalid anonymous union member"
enum_full_value = generate_enum_full_value(disc_type, key)
ret += mcgen('''
--
1.9.3
- [Qemu-devel] [PULL 29/59] qapi: Sort BlockdevDriver enum data list, (continued)
- [Qemu-devel] [PULL 29/59] qapi: Sort BlockdevDriver enum data list, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 30/59] qapi: Sort items in BlockdevOptions definition, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 26/59] qdev-monitor: fix segmentation fault on qdev_device_help(), Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 32/59] qcow2: Add qcow2_signal_corruption(), Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 33/59] qcow2: Use qcow2_signal_corruption() for overlaps, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 31/59] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 34/59] qcow2: Check L1/L2/reftable entries for alignment, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 35/59] iotests: Add more tests for qcow2 corruption, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 36/59] image-fuzzer: Trivial readability and formatting improvements, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 38/59] qcow2: Fix leak of QemuOpts in qcow2_open(), Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 39/59] qapi: Allow enums in anonymous unions,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 37/59] hmp: fix memory leak at hmp_info_block_jobs(), Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 44/59] layout: Add generators for refcount table and blocks, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 43/59] fuzz: Add fuzzing functions for entries of refcount table and blocks, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 46/59] ahci: MSI capability should be at 0x80, not 0x50., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 45/59] ahci: Adding basic functionality qtest., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 47/59] ahci: Add test_pci_spec to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 48/59] ahci: add test_pci_enable to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 49/59] ahci: properly shadow the TFD register, Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 50/59] ahci: Add test_hba_spec to ahci-test., Stefan Hajnoczi, 2014/09/19
- [Qemu-devel] [PULL 51/59] ahci: Add test_hba_enable to ahci-test., Stefan Hajnoczi, 2014/09/19