diff options
author | Anthony Liguori | 2013-09-03 19:32:45 +0200 |
---|---|---|
committer | Anthony Liguori | 2013-09-03 19:32:46 +0200 |
commit | bb7d4d82b63bbde06c5584f94bfd9ba3b3e5ff3f (patch) | |
tree | 2c724450460233fefc322c664a9ed89fb862b8cb /scripts/qapi-types.py | |
parent | Merge remote-tracking branch 'mjt/trivial-patches' into staging (diff) | |
parent | qemu-iotests: Overlapping cluster allocations (diff) | |
download | qemu-bb7d4d82b63bbde06c5584f94bfd9ba3b3e5ff3f.tar.gz qemu-bb7d4d82b63bbde06c5584f94bfd9ba3b3e5ff3f.tar.xz qemu-bb7d4d82b63bbde06c5584f94bfd9ba3b3e5ff3f.zip |
Merge remote-tracking branch 'kwolf/for-anthony' into staging
# By Max Reitz (11) and others
# Via Kevin Wolf
* kwolf/for-anthony: (26 commits)
qemu-iotests: Overlapping cluster allocations
qcow2_check: Mark image consistent
qcow2-refcount: Repair shared refcount blocks
qcow2-refcount: Repair OFLAG_COPIED errors
qcow2-refcount: Move OFLAG_COPIED checks
qcow2: Employ metadata overlap checks
qcow2: Metadata overlap checks
qcow2: Add corrupt bit
qemu-iotests: Snapshotting zero clusters
qcow2-refcount: Snapshot update for zero clusters
option: Add assigned flag to QEMUOptionParameter
gluster: Abort on AIO completion failure
block: Remove old raw driver
switch raw block driver from "raw.o" to "raw_bsd.o"
raw_bsd: register bdrv_raw
raw_bsd: add raw_create_options
raw_bsd: introduce "special members"
raw_bsd: add raw_create()
raw_bsd: emit debug events in bdrv_co_readv() and bdrv_co_writev()
add skeleton for BSD licensed "raw" BlockDriver
...
Message-id: 1378111792-20436-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
Diffstat (limited to 'scripts/qapi-types.py')
-rw-r--r-- | scripts/qapi-types.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 5ee46ea1b3..86de9800ea 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(''' |