qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: kevin@koconnor.net
Cc: seabios@seabios.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [Seabios PATCH] make reboot-timeout to static for using it after POST phase
Date: Tue,  5 Mar 2013 10:06:28 +0800	[thread overview]
Message-ID: <1362449188-383-1-git-send-email-akong@redhat.com> (raw)
In-Reply-To: <20130304094502.GA10725@t430s.nay.redhat.com>

From: Kevin O'Connor <kevin@koconnor.net>

Memory allocated with malloc_tmp() can't be used after the POST
phase. The reboot-timeout inside romfile could not be loaded in
boot_fail(). The patch saved reboot-timeout to a static variable,
it fixed the regression bug introduced by commit 59d6ca52

I already tested this patch, reboot-timeout parameter of qemu
works now.
@ qemu -boot reboot-timeout=1000 ...

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Amos Kong <akong@redhat.com>
---
 src/boot.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/boot.c b/src/boot.c
index ec411b7..325fac0 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -235,6 +235,7 @@ int bootprio_find_usb(struct usbdevice_s *usbdev, int lun)
  * Boot setup
  ****************************************************************/
 
+static int BootRetryTime;
 static int CheckFloppySig = 1;
 
 #define DEFAULT_PRIO           9999
@@ -271,6 +272,8 @@ boot_init(void)
         }
     }
 
+    BootRetryTime = romfile_loadint("etc/boot-fail-wait", 60*1000);
+
     loadBootOrder();
 }
 
@@ -629,15 +632,15 @@ boot_rom(u32 vector)
 static void
 boot_fail(void)
 {
-    u32 retrytime = romfile_loadint("etc/boot-fail-wait", 60*1000);
-    if (retrytime == (u32)-1)
+    if (BootRetryTime == (u32)-1)
         printf("No bootable device.\n");
     else
-        printf("No bootable device.  Retrying in %d seconds.\n", retrytime/1000);
+        printf("No bootable device.  Retrying in %d seconds.\n"
+               , BootRetryTime/1000);
     // Wait for 'retrytime' milliseconds and then reboot.
-    u32 end = calc_future_timer(retrytime);
+    u32 end = calc_future_timer(BootRetryTime);
     for (;;) {
-        if (retrytime != (u32)-1 && check_timer(end))
+        if (BootRetryTime != (u32)-1 && check_timer(end))
             break;
         yield_toirq();
     }
-- 
1.7.1

  parent reply	other threads:[~2013-03-05  2:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04  9:45 [Qemu-devel] seabios bug: fail to find etc/boot-fail-wait Amos Kong
2013-03-04 13:53 ` Kevin O'Connor
2013-03-05  2:06 ` Amos Kong [this message]
2013-03-05  9:03   ` [Qemu-devel] [SeaBIOS] [Seabios PATCH] make reboot-timeout to static for using it after POST phase li guang
2013-03-05  9:52 ` [Qemu-devel] [Seabios PATCH v2] " Amos Kong
2013-03-07  1:07   ` Kevin O'Connor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362449188-383-1-git-send-email-akong@redhat.com \
    --to=akong@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).