On 07/31/2012 06:56 PM, Peter Maydell wrote:
On 27 July 2012 20:29, Igor Mitsyanko <i.mitsya...@samsung.com> wrote:
+        VMSTATE_BUFFER_MULTIPLY(wp_groups, SDState, 1, NULL, 0, wpgrps_size,
+                sizeof(unsigned long)),

Isn't this trying to use wpgrps_size as the number of unsigned longs in
the bitmap, when it's actually the size of the bitmap in bits?

(Does this correctly work in migration between 32 and 64 bit systems
where 'unsigned long' is a different size? How about between a little
endian 32 bit system and a big endian 64 bit system? I don't know
enough about the vmstate macros to be confident here...)

-- PMM



You're right, bitmap_new() can allocated buffers of different size for the same number of bits but different sizeof(long) value. Maybe always align allocated buffer size to 8 byte? Endianess seems like even bigger issue.. Looks like we need to think of something else here.

Reply via email to