9ae3a8
From 3d016c34cdcc3cada9303eaa0a57ce847367e5d8 Mon Sep 17 00:00:00 2001
9ae3a8
From: Amos Kong <akong@redhat.com>
9ae3a8
Date: Fri, 8 Nov 2013 06:13:56 +0100
9ae3a8
Subject: [PATCH 1/4] qapi: qapi-visit.py, fix list handling for union types
9ae3a8
9ae3a8
RH-Author: Amos Kong <akong@redhat.com>
9ae3a8
Message-id: <1383891239-29531-2-git-send-email-akong@redhat.com>
9ae3a8
Patchwork-id: 55608
9ae3a8
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 1/4] qapi: qapi-visit.py, fix list handling for union types
9ae3a8
Bugzilla: 848203
9ae3a8
RH-Acked-by: Vlad Yasevich <vyasevic@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
From: Michael Roth <mdroth@linux.vnet.ibm.com>
9ae3a8
9ae3a8
Currently we assume non-list types when generating visitor routines for
9ae3a8
union types. This is broken, since values like ['Type'] need to mapped
9ae3a8
to 'TypeList'.
9ae3a8
9ae3a8
We already have a type_name() function to handle this that we use for
9ae3a8
generating struct visitors, so use that here as well.
9ae3a8
9ae3a8
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
9ae3a8
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
Reviewed-by: Amos Kong <akong@redhat.com>
9ae3a8
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
9ae3a8
(cherry picked from commit c664aef551714e91b7d83a28617b6e767db30d11)
9ae3a8
---
9ae3a8
 scripts/qapi-visit.py |    2 +-
9ae3a8
 1 files changed, 1 insertions(+), 1 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 scripts/qapi-visit.py |    2 +-
9ae3a8
 1 files changed, 1 insertions(+), 1 deletions(-)
9ae3a8
9ae3a8
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
9ae3a8
index 71004ae..fc2b67a 100644
9ae3a8
--- a/scripts/qapi-visit.py
9ae3a8
+++ b/scripts/qapi-visit.py
9ae3a8
@@ -309,7 +309,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s ** obj, const char *name, Error **
9ae3a8
 ''',
9ae3a8
                 abbrev = de_camel_case(name).upper(),
9ae3a8
                 enum = c_fun(de_camel_case(key),False).upper(),
9ae3a8
-                c_type=members[key],
9ae3a8
+                c_type=type_name(members[key]),
9ae3a8
                 c_name=c_fun(key))
9ae3a8
 
9ae3a8
     ret += mcgen('''
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8