From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49387 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkeLV-0001EZ-6j for qemu-devel@nongnu.org; Wed, 02 Feb 2011 10:10:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkeLQ-0007Hr-4C for qemu-devel@nongnu.org; Wed, 02 Feb 2011 10:10:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkeLP-0007Hb-Sz for qemu-devel@nongnu.org; Wed, 02 Feb 2011 10:10:08 -0500 Date: Wed, 2 Feb 2011 17:10:04 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCHv8 12/16] Add bootindex parameter to net/block/fd device Message-ID: <20110202151004.GM14984@redhat.com> References: <1291808109-22563-1-git-send-email-gleb@redhat.com> <1291808109-22563-13-git-send-email-gleb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: blauwirbel@gmail.com, kevin@koconnor.net, qemu-devel@nongnu.org, kvm@vger.kernel.org On Wed, Feb 02, 2011 at 04:08:07PM +0100, Markus Armbruster wrote: > Gleb Natapov writes: > > > If bootindex is specified on command line a string that describes device > > in firmware readable way is added into sorted list. Later this list will > > be passed into firmware to control boot order. > > > > Signed-off-by: Gleb Natapov > > Just noticed something that slipped through review: > > [...] > > diff --git a/vl.c b/vl.c > > index 2cd263e..dadc161 100644 > > --- a/vl.c > > +++ b/vl.c > [...] > > @@ -693,6 +704,35 @@ static void restore_boot_devices(void *opaque) > > qemu_free(standard_boot_devices); > > } > > > > +void add_boot_device_path(int32_t bootindex, DeviceState *dev, > > + const char *suffix) > > +{ > > + FWBootEntry *node, *i; > > + > > + if (bootindex < 0) { > > + return; > > + } > > + > > + assert(dev != NULL || suffix != NULL); > > + > > + node = qemu_mallocz(sizeof(FWBootEntry)); > > + node->bootindex = bootindex; > > + node->suffix = strdup(suffix); > > qemu_strdup()? > Yap. Will fix. > > + node->dev = dev; > > + > > + QTAILQ_FOREACH(i, &fw_boot_order, link) { > > + if (i->bootindex == bootindex) { > > + fprintf(stderr, "Two devices with same boot index %d\n", bootindex); > > + exit(1); > > + } else if (i->bootindex < bootindex) { > > + continue; > > + } > > + QTAILQ_INSERT_BEFORE(i, node, link); > > + return; > > + } > > + QTAILQ_INSERT_TAIL(&fw_boot_order, node, link); > > +} > > + > > static void numa_add(const char *optarg) > > { > > char option[128]; -- Gleb.