This series replaces: qemu_put_buffer(f, (unsigned char*)&req->elem, sizeof(req->elem));
With code that properly saves out each element of the structure using a well defined endian format. Migration is broken today from big endian to little endian hosts. There's no way to fix this problem without bumping the migration version number and that's exactly what we do here. By bumping the migration version number, we do break new->old migration but that's unavoidable right now. In order to support old->new, we assume that all incoming data is in little endian. The final patch adds a check to the load routines to fail old->new on big endian hosts where this may not have been true. I've not tested this thoroughly enough to apply yet but wanted to share. --- hw/virtio-blk.c | 22 +++++--- hw/virtio-serial-bus.c | 19 +++---- hw/virtio.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/virtio.h | 4 + qemu-file.h | 7 ++ savevm.c | 45 +++++++++++++++++ 6 files changed, 201 insertions(+), 19 deletions(-)