On Mon, Dec 10, 2012 at 08:29:46AM -0600, Anthony Liguori wrote: > 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.
Is there a way to detect the endianness of the source host - by peaking at a known multibyte value in the incoming stream? That way we could even support cross-endian migration. Not sure if this much magic makes sense since cross-endian migration is probably used rarely. Stefan