qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Resend][Seabios PATCH] don't boot from un-selected dev


From: Ronen Hod
Subject: Re: [Qemu-devel] [Resend][Seabios PATCH] don't boot from un-selected devices
Date: Tue, 25 Dec 2012 17:59:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 12/19/2012 11:32 AM, 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
And sometimes he want. The patch changes behaviour unconditionally. New
behaviour should be user selectable. Something line -boot order=strict
on qemu command line.

Another option would be to add a "terminator" symbol, say "T" (I couldn't find a good 
terminator), so that order=ndT, would mean strict "nd".

Ronen.


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 <address@hidden>
---
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);
  }
--
1.7.1
--
                        Gleb.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]