ia64/xen-unstable

changeset 1783:8f75eee1c448

bitkeeper revision 1.1083 (40f54b0a40pzYjUMzMokIXYQ7fyBgA)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Wed Jul 14 15:02:34 2004 +0000 (2004-07-14)
parents 3bca70370d6e f61925935170
children bdafa1768678
files linux-2.4.26-xen-sparse/arch/xen/kernel/process.c tools/examples/init.d/xend xen/arch/x86/domain.c xen/common/domain.c
line diff
     1.1 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c	Wed Jul 14 14:26:03 2004 +0000
     1.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c	Wed Jul 14 15:02:34 2004 +0000
     1.3 @@ -125,14 +125,7 @@ void machine_restart(char *__unused)
     1.4  
     1.5  void machine_halt(void)
     1.6  {
     1.7 -    /* We really want to get pending console data out before we die. */
     1.8 -    extern void xencons_force_flush(void);
     1.9 -    xencons_force_flush();
    1.10 -    for ( ; ; ) /* loop without wasting cpu cycles */
    1.11 -    {
    1.12 -        HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_pending = 0;
    1.13 -        HYPERVISOR_block();
    1.14 -    }
    1.15 +    machine_power_off();
    1.16  }
    1.17  
    1.18  void machine_power_off(void)
     2.1 --- a/tools/examples/init.d/xend	Wed Jul 14 14:26:03 2004 +0000
     2.2 +++ b/tools/examples/init.d/xend	Wed Jul 14 15:02:34 2004 +0000
     2.3 @@ -7,7 +7,7 @@
     2.4  # chkconfig: 2345 99 00
     2.5  # description: Starts and stops the Xen control daemon.
     2.6  
     2.7 -. /etc/init.d/functions || . /etc/init.d/functions.sh
     2.8 +[ -f /etc/init.d/functions ] && . /etc/init.d/functions || . /etc/init.d/functions.sh
     2.9  
    2.10  case "$1" in
    2.11    start)
     3.1 --- a/xen/arch/x86/domain.c	Wed Jul 14 14:26:03 2004 +0000
     3.2 +++ b/xen/arch/x86/domain.c	Wed Jul 14 15:02:34 2004 +0000
     3.3 @@ -199,12 +199,7 @@ void machine_restart(char * __unused)
     3.4  
     3.5  void machine_halt(void)
     3.6  {
     3.7 -    machine_restart(0);
     3.8 -}
     3.9 -
    3.10 -void machine_power_off(void)
    3.11 -{
    3.12 -    machine_restart(0);
    3.13 +    while(1){ safe_halt(); }
    3.14  }
    3.15  
    3.16  void arch_do_createdomain(struct domain *d)
     4.1 --- a/xen/common/domain.c	Wed Jul 14 14:26:03 2004 +0000
     4.2 +++ b/xen/common/domain.c	Wed Jul 14 15:02:34 2004 +0000
     4.3 @@ -170,8 +170,18 @@ void domain_shutdown(u8 reason)
     4.4      if ( current->domain == 0 )
     4.5      {
     4.6          extern void machine_restart(char *);
     4.7 -        printk("Domain 0 shutdown: rebooting machine!\n");
     4.8 -        machine_restart(0);
     4.9 +        extern void machine_halt(void);
    4.10 +
    4.11 +        if ( reason == 0 ) 
    4.12 +        {
    4.13 +            printk("Domain 0 halted: Our work here is done.\n");
    4.14 +            machine_halt();
    4.15 +        }
    4.16 +        else
    4.17 +        {
    4.18 +            printk("Domain 0 shutdown: rebooting machine!\n");
    4.19 +            machine_restart(0);
    4.20 +        }
    4.21      }
    4.22  
    4.23      current->shutdown_code = reason;