WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [RFC][PATCH] allow dom0 to power off machine using ACPI on s

To: xen-devel@xxxxxxxxxxxxxxxxxxx, niv@xxxxxxxxxx
Subject: [Xen-devel] [RFC][PATCH] allow dom0 to power off machine using ACPI on shutdown.
From: Harry Butterworth <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Apr 2006 19:36:10 +0100
Delivery-date: Thu, 06 Apr 2006 11:35:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This is an evil little patch which allows my dom0 to power off the
machine on shutdown successfully and doesn't break my domU shutdown
behaviour.

The #if bits are ugly and are present because pm_power_off is declared
above in the same #if context, maybe they are not necessary.  I'm not
sure about the solution for ia64.

This powers down the machine without bothering to tell the hypervisor.

I thought this kind of solution was better than trying to import a lot
more ACPI cruft into Xen.  Any thoughts?

Harry.

Signed-off-by: Harry Butterworth <butterwo@xxxxxxxxxx>

# HG changeset patch
# User harry@xxxxxxxxxxxxxxxxxxxxx
# Node ID 5c85b5dd3f8eda21cbcf529941dc41c72a7c6e09
# Parent  67de34c062b5897d1e82995b171be081f976558e
Allow a domain to call native pm_power_off if present. Fixes dom0
failure to power off on shutdown.

diff -r 67de34c062b5 -r 5c85b5dd3f8e
linux-2.6-xen-sparse/drivers/xen/core/reboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c    Thu Apr  6 11:03:53
2006
+++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c    Thu Apr  6 18:25:23
2006
@@ -59,6 +59,10 @@
 {
        /* We really want to get pending console data out before we die. */
        xencons_force_flush();
+#if defined(__i386__) || defined(__x86_64__)
+       if (pm_power_off)
+               pm_power_off();
+#endif
        HYPERVISOR_shutdown(SHUTDOWN_poweroff);
 }
 

Attachment: poweroff.patch
Description: Text Data

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