From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TnO8X-0005yL-NC for qemu-devel@nongnu.org; Tue, 25 Dec 2012 01:37:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TnO8W-00087g-GY for qemu-devel@nongnu.org; Tue, 25 Dec 2012 01:37:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57698) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TnO8W-00087M-8u for qemu-devel@nongnu.org; Tue, 25 Dec 2012 01:37:12 -0500 Date: Tue, 25 Dec 2012 08:37:07 +0200 From: Gleb Natapov Message-ID: <20121225063707.GX17584@redhat.com> References: <1355901730-24350-1-git-send-email-akong@redhat.com> <1355901885-24398-1-git-send-email-akong@redhat.com> <20121219093208.GL11016@redhat.com> <20121225035808.GA1553@t430s.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121225035808.GA1553@t430s.redhat.com> Subject: Re: [Qemu-devel] [Resend][Seabios PATCH] don't boot from un-selected devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: dallan@redhat.com, alex.williamson@redhat.com, kevin@koconnor.net, seabios@seabios.org, qemu-devel@nongnu.org On Tue, Dec 25, 2012 at 11:58:08AM +0800, Amos Kong wrote: > On Wed, Dec 19, 2012 at 11:32:08AM +0200, Gleb Natapov wrote: > > On Wed, Dec 19, 2012 at 03:24:45PM +0800, Amos Kong wrote: > > > Current seabios will try to boot from selected devices first, > > > if they are all failed, seabios will also try to boot from > > > un-selected devices. > > > > > > For example: > > > @ qemu-kvm -boot order=n,menu=on ... > > > > > > Guest will boot from network first, if it's failed, guest will try to > > > boot from other un-selected devices (floppy, cdrom, disk) one by one. > > > > > > Sometimes, user don't want to boot from some devices. This patch changes > > Hi Gleb, > > > And sometimes he want. The patch changes behaviour unconditionally. New > > behaviour should be user selectable. Something line -boot order=strict > > on qemu command line. > > Sometimes, user don't know which devices are in boot list of seabios, > so they could not disable them through qemu cmdline. > This is not what I suggested though. And currently we do not have a way to remove one device from the boot process. This is separate issue and requires separate patch. > I didn't describe the purpose clearly. Currently we can assign boot > order by "-boot order=...", if fails to boot from all devices in order > parameters, other devices in seabios's boot table will also be tried. order= is an old style. Use bootindex instead. > > The exact request should be "only boot from selected devices". You described the purpose clearly first time. This is how I understood it :) > > I agree to make it configurable. > eg: qemu -boot order=nd,strict=on,menu=on > strick: on (only boot from selected devices) > strick: off (will try to boot from all devices in seabios' boot table) > default strick should be 'off' as current behavior. > Yes, this is my suggestion. > Thanks, Amos > > > > seabios to boot only from selected devices. > > > > > > If user choose first boot device from menu, then seabios will try all > > > the devices, even some of them are not selected. > > > > > > Signed-off-by: Amos Kong > > > --- > > > Resend for CCing seabios maillist. > > > --- > > > src/boot.c | 13 ++++++++----- > > > 1 files changed, 8 insertions(+), 5 deletions(-) > > > > > > diff --git a/src/boot.c b/src/boot.c > > > index 3ca7960..ee810ac 100644 > > > --- a/src/boot.c > > > +++ b/src/boot.c > > > @@ -424,6 +424,10 @@ interactive_bootmenu(void) > > > maxmenu++; > > > printf("%d. %s\n", maxmenu > > > , strtcpy(desc, pos->description, ARRAY_SIZE(desc))); > > > + /* If user chooses first boot device from menu, we will treat > > > + all the devices as selected. */ > > > + if (pos->priority == DEFAULT_PRIO) > > > + pos->priority = DEFAULT_PRIO - 1; > > > pos = pos->next; > > > } > > > > > > @@ -490,7 +494,10 @@ boot_prep(void) > > > > > > // Map drives and populate BEV list > > > struct bootentry_s *pos = BootList; > > > - while (pos) { > > > + > > > + /* The priority of un-selected device is not changed, > > > + we only boot from user selected devices. */ > > > + while (pos && pos->priority != DEFAULT_PRIO) { > > > switch (pos->type) { > > > case IPL_TYPE_BCV: > > > call_bcv(pos->vector.seg, pos->vector.offset); > > > @@ -513,10 +520,6 @@ boot_prep(void) > > > } > > > pos = pos->next; > > > } > > > - > > > - // If nothing added a floppy/hd boot - add it manually. > > > - add_bev(IPL_TYPE_FLOPPY, 0); > > > - add_bev(IPL_TYPE_HARDDISK, 0); -- Gleb.