From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFuS4-00038X-5a for qemu-devel@nongnu.org; Wed, 02 Dec 2009 14:01:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFuRz-00030o-2U for qemu-devel@nongnu.org; Wed, 02 Dec 2009 14:01:23 -0500 Received: from [199.232.76.173] (port=52339 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFuRy-00030Y-SL for qemu-devel@nongnu.org; Wed, 02 Dec 2009 14:01:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1583) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFuRy-0000Af-CJ for qemu-devel@nongnu.org; Wed, 02 Dec 2009 14:01:18 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2J1H4R026496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Dec 2009 14:01:17 -0500 Date: Wed, 2 Dec 2009 20:58:36 +0200 From: "Michael S. Tsirkin" Message-ID: <20091202185836.GF3984@redhat.com> References: <20091202145232.GF18519@redhat.com> <20091202183208.GE3956@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: [PATCH 29/41] virtio-net: in_use and first_multi only handle unsigned values List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On Wed, Dec 02, 2009 at 07:55:51PM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" 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