[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 03/26] qapi-types.py: Split off generate_struct_fi
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL v2 03/26] qapi-types.py: Split off generate_struct_fields() |
Date: |
Mon, 2 Sep 2013 10:49:29 +0200 |
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
scripts/qapi-types.py | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 5ee46ea..86de980 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -57,12 +57,8 @@ typedef struct %(name)sList
''',
name=name)
-def generate_struct(structname, fieldname, members):
- ret = mcgen('''
-struct %(name)s
-{
-''',
- name=structname)
+def generate_struct_fields(members):
+ ret = ''
for argname, argentry, optional, structured in parse_args(members):
if optional:
@@ -80,6 +76,17 @@ struct %(name)s
''',
c_type=c_type(argentry), c_name=c_var(argname))
+ return ret
+
+def generate_struct(structname, fieldname, members):
+ ret = mcgen('''
+struct %(name)s
+{
+''',
+ name=structname)
+
+ ret += generate_struct_fields(members)
+
if len(fieldname):
fieldname = " " + fieldname
ret += mcgen('''
--
1.8.1.4
- [Qemu-devel] [PULL v2 00/26] Block patches, Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 01/26] qcow2: Change default for new images to compat=1.1, Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 03/26] qapi-types.py: Split off generate_struct_fields(),
Kevin Wolf <=
- [Qemu-devel] [PULL v2 02/26] block: Remove redundant assertion, Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 06/26] block/qcow2.h: Avoid "1LL << 63" (shifts into sign bit), Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 04/26] Revert "block: Disable driver-specific options for 1.6", Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 05/26] qemu-iotests: Update reference output for 051, Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 07/26] add skeleton for BSD licensed "raw" BlockDriver, Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 09/26] raw_bsd: add raw_create(), Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 08/26] raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev(), Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 10/26] raw_bsd: introduce "special members", Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 11/26] raw_bsd: add raw_create_options, Kevin Wolf, 2013/09/02
- [Qemu-devel] [PULL v2 13/26] switch raw block driver from "raw.o" to "raw_bsd.o", Kevin Wolf, 2013/09/02