loadvm not working
Hi,
I discovered a bug that prevents loadvm from working correctly in current repository version (related to warning "qemu: warning:
instance 0 of device '' not present in current VM").
The implementation of functions qemu_get_be16 and qemu_get_be32 (in file vl.c) relies on implicit conversion of signed byte (int8_t) values returned by qemu_get_byte to multi-byte integer types. When value to be converted is negative, the result is incorrect.
There are two fixes possible:
1) change return type of qemu_get_byte to unsigned (uint8_t)
2) add explicit casts in qemu_get_be16 and qemu_get_be32
For consistency with qemu_get_be16 and qemu_get_be32, first solution looks better. However I didn't examine all other calls to qemu_get_byte for possible problems.
Hope this helps,
Piotr
Quoted 13 lines · Piotras
Hi,
I discovered a bug that prevents loadvm from working correctly in current repository version (related to warning "qemu: warning:
instance 0 of device '' not present in current VM"). The implementation of functionsqemu_get_be16andqemu_get_be32(in filevl.c) relies on implicit conversion of signed byte (int8_t) values returned byqemu_get_byteto multi-byte integer types. When value to be converted is negative, the result is incorrect.There are two fixes possible:
Quoted 8 lines
1) change return type of
qemu_get_byteto unsigned (uint8_t)2) add explicit casts in
qemu_get_be16andqemu_get_be32For consistency with
qemu_get_be16andqemu_get_be32, first solution looks better. However I didn't examine all other calls toqemu_get_bytefor possible problems.
Heh, I literally just debugged this myself :-) That patch that introduced this is being reverted so it'll be fixed in a few hours.
Regards,
Anthony Liguori
Quoted 6 lines
Hope this helps,
Piotr