From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1zN5-0002xZ-Om for qemu-devel@nongnu.org; Mon, 08 Jun 2015 11:53:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1zN1-0003OZ-PS for qemu-devel@nongnu.org; Mon, 08 Jun 2015 11:53:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1zN1-0003OK-L3 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 11:53:51 -0400 Date: Mon, 8 Jun 2015 17:53:48 +0200 From: "Michael S. Tsirkin" Message-ID: <20150608175253-mutt-send-email-mst@redhat.com> References: <20150601203126.GK2120@HEDWIG.INI.CMU.EDU> <1433229074.1637.7.camel@nilsson.home.kraxel.org> <20150605160555.GH9951@HEDWIG.INI.CMU.EDU> <1433748105.5046.6.camel@redhat.com> <20150608114309-mutt-send-email-mst@redhat.com> <1433762362.5046.28.camel@redhat.com> <55758012.7060007@redhat.com> <20150608122355.GB32650@HEDWIG.INI.CMU.EDU> <1433766825.5046.42.camel@redhat.com> <20150608133253.GC32650@HEDWIG.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150608133253.GC32650@HEDWIG.INI.CMU.EDU> Subject: Re: [Qemu-devel] fw cfg files cross-version migration races List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" Cc: Paolo Bonzini , lersek@redhat.com, Gerd Hoffmann , qemu-devel@nongnu.org On Mon, Jun 08, 2015 at 09:32:53AM -0400, Gabriel L. Somlo wrote: > On Mon, Jun 08, 2015 at 02:33:45PM +0200, Gerd Hoffmann wrote: > > Hi, > > > > > I'm wonderingjust when exactly to start sorting items in fw_cfg ? > > > > I'd suggest to sort as entries are added, i.e. just insert the new entry > > at the correct place instead of tacking it to the end. So the list is > > always sorted. > > I was thinking that too, but since these are all arrays (not linked > lists), I'm a bit put off by the idea of having to shift everything > that's already in there by one position upon each "sorted insert". > Not to mention updating the "select" field of each FWCfgFile entry in > the directory (and maybe sorting/shifting the FWCfgFiles directory > itself) :( > > Combined with "only do this on machine versions 2.4 or later", maybe > just sorting everything during the machine_ready callback would be > less hairy ? Unfortunately we have a bunch of code adding fw cfg entries after machine ready. > I'll be on vacation for one week, so meditating on this in the back > of my mind might help come up with something... :) > > Thanks, > --Gabriel