Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeQ2O-0006rW-Ts for qemu-devel@nongnu.org; Fri, 21 Aug 2009 05:03:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeQ2J-0006gh-8B for qemu-devel@nongnu.org; Fri, 21 Aug 2009 05:03:55 -0400 Received: from [199.232.76.173] (port=60498 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeQ2J-0006gM-1M for qemu-devel@nongnu.org; Fri, 21 Aug 2009 05:03:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5232) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MeQ2I-0004uk-69 for qemu-devel@nongnu.org; Fri, 21 Aug 2009 05:03:50 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7L93nHI030162 for ; Fri, 21 Aug 2009 05:03:49 -0400 From: Juan Quintela In-Reply-To: <4A8E6049.6020609@redhat.com> (Gerd Hoffmann's message of "Fri, 21 Aug 2009 10:52:25 +0200") References: <20ca5615c8cdc456296698133e3b0dbd5a1f4de7.1250788880.git.quintela@redhat.com> <4A8E6049.6020609@redhat.com> Date: Fri, 21 Aug 2009 11:01:34 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: [PATCH 21/23] Port PCIDevice state to VMState List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann wrote: > On 08/20/09 19:42, Juan Quintela wrote: >> This uses a variant of buffer, with extra checks. Also uses the new >> support for cheking that a read value is less or equal than a field. > > Hmm, why you are hopping through all these loops? > > I'd just keep the existing pci_device_{save,load} functions. load > anyway for backward compatibility. save also for devices not yet > converted to vmstate. I think alot of the complex stuff you are > building up here isn't needed then, unless I missed something ... In this specific case, I think that sending: size + number of things it is safe. I agree that the INT32_EQUAL is a bad idea. But that is how the current code is done. > Beside that we'll have to think about how to handle versioning of > structs. Do we want vmstate_pci_device (and all others) have its own > version? Probably makes sense. Handling this should go into the > generic code then and not be hacked into each structure using > VMSTATE_INT32_LE(). Proper solution here is to use subsections. Each time that you call VMSTATE_PCI_DEVICE() it sends a subsection there. Then we get the versioning by free. This is how I am thinking it is the right way to do it. virtio stuff: the more than I think about it, the easier way is to just get rid of the whole mess and do something that is sensible. Later, Juan. > cheers, > Gerd