qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 29/41] virtio-net: in_use and first_multi only h


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 29/41] virtio-net: in_use and first_multi only handle unsigned values
Date: Wed, 2 Dec 2009 20:58:36 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

On Wed, Dec 02, 2009 at 07:55:51PM +0100, Juan Quintela wrote:
> "Michael S. Tsirkin" <address@hidden> wrote:
> > On Wed, Dec 02, 2009 at 07:30:18PM +0100, Juan Quintela wrote:
> 
> >> We can change things to be int32_t if that makes more sense (they were sent
> >> as uint32).
> >> 
> >> vmstate checks that the type of the value that you sent and the function
> >> that you use for sending match.  In this case, it was sending a int32_t
> >> with the function to send uint32_t.  In this particular case it didn't
> >> matter (value is 0/1).  But vmstate don't know what cases matter/don't
> >> matter.  It just test _always_ that you are using the right function for
> >> your type.
> >> 
> >> If you think that it is better to change the type of the value to
> >> int32_t and change the functions, that is also ok with me.
> >> What I care is that type of function and field are the same.
> >> 
> >> Later, Juan.
> >
> > int is a better type than int32 here.
> 
> will switch to int (I really hope that int32_t == int in all 
> architectures that we are interested in)
> 
> > Please make the save/load functions match.
> > If you like, convert it to bool.
> 
> bool is only 1 byte, not four.  I wasn't the one using 4 bytes for a bool.
> 
> Later, Juan.

So just range check it.
The fact we leave some space in format does
not mean we must waste memory at runtime.

-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]