summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-12-02 12:36:43 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 10:04:54 -0600
commit33599e2a6164b1c7a5b634be1c2e54b8f0fb91bd (patch)
treeba615fe8d01a46ac2522c045f9cc7eb77954090b /savevm.c
parentbfb811ade56e62da44404f55e224f4f5d07a902c (diff)
vmstate: Add support for multiplying size for a constant
When the size that we want to transmit is in another field, but in an unit different that bytes Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/savevm.c b/savevm.c
index 1125ef2d5..17a6c9705 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1147,6 +1147,9 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
if (field->flags & VMS_VBUFFER) {
size = *(int32_t *)(opaque+field->size_offset);
+ if (field->flags & VMS_MULTIPLY) {
+ size *= field->size;
+ }
}
if (field->flags & VMS_ARRAY) {
n_elems = field->num;
@@ -1200,6 +1203,9 @@ void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
if (field->flags & VMS_VBUFFER) {
size = *(int32_t *)(opaque+field->size_offset);
+ if (field->flags & VMS_MULTIPLY) {
+ size *= field->size;
+ }
}
if (field->flags & VMS_ARRAY) {
n_elems = field->num;