vmstate: Pass in struct itself for VMSTATE_VARRAY_OF_POINTER_UINT32
Passing in a pointer almost never helps. Convert it to pass in struct for further refactoring on VMS_ARRAY_OF_POINTER. Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io> Reviewed-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Juraj Marcin <jmarcin@redhat.com> Link: https://lore.kernel.org/qemu-devel/20260401202844.673494-3-peterx@redhat.com Signed-off-by: Fabiano Rosas <farosas@suse.de>
Peter Xu committed
Apr 1, 2026 at 16:28 UTC
b992afc29e3218cf6934c615cd402f09760522ad
2 files changed
+5
-5
include/hw/intc/riscv_aclint.h
+3
-3
@@ -80,8 +80,8 @@ enum {
80
RISCV_ACLINT_SWI_SIZE = 0x4000
81
};
82
83
-#define VMSTATE_TIMER_PTR_VARRAY(_f, _s, _f_n) \
84
-VMSTATE_VARRAY_OF_POINTER_UINT32(_f, _s, _f_n, 0, vmstate_info_timer, \
85
- QEMUTimer *)
83
+#define VMSTATE_TIMER_PTR_VARRAY(_f, _s, _f_n) \
84
+ VMSTATE_VARRAY_OF_POINTER_UINT32(_f, _s, _f_n, 0, vmstate_info_timer, \
85
+ QEMUTimer)
86
87
#endif
include/migration/vmstate.h
+2
-2
@@ -567,9 +567,9 @@ extern const VMStateInfo vmstate_info_qlist;
567
.version_id = (_version), \
568
.num_offset = vmstate_offset_value(_state, _field_num, uint32_t), \
569
.info = &(_info), \
570
- .size = sizeof(_type), \
570
+ .size = sizeof(_type *), \
571
.flags = VMS_VARRAY_UINT32 | VMS_ARRAY_OF_POINTER | VMS_POINTER, \
572
- .offset = vmstate_offset_pointer(_state, _field, _type), \
572
+ .offset = vmstate_offset_pointer(_state, _field, _type *), \
573
}
574
575
#define VMSTATE_STRUCT_SUB_ARRAY(_field, _state, _start, _num, _version, _vmsd, _type) { \