From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mntmp-00038g-JL for qemu-devel@nongnu.org; Wed, 16 Sep 2009 08:39:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mntmk-00032n-2i for qemu-devel@nongnu.org; Wed, 16 Sep 2009 08:39:02 -0400 Received: from [199.232.76.173] (port=50016 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mntmj-00032X-Q9 for qemu-devel@nongnu.org; Wed, 16 Sep 2009 08:38:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3778) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mntmj-0001Rn-9b for qemu-devel@nongnu.org; Wed, 16 Sep 2009 08:38:57 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8GCcuDY026037 for ; Wed, 16 Sep 2009 08:38:56 -0400 Date: Wed, 16 Sep 2009 15:37:10 +0300 From: "Michael S. Tsirkin" Message-ID: <20090916123710.GB4729@redhat.com> References: <20090916104620.GA4456@redhat.com> <20090916111845.GJ23157@redhat.com> <20090916115224.GA4628@redhat.com> <20090916121818.GA4710@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: optional feature List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org, Gleb Natapov On Wed, Sep 16, 2009 at 02:26:58PM +0200, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Wed, Sep 16, 2009 at 02:14:32PM +0200, Juan Quintela wrote: > >> >> See below, we are changing the state to one table, and tables don't have > >> >> neither if's or whiles (we have a limited for that just walks arrays). > >> > > >> > Let's just bite the bullet and add support for if's? It's not like it's > >> > hard to invent 'struct vmstate_condition' or some such. > >> > >> I have to do it. The problem is not adding an optional field, is adding > >> it conditionally on _what_, and that _what_ should also be ideally on vmstate. > >> > >> Later, Juan. > > > > pci config is on vmstate already, I don't see a problem here. > > vmstate don't understand pci config. How can it save it then? What's more, how can it load it sanely? E.g. when loading we must make sure that device id etc match. > I want to manipulate images with > the informantion that you have given vmstate. Sending another byte > meaning: > > msix_enabled > > and now depending on that value another field is ok with me. 1. this bit is there in config already. sending it twice is redundant and so, wrong: we will just have to add even more code to check that these values match 2. it's also not backward compatible, is it? > You can > calculate msix_enable at pre_save time whenever way that you see fit. Not everything has to fit in a global variable, we can have a table per-device. Then each time msix_enable bit is changed, I can tell vmstate about it. > What vmstate needs is a only to now if msix_enable is 0 or 1, how you > calculate it, VMState don't care. Add a condition including offset into pci config and bitmask? > Later, Juan.