diff options
author | Paolo Bonzini | 2014-10-24 10:18:38 +0200 |
---|---|---|
committer | Paolo Bonzini | 2015-01-26 12:22:44 +0100 |
commit | a03c3e90e11976fb147904d537457984bb938ce2 (patch) | |
tree | 80f2f407154f4efa84277bd50ed1dbac7d2934a9 /include/migration/vmstate.h | |
parent | tests/multiboot: Add test for modules (diff) | |
download | qemu-a03c3e90e11976fb147904d537457984bb938ce2.tar.gz qemu-a03c3e90e11976fb147904d537457984bb938ce2.tar.xz qemu-a03c3e90e11976fb147904d537457984bb938ce2.zip |
target-i386: use vmstate_offset_sub_array for AVX registers
After the next patch, each vmstate field will extract parts of a larger
(32x512-bit) array, so we cannot check the vmstate field against the
type of the array.
While changing this, change the macros to accept the index of the first
element (which will not be 0 for Hi16_ZMM_REGS) instead of the number
of elements (which is always CPU_NB_REGS).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/migration/vmstate.h')
-rw-r--r-- | include/migration/vmstate.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index d712a651ca..6097b9482f 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -359,6 +359,16 @@ extern const VMStateInfo vmstate_info_bitmap; .offset = vmstate_offset_array(_s, _f, _type*, _n), \ } +#define VMSTATE_STRUCT_SUB_ARRAY(_field, _state, _start, _num, _version, _vmsd, _type) { \ + .name = (stringify(_field)), \ + .version_id = (_version), \ + .num = (_num), \ + .vmsd = &(_vmsd), \ + .size = sizeof(_type), \ + .flags = VMS_STRUCT|VMS_ARRAY, \ + .offset = vmstate_offset_sub_array(_state, _field, _type, _start), \ +} + #define VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, _test, _version, _vmsd, _type) { \ .name = (stringify(_field)), \ .num = (_num), \ |