summaryrefslogtreecommitdiffstats
path: root/python_modules
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-06-29 18:13:07 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-06-30 22:35:16 +0200
commita93351f3674feddfc9a9716e94acd4c4b131a5f2 (patch)
tree8cbbd29de977414010b9fa96d6d31403b47613d8 /python_modules
parentf87f63fdf58a16e62c6fcb3c4c7e11f801292ea9 (diff)
downloadspice-a93351f3674feddfc9a9716e94acd4c4b131a5f2.tar.gz
spice-a93351f3674feddfc9a9716e94acd4c4b131a5f2.tar.xz
spice-a93351f3674feddfc9a9716e94acd4c4b131a5f2.zip
demarshaller: Don't parse @zero members
These just write zeros at the right place in the network protocol typically for old back-compat things. We don't want to read these back in.
Diffstat (limited to 'python_modules')
-rw-r--r--python_modules/demarshal.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index 0138ebe7..d8b8ea90 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -638,7 +638,8 @@ def write_switch_parser(writer, container, switch, dest, scope):
elif t.is_pointer():
write_parse_pointer(writer, t, False, dest2, m.name, block)
elif t.is_primitive():
- writer.assign(dest2.get_ref(m.name), "consume_%s(&in)" % (t.primitive_type()))
+ if not m.has_attr("zero"):
+ writer.assign(dest2.get_ref(m.name), "consume_%s(&in)" % (t.primitive_type()))
#TODO validate e.g. flags and enums
elif t.is_array():
nelements = read_array_len(writer, m.name, t, dest, block)
@@ -757,6 +758,8 @@ def write_member_parser(writer, container, member, dest, scope):
else:
write_parse_pointer(writer, t, member.has_end_attr(), dest, member.name, scope)
elif t.is_primitive():
+ if member.has_attr("zero"):
+ pass
if member.has_end_attr():
writer.statement("*(%s *)end = consume_%s(&in)" % (t.c_type(), t.primitive_type()))
writer.increment("end", t.sizeof())