Received: from eggs.gnu.org ([208.118.235.92]:34958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THATW-0003fE-Eu for qemu-devel@nongnu.org; Thu, 27 Sep 2012 05:33:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THATS-0005ns-4j for qemu-devel@nongnu.org; Thu, 27 Sep 2012 05:33:42 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <1348738150.24701.21.camel@pasglop> Date: Thu, 27 Sep 2012 11:33:31 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <50641A82.4030708@linux.vnet.ibm.com> <1348738150.24701.21.camel@pasglop> Subject: Re: [Qemu-devel] [Qemu-ppc] Qemu boot device precedence over nvram boot-device setting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: Gleb Natapov , "qemu-ppc@nongnu.org List" , Avik Sil , Nikunj A Dadhania , qemu-devel qemu-devel On 27.09.2012, at 11:29, Benjamin Herrenschmidt wrote: > On Thu, 2012-09-27 at 14:51 +0530, Avik Sil wrote: >> Hi, >>=20 >> We would like to get a method to boot from devices provided in -boot=20= >> arguments in qemu when the 'boot-device' is set in nvram for pseries=20= >> machine. I mean the boot device specified in -boot should get a=20 >> precedence over the 'boot-device' specified in nvram. >>=20 >> At the same time, when -boot is not provided, i.e., the default boot=20= >> order "cad" is present, the device specified in nvram 'boot-device'=20= >> should get precedence if it is set. >>=20 >> What should be the elegant way to implement this requirement?=20 >> Suggestions welcome. >=20 > Actually I think it's a more open question. We have essentially two > things at play here: >=20 > - With the new nvram model, the firmware can store a boot device > reference in it, which is standard OF practice, and in fact the = various > distro installers are going to do just that >=20 > - Qemu has its own boot order thingy via -boot, which we loosely > translate as c =3D first bootable disk we find (actually first disk we > find, we should probably make the algorithm a bit smarter), d =3D = first > cdrom we find, n =3D network , ... We pass that selection (boot list) = down > to SLOF via a device-tree property. >=20 > The question is thus what precedence should we give them. I was > initially thinking that an explicit qemu boot list should override the > firmware nvram setting but I'm now not that sure anymore. >=20 > The -boot list is at best a "blurry" indication of what type of device > the user wants ... The firmware setting in nvram is precise. IIRC gleb had implemented a specific boot order thing. Gleb, mind to = enlighten us? :) > However if we make the nvram override qemu, then it's trickier to > force-boot from, let's say, a rescue CD. The user would have to stop = the > SLOF boot process by pressing a key then manually type something like > "boot cdrom". >=20 > Maybe the right approach is "in between", and is that the primary = driver > is the -boot argument. For each entry in the boot list, if it's "c", = use > the configured boot-device or fallback to the automatic guess SLOF = tries > to do today in absence of a boot-device. If it's "d" or "n" force it > respectively to cdrom or network... >=20 > I think there is no perfect solution here. What do you guys think is = the > less user unfriendly ? I think the command line should override anything user specified. So = basically: * user defined -boot option (or bootindex magic from Gleb) * nvram * fallback to default > Eventually we should try to implement some sort of interactive boot > device selection in SLOF, such as SMS does on pseries, but that will > take a bit of time. That would be en par with the bootmenu on x86 :). Please check out how = x86 models these things. It could sure be interesting for pseries. Alex