ia64/xen-unstable

view xen/common/shutdown.c @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 0c857419d354
children
line source
1 #include <xen/config.h>
2 #include <xen/init.h>
3 #include <xen/lib.h>
4 #include <xen/sched.h>
5 #include <xen/domain.h>
6 #include <xen/delay.h>
7 #include <xen/shutdown.h>
8 #include <asm/debugger.h>
9 #include <public/sched.h>
11 /* opt_noreboot: If true, machine will need manual reset on error. */
12 int opt_noreboot;
13 boolean_param("noreboot", opt_noreboot);
15 static void maybe_reboot(void)
16 {
17 if ( opt_noreboot )
18 {
19 printk("'noreboot' set - not rebooting.\n");
20 machine_halt();
21 }
22 else
23 {
24 printk("rebooting machine in 5 seconds.\n");
25 watchdog_disable();
26 machine_restart(5000);
27 }
28 }
30 void dom0_shutdown(u8 reason)
31 {
32 switch ( reason )
33 {
34 case SHUTDOWN_poweroff:
35 {
36 printk("Domain 0 halted: halting machine.\n");
37 machine_halt();
38 break; /* not reached */
39 }
41 case SHUTDOWN_crash:
42 {
43 debugger_trap_immediate();
44 printk("Domain 0 crashed: ");
45 maybe_reboot();
46 break; /* not reached */
47 }
49 case SHUTDOWN_reboot:
50 {
51 printk("Domain 0 shutdown: rebooting machine.\n");
52 machine_restart(0);
53 break; /* not reached */
54 }
56 default:
57 {
58 printk("Domain 0 shutdown (unknown reason %u): ", reason);
59 maybe_reboot();
60 break; /* not reached */
61 }
62 }
63 }