mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1071.1.7 (40f54af55pyLX7mn-IvUDb5re5ebeA)
In linux, make halt the same as poweroff. Xen now observes dom 0 exit code and halts if required.
This commit is contained in:
1 parent
0b5542b424
commit
90fd3bc022
3 files changed
+14
-16
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
+12
-2
@@ -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;
|
||||
|
||||