From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnUFC-0001rr-CS for qemu-devel@nongnu.org; Fri, 14 Jun 2013 09:40:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnUFA-00065g-98 for qemu-devel@nongnu.org; Fri, 14 Jun 2013 09:40:46 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:36409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnUFA-00065Z-1X for qemu-devel@nongnu.org; Fri, 14 Jun 2013 09:40:44 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Jun 2013 07:40:43 -0600 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 3E983C90058 for ; Fri, 14 Jun 2013 09:40:38 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5EDecX5327324 for ; Fri, 14 Jun 2013 09:40:38 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5EDeQJb012298 for ; Fri, 14 Jun 2013 07:40:26 -0600 From: Anthony Liguori In-Reply-To: <1371208516-7857-6-git-send-email-armbru@redhat.com> References: <1371208516-7857-1-git-send-email-armbru@redhat.com> <1371208516-7857-6-git-send-email-armbru@redhat.com> Date: Fri, 14 Jun 2013 08:40:19 -0500 Message-ID: <87ppvog69o.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v3 05/16] pc: Make -no-fd-bootchk stick across boot order changes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, alex.williamson@redhat.com, afaerber@suse.de, aviksil@linux.vnet.ibm.com Markus Armbruster writes: > Option -no-fd-bootchk asks the BIOS to attempt booting from a floppy > even when the boot sector signature isn't there, by setting a bit in > RTC CMOS. It was added back in 2006 (commit 52ca8d6a). > > Two years later, commit 0ecdffbb added monitor command boot_set. > Implemented by new function pc_boot_set(). It unconditionally clears > the floppy signature bit in CMOS. > > Commit e0f084bf added -boot option once to automatically change the > boot order on first reset. Reuses pc_boot_set(), thus also clears the > floppy signature bit. Commit d9346e81 took care to preserve this > behavior. Quite a history there :-) Does anyone still use no-fd-bootchk? Do you know what the original use-case was? > Thus, -no-fd-bootchk applies to any number of boots. Except it > applies just to the first boot with -boot once, and never after > boot_set. Weird. Make it stick instead: set the bit according to > -no-fd-bootchk in pc_boot_set(). > > Signed-off-by: Markus Armbruster Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > hw/i386/pc.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index 4844a6b..7e524fc 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -266,7 +266,7 @@ static int boot_device2nibble(char boot_device) > return 0; > } > > -static int set_boot_dev(ISADevice *s, const char *boot_device, int fd_bootchk) > +static int set_boot_dev(ISADevice *s, const char *boot_device) > { > #define PC_MAX_BOOT_DEVICES 3 > int nbds, bds[3] = { 0, }; > @@ -292,7 +292,7 @@ static int set_boot_dev(ISADevice *s, const char *boot_device, int fd_bootchk) > > static int pc_boot_set(void *opaque, const char *boot_device) > { > - return set_boot_dev(opaque, boot_device, 0); > + return set_boot_dev(opaque, boot_device); > } > > typedef struct pc_cmos_init_late_arg { > @@ -407,8 +407,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size, > cpu_hotplug_cb.cpu_added_notifier.notify = rtc_notify_cpu_added; > qemu_register_cpu_added_notifier(&cpu_hotplug_cb.cpu_added_notifier); > > - /* set boot devices, and disable floppy signature check if requested */ > - if (set_boot_dev(s, boot_device, fd_bootchk)) { > + if (set_boot_dev(s, boot_device)) { > exit(1); > } > > -- > 1.7.11.7