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] Re: [PATCH]xen/acpi: make poweroff really work for pv-ops do

To: "Wei, Gang" <gang.wei@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 24 Nov 2009 11:32:52 -0800
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 24 Nov 2009 11:33:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <8FED46E8A9CA574792FC7AACAC38FE7714FEC8776E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <8FED46E8A9CA574792FC7AACAC38FE7714FEC8776E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4
On 11/23/09 17:33, Wei, Gang wrote:
> 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.
>   

It seems unfortunate that Xen can't actually implement SHUTDOWN_poweroff
in a manner that the name suggests ;)  But it can't because it may need
to interpret _SST to do it...

Thanks,
    J

> 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,


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