[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH]xen/acpi: make poweroff really work for pv-ops dom0


  • To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
  • From: "Wei, Gang" <gang.wei@xxxxxxxxx>
  • Date: Tue, 24 Nov 2009 09:33:12 +0800
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 23 Nov 2009 17:33:54 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcpsphXx20TnjThTSxKPEYH7dFf6jQ==
  • Thread-topic: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0

xen/acpi: Make poweroff really work for pv-ops dom0

sched_op(SHUTDOWN_poweroff) hypercall will only halt all physical cpus without
really poweroff the system. Use pm_power_off fn to achieve it.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index ecb9b0d..d9fd3f4 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1058,6 +1058,14 @@ static void xen_machine_halt(void)
        xen_reboot(SHUTDOWN_poweroff);
 }
 
+static void xen_machine_power_off(void)
+{
+       if (pm_power_off) 
+               pm_power_off();
+       else
+               xen_reboot(SHUTDOWN_poweroff);
+}
+
 static void xen_crash_shutdown(struct pt_regs *regs)
 {
        xen_reboot(SHUTDOWN_crash);
@@ -1066,7 +1074,7 @@ static void xen_crash_shutdown(struct pt_regs *regs)
 static const struct machine_ops __initdata xen_machine_ops = {
        .restart = xen_restart,
        .halt = xen_machine_halt,
-       .power_off = xen_machine_halt,
+       .power_off = xen_machine_power_off,
        .shutdown = xen_machine_halt,
        .crash_shutdown = xen_crash_shutdown,
        .emergency_restart = xen_emergency_restart,

Attachment: pvops-dom0-poweroff-fix.patch
Description: pvops-dom0-poweroff-fix.patch

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.