From b47d3af7559b6fe17a2a86a1f0bf69f386873753 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Mon, 11 Jan 2016 12:40:22 +0000 Subject: 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 [PMM: updated to current master] Signed-off-by: Peter Maydell Signed-off-by: Mark Cave-Ayland --- migration/vmstate.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'migration') 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; } -- cgit v1.2.3