[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 15/32] Adjust qapi-visit for python-2.4.3
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 15/32] Adjust qapi-visit for python-2.4.3 |
Date: |
Wed, 4 Dec 2013 08:34:22 -0600 |
From: Richard Henderson <address@hidden>
We say we support python 2.4, but python 2.4.3 does not
support the "expr if test else expr" syntax used here.
This allows QEMU to compile on RHEL 5.3, the last release for ia64.
Signed-off-by: Richard Henderson <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
(cherry picked from commit 7b75d9d61bf9b7b43f6df2fb2fbfc38c4eb9d2e9)
Signed-off-by: Michael Roth <address@hidden>
---
scripts/qapi-visit.py | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 597cca4..02e16bb 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -20,7 +20,10 @@ import errno
def generate_visit_struct_fields(name, field_prefix, fn_prefix, members):
substructs = []
ret = ''
- full_name = name if not fn_prefix else "%s_%s" % (name, fn_prefix)
+ if not fn_prefix:
+ full_name = name
+ else:
+ full_name = "%s_%s" % (name, fn_prefix)
for argname, argentry, optional, structured in parse_args(members):
if structured:
@@ -84,7 +87,10 @@ if (!error_is_set(errp)) {
''')
push_indent()
- full_name = name if not field_prefix else "%s_%s" % (field_prefix, name)
+ if not field_prefix:
+ full_name = name
+ else:
+ full_name = "%s_%s" % (field_prefix, name)
if len(field_prefix):
ret += mcgen('''
@@ -265,12 +271,17 @@ void visit_type_%(name)s(Visitor *m, %(name)s ** obj,
const char *name, Error **
name=name)
pop_indent()
+
+ if not discriminator:
+ desc_type = "type"
+ else:
+ desc_type = discriminator
ret += mcgen('''
visit_type_%(name)sKind(m, &(*obj)->kind, "%(type)s", &err);
if (!err) {
switch ((*obj)->kind) {
''',
- name=name, type="type" if not discriminator else
discriminator)
+ name=name, type=desc_type)
for key in members:
if not discriminator:
--
1.7.9.5
- [Qemu-stable] [PATCH 20/32] linux-user: Fix stat64 syscall for SPARC64, (continued)
- [Qemu-stable] [PATCH 20/32] linux-user: Fix stat64 syscall for SPARC64, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 19/32] configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 11/32] vmdk: Fix vmdk_parse_extents, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 13/32] monitor: eliminate monitor_event_state_lock, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 22/32] exec: fix breakpoint_invalidate when pc may not be translated, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 12/32] audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up every *nano* second, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 18/32] tests: fix memleak in error path test for input visitor, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 17/32] qapi: fix memleak by adding implict struct functions in dealloc visitor, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 23/32] Fix pc migration from qemu <= 1.5, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 16/32] configure: detect endian via compile test, Michael Roth, 2013/12/04
- [Qemu-stable] [PATCH 15/32] Adjust qapi-visit for python-2.4.3,
Michael Roth <=
- Re: [Qemu-stable] Patch Round-up for stable 1.6.2, freeze on 2013-12-06, Paolo Bonzini, 2013/12/05