mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
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>
This commit is contained in:
committed by
Mark Cave-Ayland
parent
551747491d
commit
b47d3af755
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user