On Fri, May 11, 2012 at 09:07:25AM -0700, ron minnich wrote:
On Fri, May 11, 2012 at 6:28 AM, Maurits van de Lande M.vandeLande@vdl-fittings.com wrote:
I would prefer to automatically reboot the VM (or retry the boot devices) when no bootable device is found, then when the iSCSI storage is available again the VM can boot normally.
(when I manually sent CTRL+ALT+DEL to the VM the system booted normaly again)
It would be an interesting option. Sometimes, for hardware, you really want it to wait with the error message on the screen for a while so you can tell what happened. At the same time, there's nothing more annoying than having it wait forever when you know the hardware finally is ready for a boot ... Perhaps it would be possible to set a reasonable optional timeout and then have it reboot or, better, just redo the hardware scan and try again.
Makes sense - something like the below should work.
-Kevin
diff --git a/src/boot.c b/src/boot.c index 8cc94b0..832347a 100644 --- a/src/boot.c +++ b/src/boot.c @@ -617,6 +617,25 @@ boot_rom(u32 vector) call_boot_entry(so, 0); }
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{ + printf("No bootable device.\n"); + // Wait for 60 seconds and then reboot. + u32 end = calc_future_timer(60*1000); + for (;;) { + if (check_timer(end)) + break; + wait_irq(); + } + printf("Rebooting.\n"); + struct bregs br; + memset(&br, 0, sizeof(br)); + br.code = SEGOFF(SEG_BIOS, (u32)reset_vector); + call16big(&br); +} + // Determine next boot method and attempt a boot using it. static void do_boot(u16 seq_nr) @@ -625,10 +644,7 @@ do_boot(u16 seq_nr) panic("Boot support not compiled in.\n");
if (seq_nr >= BEVCount) { - printf("No bootable device.\n"); - // Loop with irqs enabled - this allows ctrl+alt+delete to work. - for (;;) - wait_irq(); + boot_fail(); }
// Boot the given BEV type.
Kevin O'Connor wrote:
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- printf("No bootable device.\n");
- // Wait for 60 seconds and then reboot.
- u32 end = calc_future_timer(60*1000);
I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n"); and lowering the timeout.
//Peter
On Sat, May 12, 2012 at 03:04:52AM +0200, Peter Stuge wrote:
Kevin O'Connor wrote:
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- printf("No bootable device.\n");
- // Wait for 60 seconds and then reboot.
- u32 end = calc_future_timer(60*1000);
I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n"); and lowering the timeout.
On host running hundreds of VMs reboot each 5 seconds may generate a lot of unneeded load. Better make it configurable with option to disable the behaviour.
-- Gleb.
Gleb Natapov wrote:
I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n"); and lowering the timeout.
On host running hundreds of VMs reboot each 5 seconds may generate a lot of unneeded load.
Not a whole lot more than when the VMs are up and running.
Better make it configurable with option to disable the behaviour.
Sure, if 0 then don't retry.
//Peter
On Sat, May 12, 2012 at 03:04:52AM +0200, Peter Stuge wrote:
Kevin O'Connor wrote:
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- printf("No bootable device.\n");
- // Wait for 60 seconds and then reboot.
- u32 end = calc_future_timer(60*1000);
I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n"); and lowering the timeout.
I'd only do this if the timeout was large - indeed I think 60 seconds is a little on the low side. (Not being able to boot is almost always an error - it should be fixed not covered up.)
That said, making it a config option is trivial.
-Kevin
diff --git a/src/boot.c b/src/boot.c index 8cc94b0..b5b3360 100644 --- a/src/boot.c +++ b/src/boot.c @@ -617,6 +617,26 @@ boot_rom(u32 vector) call_boot_entry(so, 0); }
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{ + u32 retrytime = romfile_loadint("etc/boot-fail-wait", 60*1000); + printf("No bootable device. Retrying in %d seconds.\n", retrytime/1000); + // Wait for 'retrytime' milliseconds and then reboot. + u32 end = calc_future_timer(retrytime); + for (;;) { + if (check_timer(end)) + break; + wait_irq(); + } + printf("Rebooting.\n"); + struct bregs br; + memset(&br, 0, sizeof(br)); + br.code = SEGOFF(SEG_BIOS, (u32)reset_vector); + call16big(&br); +} + // Determine next boot method and attempt a boot using it. static void do_boot(u16 seq_nr) @@ -625,10 +645,7 @@ do_boot(u16 seq_nr) panic("Boot support not compiled in.\n");
if (seq_nr >= BEVCount) { - printf("No bootable device.\n"); - // Loop with irqs enabled - this allows ctrl+alt+delete to work. - for (;;) - wait_irq(); + boot_fail(); }
// Boot the given BEV type.
On Sat, May 12, 2012 at 10:01:49AM -0400, Kevin O'Connor wrote:
On Sat, May 12, 2012 at 03:04:52AM +0200, Peter Stuge wrote:
Kevin O'Connor wrote:
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- printf("No bootable device.\n");
- // Wait for 60 seconds and then reboot.
- u32 end = calc_future_timer(60*1000);
I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n"); and lowering the timeout.
I'd only do this if the timeout was large - indeed I think 60 seconds is a little on the low side. (Not being able to boot is almost always an error - it should be fixed not covered up.)
Agree. For VM use it's better to notify management about it.
That said, making it a config option is trivial.
The patch below does not allow to disable the behaviour (short of setting ridiculously long timeout). Lets make 0 timeout to mean never timeout and make it a default.
-Kevin
diff --git a/src/boot.c b/src/boot.c index 8cc94b0..b5b3360 100644 --- a/src/boot.c +++ b/src/boot.c @@ -617,6 +617,26 @@ boot_rom(u32 vector) call_boot_entry(so, 0); }
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- u32 retrytime = romfile_loadint("etc/boot-fail-wait", 60*1000);
- printf("No bootable device. Retrying in %d seconds.\n", retrytime/1000);
- // Wait for 'retrytime' milliseconds and then reboot.
- u32 end = calc_future_timer(retrytime);
- for (;;) {
if (check_timer(end))
break;
wait_irq();
- }
- printf("Rebooting.\n");
- struct bregs br;
- memset(&br, 0, sizeof(br));
- br.code = SEGOFF(SEG_BIOS, (u32)reset_vector);
- call16big(&br);
+}
// Determine next boot method and attempt a boot using it. static void do_boot(u16 seq_nr) @@ -625,10 +645,7 @@ do_boot(u16 seq_nr) panic("Boot support not compiled in.\n");
if (seq_nr >= BEVCount) {
printf("No bootable device.\n");
// Loop with irqs enabled - this allows ctrl+alt+delete to work.
for (;;)
wait_irq();
boot_fail();
}
// Boot the given BEV type.
SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
-- Gleb.
On Sun, May 13, 2012 at 01:02:10PM +0300, Gleb Natapov wrote:
On Sat, May 12, 2012 at 10:01:49AM -0400, Kevin O'Connor wrote:
On Sat, May 12, 2012 at 03:04:52AM +0200, Peter Stuge wrote:
Kevin O'Connor wrote:
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- printf("No bootable device.\n");
- // Wait for 60 seconds and then reboot.
- u32 end = calc_future_timer(60*1000);
I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n"); and lowering the timeout.
I'd only do this if the timeout was large - indeed I think 60 seconds is a little on the low side. (Not being able to boot is almost always an error - it should be fixed not covered up.)
Agree. For VM use it's better to notify management about it.
That said, making it a config option is trivial.
The patch below does not allow to disable the behaviour (short of setting ridiculously long timeout). Lets make 0 timeout to mean never timeout and make it a default.
How about -1 to indicate no reboot. Also, I think a 60 second reboot is a good default. Maurits indicated his off-the-shelf BIOS did this, and I can see where it would be useful. (I've run into cases where a USB device didn't spin up in time and there was no indication it was present - if this were to happen in a datacenter environment, it would be a real pain to have to go find the machine.)
-Kevin
--- a/src/boot.c +++ b/src/boot.c @@ -617,6 +617,29 @@ boot_rom(u32 vector) call_boot_entry(so, 0); }
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{ + u32 retrytime = romfile_loadint("etc/boot-fail-wait", 60*1000); + if (retrytime == (u32)-1) + printf("No bootable device.\n"); + else + printf("No bootable device. Retrying in %d seconds.\n", retrytime/1000); + // Wait for 'retrytime' milliseconds and then reboot. + u32 end = calc_future_timer(retrytime); + for (;;) { + if (retrytime != (u32)-1 && check_timer(end)) + break; + wait_irq(); + } + printf("Rebooting.\n"); + struct bregs br; + memset(&br, 0, sizeof(br)); + br.code = SEGOFF(SEG_BIOS, (u32)reset_vector); + call16big(&br); +} + // Determine next boot method and attempt a boot using it. static void do_boot(u16 seq_nr) @@ -624,12 +647,8 @@ do_boot(u16 seq_nr) if (! CONFIG_BOOT) panic("Boot support not compiled in.\n");
- if (seq_nr >= BEVCount) { - printf("No bootable device.\n"); - // Loop with irqs enabled - this allows ctrl+alt+delete to work. - for (;;) - wait_irq(); - } + if (seq_nr >= BEVCount) + boot_fail();
// Boot the given BEV type. struct bev_s *ie = &BEV[seq_nr];
Hello,
Thank you for considering the feature.
On Sun, May 13, 2012 at 01:02:10PM +0300, Gleb Natapov wrote:
On Sat, May 12, 2012 at 10:01:49AM -0400, Kevin O'Connor wrote:
On Sat, May 12, 2012 at 03:04:52AM +0200, Peter Stuge wrote:
Kevin O'Connor wrote:
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- printf("No bootable device.\n");
- // Wait for 60 seconds and then reboot.
- u32 end = calc_future_timer(60*1000);
I'd suggest printf("No bootable device found. Retrying in 5 seconds...\n"); and lowering the timeout.
I'd only do this if the timeout was large - indeed I think 60 seconds is a little on the low side. (Not being able to boot is almost always an error - it should be fixed not covered up.)
Agree. For VM use it's better to notify management about it.
That said, making it a config option is trivial.
The patch below does not allow to disable the behaviour (short of setting ridiculously long timeout). Lets make 0 timeout to mean never timeout and make it a default.
How about -1 to indicate no reboot. Also, I think a 60 second reboot is a good default. Maurits indicated his off-the-shelf BIOS did this, and I can see where it would be useful. (I've run into cases where a USB device didn't spin up in time and there was no indication it was present - if this were to happen in a datacenter environment, it would be a real pain to have to go find the machine.)
-Kevin
In my case a 60 second reboot will do fine. Then the VM's can eventualy boot when the iSCSI storage is up again. I do not know how seabios integrates with qemu and KVM but it would be nice if the new reboot timeout option could be used without having to modify qemu. When the bootmenu is enabled I found the following line in my VM config file < bootmenu enable="yes"/> Does this mean that all options specified after bootmenu are being send to seabios? Could a boot 60 second timeout value be set like this? < bootmenu enable="no" boot_timeout="60"/>
-Maurits
--- a/src/boot.c +++ b/src/boot.c @@ -617,6 +617,29 @@ boot_rom(u32 vector) call_boot_entry(so, 0); }
+// Unable to find bootable device - warn user and eventually retry. +static void +boot_fail(void) +{
- u32 retrytime = romfile_loadint("etc/boot-fail-wait", 60*1000);
- if (retrytime == (u32)-1)
printf("No bootable device.\n");
- else
printf("No bootable device. Retrying in %d seconds.\n", retrytime/1000);
- // Wait for 'retrytime' milliseconds and then reboot.
- u32 end = calc_future_timer(retrytime);
- for (;;) {
if (retrytime != (u32)-1&& check_timer(end))
break;
wait_irq();
- }
- printf("Rebooting.\n");
- struct bregs br;
- memset(&br, 0, sizeof(br));
- br.code = SEGOFF(SEG_BIOS, (u32)reset_vector);
- call16big(&br);
+}
- // Determine next boot method and attempt a boot using it. static void do_boot(u16 seq_nr)
@@ -624,12 +647,8 @@ do_boot(u16 seq_nr) if (! CONFIG_BOOT) panic("Boot support not compiled in.\n");
- if (seq_nr>= BEVCount) {
printf("No bootable device.\n");
// Loop with irqs enabled - this allows ctrl+alt+delete to work.
for (;;)
wait_irq();
- }
if (seq_nr>= BEVCount)
boot_fail(); // Boot the given BEV type. struct bev_s *ie =&BEV[seq_nr];
SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
On Mon, May 14, 2012 at 12:00:48AM +0200, Maurits van de Lande wrote:
In my case a 60 second reboot will do fine. Then the VM's can eventualy boot when the iSCSI storage is up again. I do not know how seabios integrates with qemu and KVM but it would be nice if the new reboot timeout option could be used without having to modify qemu. When the bootmenu is enabled I found the following line in my VM config file < bootmenu enable="yes"/> Does this mean that all options specified after bootmenu are being send to seabios? Could a boot 60 second timeout value be set like this? < bootmenu enable="no" boot_timeout="60"/>
No, that wont work. Unfortunately, there is no current mechanism to pass an option from Qemu to SeaBIOS without a QEmu code change.
-Kevin