xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rombios: pause for a keypress after a failed boot
@ 2010-07-06 13:59 Tim Deegan
  2010-07-07  1:43 ` [PATCH] rombios: pause for a keypress after a failedboot James Harper
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Deegan @ 2010-07-06 13:59 UTC (permalink / raw)
  To: xen-devel

rombios: inform the user and pause for a keypress after a failed boot
rather than powering off immediately. 

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>

diff -r e8f6f9a86f55 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c	Tue Jul 06 14:30:39 2010 +0100
+++ b/tools/firmware/rombios/rombios.c	Tue Jul 06 14:42:04 2010 +0100
@@ -8243,7 +8243,27 @@
     write_word(ebda_seg, IPL_BOOTFIRST_OFFSET, 0xFFFF);
     /* Reset boot sequence */
     write_word(ebda_seg, IPL_SEQUENCE_OFFSET, 0xFFFF);
-  } else if (bootdev == 0) BX_PANIC("No bootable device.\n");
+  } else if (bootdev == 0) {
+    printf("\nNo bootable device.\n");
+    printf("Reboot or press any key to retry.");
+    write_word(ebda_seg, IPL_SEQUENCE_OFFSET, 0xFFFF);
+ASM_START
+    sti
+ASM_END
+    {
+      Bit8u sc, ac;
+      while(!dequeue_key(&sc, &ac, 1)) {
+ASM_START
+        hlt
+ASM_END
+      }
+    }
+ASM_START
+    cli
+ASM_END
+    printf("\n\n");
+    return;
+  }
 
   /* Translate from CMOS runes to an IPL table offset by subtracting 1 */
   bootdev -= 1;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] rombios: pause for a keypress after a failedboot
  2010-07-06 13:59 [PATCH] rombios: pause for a keypress after a failed boot Tim Deegan
@ 2010-07-07  1:43 ` James Harper
  2010-07-07  6:26   ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: James Harper @ 2010-07-07  1:43 UTC (permalink / raw)
  To: Tim Deegan, xen-devel

> 
> rombios: inform the user and pause for a keypress after a failed boot
> rather than powering off immediately.
> 

That's a great idea for many situations, but not for all. If the DomU
fails to boot (eg because the drbd backing store is offline or
something) it would be nice to have the domain exit so that monitoring
can kick in and alert someone, rather than it just sitting there in a
running state waiting for user input that might never come.

I know it's probably a heap more work, but could the behaviour be driven
by a config file setting? Otherwise this new behaviour is going to be a
regression.

Thanks

James

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rombios: pause for a keypress after a failedboot
  2010-07-07  1:43 ` [PATCH] rombios: pause for a keypress after a failedboot James Harper
@ 2010-07-07  6:26   ` Keir Fraser
  2010-07-07  6:29     ` James Harper
  2010-07-07  9:49     ` Tim Deegan
  0 siblings, 2 replies; 6+ messages in thread
From: Keir Fraser @ 2010-07-07  6:26 UTC (permalink / raw)
  To: James Harper, Tim Deegan, xen-devel@lists.xensource.com

On 07/07/2010 02:43, "James Harper" <james.harper@bendigoit.com.au> wrote:

>> rombios: inform the user and pause for a keypress after a failed boot
>> rather than powering off immediately.
>> 
> 
> That's a great idea for many situations, but not for all. If the DomU
> fails to boot (eg because the drbd backing store is offline or
> something) it would be nice to have the domain exit so that monitoring
> can kick in and alert someone, rather than it just sitting there in a
> running state waiting for user input that might never come.
> 
> I know it's probably a heap more work, but could the behaviour be driven
> by a config file setting? Otherwise this new behaviour is going to be a
> regression.

Simply pausign for a few seconds might be nice. Gives enough time for a user
to see what is going on, but doesn't leave an unattended VM hanging around
forever?

 -- Keir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] rombios: pause for a keypress after a failedboot
  2010-07-07  6:26   ` Keir Fraser
@ 2010-07-07  6:29     ` James Harper
  2010-07-07  6:36       ` Keir Fraser
  2010-07-07  9:49     ` Tim Deegan
  1 sibling, 1 reply; 6+ messages in thread
From: James Harper @ 2010-07-07  6:29 UTC (permalink / raw)
  To: Keir Fraser, Tim Deegan, xen-devel

> 
> On 07/07/2010 02:43, "James Harper" <james.harper@bendigoit.com.au>
wrote:
> 
> >> rombios: inform the user and pause for a keypress after a failed
boot
> >> rather than powering off immediately.
> >>
> >
> > That's a great idea for many situations, but not for all. If the
DomU
> > fails to boot (eg because the drbd backing store is offline or
> > something) it would be nice to have the domain exit so that
monitoring
> > can kick in and alert someone, rather than it just sitting there in
a
> > running state waiting for user input that might never come.
> >
> > I know it's probably a heap more work, but could the behaviour be
driven
> > by a config file setting? Otherwise this new behaviour is going to
be a
> > regression.
> 
> Simply pausign for a few seconds might be nice. Gives enough time for
a user
> to see what is going on, but doesn't leave an unattended VM hanging
around
> forever?
> 

