yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-pc-Make-no-fd-bootchk-stick-across-boot-order-change.patch

9ae3a8
From 6ddf29f50854ed657ee27241cbd0bb7c2b4ae4b7 Mon Sep 17 00:00:00 2001
9ae3a8
Message-Id: <6ddf29f50854ed657ee27241cbd0bb7c2b4ae4b7.1383564115.git.minovotn@redhat.com>
9ae3a8
In-Reply-To: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
9ae3a8
References: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
9ae3a8
From: Markus Armbruster <armbru@redhat.com>
9ae3a8
Date: Fri, 27 Sep 2013 13:31:15 +0200
9ae3a8
Subject: [PATCH 05/14] pc: Make -no-fd-bootchk stick across boot order
9ae3a8
 changes
9ae3a8
9ae3a8
RH-Author: Markus Armbruster <armbru@redhat.com>
9ae3a8
Message-id: <1380288680-26645-6-git-send-email-armbru@redhat.com>
9ae3a8
Patchwork-id: 54564
9ae3a8
O-Subject: [PATCH 7.0 qemu-kvm 05/10] pc: Make -no-fd-bootchk stick across boot order changes
9ae3a8
Bugzilla: 997817
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
9ae3a8
9ae3a8
From: Markus Armbruster <armbru@redhat.com>
9ae3a8
9ae3a8
Option -no-fd-bootchk asks the BIOS to attempt booting from a floppy
9ae3a8
even when the boot sector signature isn't there, by setting a bit in
9ae3a8
RTC CMOS.  It was added back in 2006 (commit 52ca8d6a).
9ae3a8
9ae3a8
Two years later, commit 0ecdffbb added monitor command boot_set.
9ae3a8
Implemented by new function pc_boot_set().  It unconditionally clears
9ae3a8
the floppy signature bit in CMOS.
9ae3a8
9ae3a8
Commit e0f084bf added -boot option once to automatically change the
9ae3a8
boot order on first reset.  Reuses pc_boot_set(), thus also clears the
9ae3a8
floppy signature bit.  Commit d9346e81 took care to preserve this
9ae3a8
behavior.
9ae3a8
9ae3a8
Thus, -no-fd-bootchk applies to any number of boots.  Except it
9ae3a8
applies just to the first boot with -boot once, and never after
9ae3a8
boot_set.  Weird.  Make it stick instead: set the bit according to
9ae3a8
-no-fd-bootchk in pc_boot_set().
9ae3a8
9ae3a8
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
9ae3a8
Message-id: 1371208516-7857-6-git-send-email-armbru@redhat.com
9ae3a8
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
9ae3a8
(cherry picked from commit e1123015a50abf44f9daa9495f40eeaaf4c9bb98)
9ae3a8
---
9ae3a8
 hw/i386/pc.c | 7 +++----
9ae3a8
 1 file changed, 3 insertions(+), 4 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Michal Novotny <minovotn@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc.c | 7 +++----
9ae3a8
 1 file changed, 3 insertions(+), 4 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
9ae3a8
index 71b7a26..3c77040 100644
9ae3a8
--- a/hw/i386/pc.c
9ae3a8
+++ b/hw/i386/pc.c
9ae3a8
@@ -266,7 +266,7 @@ static int boot_device2nibble(char boot_device)
9ae3a8
     return 0;
9ae3a8
 }
9ae3a8
 
9ae3a8
-static int set_boot_dev(ISADevice *s, const char *boot_device, int fd_bootchk)
9ae3a8
+static int set_boot_dev(ISADevice *s, const char *boot_device)
9ae3a8
 {
9ae3a8
 #define PC_MAX_BOOT_DEVICES 3
9ae3a8
     int nbds, bds[3] = { 0, };
9ae3a8
@@ -292,7 +292,7 @@ static int set_boot_dev(ISADevice *s, const char *boot_device, int fd_bootchk)
9ae3a8
 
9ae3a8
 static int pc_boot_set(void *opaque, const char *boot_device)
9ae3a8
 {
9ae3a8
-    return set_boot_dev(opaque, boot_device, 0);
9ae3a8
+    return set_boot_dev(opaque, boot_device);
9ae3a8
 }
9ae3a8
 
9ae3a8
 typedef struct pc_cmos_init_late_arg {
9ae3a8
@@ -407,8 +407,7 @@ void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
9ae3a8
     cpu_hotplug_cb.cpu_added_notifier.notify = rtc_notify_cpu_added;
9ae3a8
     qemu_register_cpu_added_notifier(&cpu_hotplug_cb.cpu_added_notifier);
9ae3a8
 
9ae3a8
-    /* set boot devices, and disable floppy signature check if requested */
9ae3a8
-    if (set_boot_dev(s, boot_device, fd_bootchk)) {
9ae3a8
+    if (set_boot_dev(s, boot_device)) {
9ae3a8
         exit(1);
9ae3a8
     }
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.7.11.7
9ae3a8