qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] loadvm not working
@ 2008-09-25 20:07 Piotras
  2008-09-25 20:20 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Piotras @ 2008-09-25 20:07 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] loadvm not working
  2008-09-25 20:07 [Qemu-devel] loadvm not working Piotras
@ 2008-09-25 20:20 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2008-09-25 20:20 UTC (permalink / raw)
  To: qemu-devel

Piotras wrote:
> 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.
>   

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

> Hope this helps,
>
> Piotr
>
>
>   

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-25 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25 20:07 [Qemu-devel] loadvm not working Piotras
2008-09-25 20:20 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).