summary refs log tree commit diff stats
path: root/migration/vmstate.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2016-01-11 12:40:22 +0000
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2016-01-16 12:01:23 +0000
commitb47d3af7559b6fe17a2a86a1f0bf69f386873753 (patch)
tree6adc1f3a61e3457ff0c229ba9f1e7df32646c9e2 /migration/vmstate.c
parent551747491d6677e4cc6cac8750462887a09bc722 (diff)
downloadfocaccia-qemu-b47d3af7559b6fe17a2a86a1f0bf69f386873753.tar.gz
focaccia-qemu-b47d3af7559b6fe17a2a86a1f0bf69f386873753.zip
vmstate: Introduce VMSTATE_VARRAY_MULTPLY
This allows to send a partial array where the size is another
structure field multiplied by a constant.

Signed-off-by: Juan Quintela <quintela@redhat.com>
[PMM: updated to current master]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'migration/vmstate.c')
-rw-r--r--migration/vmstate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/migration/vmstate.c b/migration/vmstate.c
index f70fe59a3c..a7ad7f2216 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -28,6 +28,10 @@ static int vmstate_n_elems(void *opaque, VMStateField *field)
         n_elems = *(uint8_t *)(opaque+field->num_offset);
     }
 
+    if (field->flags & VMS_MULTIPLY_ELEMENTS) {
+        n_elems *= field->num;
+    }
+
     return n_elems;
 }