From: Harry Butterworth <harry@hebutterworth.freeserve.co.uk>
To: xen-devel@lists.xensource.com, niv@us.ibm.com
Subject: [RFC][PATCH] allow dom0 to power off machine using ACPI on shutdown.
Date: Thu, 06 Apr 2006 19:36:10 +0100 [thread overview]
Message-ID: <1144348570.7725.9.camel@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]
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@uk.ibm.com>
# HG changeset patch
# User harry@localhost.localdomain
# 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 #2: poweroff.patch --]
[-- Type: text/x-patch, Size: 756 bytes --]
# HG changeset patch
# User harry@localhost.localdomain
# 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 #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-04-06 18:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-06 18:36 Harry Butterworth [this message]
2006-04-06 18:46 ` [RFC][PATCH] allow dom0 to power off machine using ACPI on shutdown Muli Ben-Yehuda
2006-04-06 18:58 ` Harry Butterworth
2006-04-06 19:06 ` Muli Ben-Yehuda
2006-04-06 21:22 ` Harry Butterworth
2006-04-07 7:27 ` Keir Fraser
2006-04-07 16:28 ` Muli Ben-Yehuda
2006-04-07 6:56 ` Tristan Gingold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1144348570.7725.9.camel@localhost.localdomain \
--to=harry@hebutterworth.freeserve.co.uk \
--cc=niv@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.