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

Re: [Xen-devel] Early ACPI events prevent subsequent ACPI functionality on xen 4.3 + HVM domU



On Wed, May 22, 2013 at 10:43:01AM -0400, Konrad Rzeszutek Wilk wrote:
> On Wed, May 22, 2013 at 12:50:50PM +0100, George Dunlap wrote:
> > On 22/05/13 12:16, Alex Bligh wrote:
> > >George,
> > >
> > >--On 22 May 2013 11:55:03 +0100 George Dunlap
> > ><george.dunlap@xxxxxxxxxxxxx> wrote:
> > >
> > >>>I have tested both cases with Ubuntu.
> > >>>Sending the trigger is reliable if you wait for boot to fully complete.
> > >>>However, if I issue it during boot it does not get executed. Any
> > >>>subsequent triggers do not get executed as well until one is sent when
> > >>>the vm has fully booted.
> > >>
> > >>Right -- so what I hear you saying is, "ACPI commands issued before the
> > >>OS is paying attention are ignored."  I think that's expected behavior.
> > >>
> > >>I can see that "Shut this vm down as soon as possible" is a useful thing
> > >>to have. The problem at the moment guest OSes can ignore signals
> > >>sent too
> > >>early, it doesn't really seem within the scope of libxl to work around
> > >>that.
> > >
> > >I (now) think xl trigger power is working as well as could be expected.
> > >xl shutdown has a problem (in that an early use of this
> > >breaks later use), but we can avoid that by using xl trigger power
> > >(or rather the libxl equivalent). So we have a workaround for this one.
> > 
> > OK -- this will still be on our list of bugs to track, but as it's
> > probably a linux issue, it may take some time to filter back into
> > distributions.
> 
> There is an bug somewhere. I did this:
> 
> #xl create /pv.cfg && xl pause latest && xl shutdown latest
> #xenstore-ls | grep poweroff
>     shutdown = "poweroff"
> #xl unpause latest
> #xl console latest
> ...
> 
> and the guest continues on as if the change never happend and won't
> shutdown.

This patch should fix it.
From f53c1f691f726a9d72ad11be56f84389c3f3d7b0 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Wed, 6 Nov 2013 10:57:56 -0500
Subject: [PATCH] xen/manage: Poweroff forcefully if user-space is not yet up.

The user can launch the guest in this sequence:

xl create -p /vm.cfg    [launch, but pause it]
xl shutdown latest      [sets control/shutdown=poweroff]
xl unpause latest
xl console latest       [and see that the guest has completlty
ignored the shutdown request]

In reality the guest hasn't ignored it. It registers a watch
and gets a notification that there is value. It then calls
the shutdown_handler which ends up calling orderly_shutdown.

Unfortunately that is so early in the bootup that there
are no user-space. Which means that the orderly_shutdown fails.
But since the force flag was set to false it continues on without
reporting.

We check if the system is still in the booting stage and if so
enable the force option (which will shutdown in early bootup
process). If in normal running case we don't force it.

Fixes-Bug: http://bugs.xenproject.org/xen/bug/6
Reported-by:  Alex Bligh <alex@xxxxxxxxxxx>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 drivers/xen/manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 624e8dc..fe1c0a6 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -185,7 +185,7 @@ struct shutdown_handler {
 static void do_poweroff(void)
 {
        shutting_down = SHUTDOWN_POWEROFF;
-       orderly_poweroff(false);
+       orderly_poweroff(system_state != SYSTEM_RUNNING ? true : false);
 }
 
 static void do_reboot(void)
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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