That would certainly be much easier in terms of programming effort, and
fulfils most of my concerns.

What criteria does xend use to determine if a domain is in a reboot
loop? Is it just a single restart within some number of seconds, or is
it a certain number of reboots in a certain number of seconds?

Thanks

James

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rombios: pause for a keypress after a failedboot
  2010-07-07  6:29     ` James Harper
@ 2010-07-07  6:36       ` Keir Fraser
  0 siblings, 0 replies; 6+ messages in thread
From: Keir Fraser @ 2010-07-07  6:36 UTC (permalink / raw)
  To: James Harper, Tim Deegan, xen-devel@lists.xensource.com

On 07/07/2010 07:29, "James Harper" <james.harper@bendigoit.com.au> wrote:

>> Simply pausign for a few seconds might be nice. Gives enough time for
> a user
>> to see what is going on, but doesn't leave an unattended VM hanging
> around
>> forever?
>> 
> 
> That would certainly be much easier in terms of programming effort, and
> fulfils most of my concerns.
> 
> What criteria does xend use to determine if a domain is in a reboot
> loop? Is it just a single restart within some number of seconds, or is
> it a certain number of reboots in a certain number of seconds?

I think it's a single restart within 60 seconds that triggers it. That's how
the code reads anyway.

 -- Keir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] rombios: pause for a keypress after a failedboot
  2010-07-07  6:26   ` Keir Fraser
  2010-07-07  6:29     ` James Harper
@ 2010-07-07  9:49     ` Tim Deegan
  1 sibling, 0 replies; 6+ messages in thread
From: Tim Deegan @ 2010-07-07  9:49 UTC (permalink / raw)
  To: Keir Fraser; +Cc: James Harper, xen-devel@lists.xensource.com

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

At 07:26 +0100 on 07 Jul (1278487607), Keir Fraser wrote:
> > That's a great idea for many situations, but not for all. If the DomU
> > fails to boot (eg because the drbd backing store is offline or
> > something) it would be nice to have the domain exit so that monitoring
> > can kick in and alert someone, rather than it just sitting there in a
> > running state waiting for user input that might never come.
> > 
> > I know it's probably a heap more work, but could the behaviour be driven
> > by a config file setting? Otherwise this new behaviour is going to be a
> > regression.
> 
> Simply pausign for a few seconds might be nice. Gives enough time for a user
> to see what is going on, but doesn't leave an unattended VM hanging around
> forever?

That's easy enough.  The attached patch makes it wait 30 seconds before
shutting down instead.  (It applies on top of my original patch).

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>

Tim.

-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

[-- Attachment #2: bios-delay --]
[-- Type: text/plain, Size: 947 bytes --]

diff -r a0f0ae5be814 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c	Tue Jul 06 17:58:37 2010 +0100
+++ b/tools/firmware/rombios/rombios.c	Wed Jul 07 10:47:54 2010 +0100
@@ -8243,24 +8243,15 @@
     write_word(ebda_seg, IPL_SEQUENCE_OFFSET, 0xFFFF);
   } else if (bootdev == 0) {
     printf("\nNo bootable device.\n");
-    printf("Reboot or press any key to retry.");
-    write_word(ebda_seg, IPL_SEQUENCE_OFFSET, 0xFFFF);
+    printf("Powering off in 30 seconds.\n");
 ASM_START
     sti
-ASM_END
-    {
-      Bit8u sc, ac;
-      while(!dequeue_key(&sc, &ac, 1)) {
-ASM_START
-        hlt
-ASM_END
-      }
-    }
-ASM_START
-    cli
-ASM_END
-    printf("\n\n");
-    return;
+    mov cx, #0x01c9
+    mov dx, #0xc380
+    mov ah, #0x86   ;; INT 15/86: wait CX:DX usec.
+    int #0x15
+ASM_END
+    bios_printf(BIOS_PRINTF_HALT, "");
   }
 
   /* Translate from CMOS runes to an IPL table offset by subtracting 1 */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-07  9:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-06 13:59 [PATCH] rombios: pause for a keypress after a failed boot Tim Deegan
2010-07-07  1:43 ` [PATCH] rombios: pause for a keypress after a failedboot James Harper
2010-07-07  6:26   ` Keir Fraser
2010-07-07  6:29     ` James Harper
2010-07-07  6:36       ` Keir Fraser
2010-07-07  9:49     ` Tim Deegan

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).