diff --git a/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c b/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c index 6d80505743..56cabca2a9 100644 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c @@ -125,14 +125,7 @@ void machine_restart(char *__unused) void machine_halt(void) { - /* We really want to get pending console data out before we die. */ - extern void xencons_force_flush(void); - xencons_force_flush(); - for ( ; ; ) /* loop without wasting cpu cycles */ - { - HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_pending = 0; - HYPERVISOR_block(); - } + machine_power_off(); } void machine_power_off(void) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 83eea289aa..b07d44d677 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -199,12 +199,7 @@ void machine_restart(char * __unused) void machine_halt(void) { - machine_restart(0); -} - -void machine_power_off(void) -{ - machine_restart(0); + while(1){ safe_halt(); } } void arch_do_createdomain(struct domain *d) diff --git a/xen/common/domain.c b/xen/common/domain.c index a2b83768cd..7082f07bed 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -170,8 +170,18 @@ void domain_shutdown(u8 reason) if ( current->domain == 0 ) { extern void machine_restart(char *); - printk("Domain 0 shutdown: rebooting machine!\n"); - machine_restart(0); + extern void machine_halt(void); + + if ( reason == 0 ) + { + printk("Domain 0 halted: Our work here is done.\n"); + machine_halt(); + } + else + { + printk("Domain 0 shutdown: rebooting machine!\n"); + machine_restart(0); + } } current->shutdown_code = reason;