[Spice-devel] [PATCH v6 40/42] dissector: Allows ws_as attribute on switch members

Frediano Ziglio fziglio at redhat.com
Thu Aug 13 06:12:19 PDT 2015


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 python_modules/dissector.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/python_modules/dissector.py b/python_modules/dissector.py
index 5f94e46..76c1de0 100644
--- a/python_modules/dissector.py
+++ b/python_modules/dissector.py
@@ -431,6 +431,10 @@ def write_switch(writer, container, switch, dest, scope):
         m = c.member
         with writer.if_block(check, not first, False) as block:
             t = m.member_type
+            if m.has_attr('ws_as'):
+                type_name = m.attributes['ws_as'][0]
+                assert(ptypes.type_exists(type_name))
+                t = ptypes.lookup_type(type_name)
             if switch.has_attr("anon"):
                 dest2 = dest
             else:
-- 
2.4.3



More information about the Spice-devel mailing list