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