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/
Home Products Support Community News


Re: [Xen-devel] [RFC][PATCH] allow dom0 to power off machine using ACPI

To: Muli Ben-Yehuda <mulix@xxxxxxxxx>
Subject: Re: [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:58:50 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 06 Apr 2006 11:58:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060406184602.GB20687@xxxxxxxxxxxxxxxxxxx>
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>
References: <1144348570.7725.9.camel@xxxxxxxxxxxxxxxxxxxxx> <20060406184602.GB20687@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2006-04-06 at 21:46 +0300, Muli Ben-Yehuda wrote:
> On Thu, Apr 06, 2006 at 07:36:10PM +0100, Harry Butterworth wrote:
> > 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 wonder why we go to the hypervisor for shutdown at the moment.

The kernel is for both dom0 and domU.  I think in the domU case the
hypervisor call is the correct mechanism to power off the virtual

> I
> don't see anything interesting being done for x86, and we could always
> have dom0 notifying Xen that it's going to shut down, and then
> shutting down whe the hypercall return.

This might be better for dom0 but currently I don't think the hypervisor
returns from the call in the dom0 case.  Not sure about that though.

> > I thought this kind of solution was better than trying to import a lot
> > more ACPI cruft into Xen.  Any thoughts?
> I think you want kernel_power_off() here, which should do the right
> thing for all architectures.

No. kernel_power_off is currently already being called and doesn't work
because it calls machine_power_off which in current unstable calls the
hypervisor which doesn't power off the hardware.

My patch modifies machine_power_off to call the native pm power off if
present (i.e. if dom0) or the hypervisor if not (i.e. domU).

> Cheers,
> Muli

Xen-devel mailing list