[Spice-devel] [PATCH v3 49/51] Allow ws_as attribute on switch members

Frediano Ziglio fziglio at redhat.com
Tue Jul 21 09:46: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 3e1fd6d..2a25a51 100644
--- a/python_modules/dissector.py
+++ b/python_modules/dissector.py
@@ -430,6 +430,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.1.0



More information about the Spice-devel mailing list