summaryrefslogtreecommitdiffstats
path: root/python_modules/demarshal.py
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-06-22 16:03:34 +0200
committerAlexander Larsson <alexl@redhat.com>2010-06-22 16:03:34 +0200
commit381025b1c3101548f478dacfa09fa13596a6d1d8 (patch)
treef303f983221f684122c3bf745feb325081ddacff /python_modules/demarshal.py
parent759a3d5446a5ebeaf074529c28bc97ad0599ef39 (diff)
downloadspice-381025b1c3101548f478dacfa09fa13596a6d1d8.tar.gz
spice-381025b1c3101548f478dacfa09fa13596a6d1d8.tar.xz
spice-381025b1c3101548f478dacfa09fa13596a6d1d8.zip
Add support for @virtual markup in spice protocol
This means the member is not sent on the network at all. Instead its initialized to the attribute argument when demarshalled. This is useful for backwards compatibility support.
Diffstat (limited to 'python_modules/demarshal.py')
-rw-r--r--python_modules/demarshal.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index eee659f1..a0697a91 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -400,6 +400,9 @@ def write_validate_item(writer, container, item, scope, parent_scope, start,
def write_validate_member(writer, container, member, parent_scope, start,
want_nw_size, want_mem_size, want_extra_size):
+ if member.has_attr("virtual"):
+ return
+
if member.has_minor_attr():
prefix = "if (minor >= %s)" % (member.get_minor_attr())
newline = False
@@ -740,6 +743,10 @@ def write_parse_pointer(writer, t, at_end, dest, member_name, is_64bit, scope):
writer.statement("n_ptr++")
def write_member_parser(writer, container, member, dest, scope):
+ if member.has_attr("virtual"):
+ writer.assign(dest.get_ref(member.name), member.attributes["virtual"][0])
+ return
+
if member.is_switch():
write_switch_parser(writer, container, member, dest, scope)
return