From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: Early ACPI events prevent subsequent ACPI functionality on xen 4.3 + HVM domU Date: Thu, 27 Jun 2013 15:04:58 +0100 Message-ID: <51CC468A.7030401@eu.citrix.com> References: <752956577.8634488.1368537190555.JavaMail.root@zimbra002> <1368812151.24012.66.camel@hastur.hellion.org.uk> <71194FD00ABB7415DD6106AA@nimrod.local> <090E19BC911ECE1F10940F48@Ximines.local> <519B9154.2090709@eu.citrix.com> <8AFE377F6BC64692CB48563B@Ximines.local> <519B9C3D.5030508@eu.citrix.com> <354054502.20130521193131@eikelenboom.it> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <354054502.20130521193131@eikelenboom.it> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Sander Eikelenboom Cc: Ian Campbell , xen-devel@lists.xen.org, Stefano Stabellini , Alex Bligh , Anthony Perard , Diana Crisan List-Id: xen-devel@lists.xenproject.org On 21/05/13 18:31, Sander Eikelenboom wrote: > Tuesday, May 21, 2013, 6:09:33 PM, you wrote: > >> On 05/21/2013 04:59 PM, Alex Bligh wrote: >>> George, >>> >>> --On 21 May 2013 16:23:00 +0100 George Dunlap >>> wrote: >>> >>>> On 05/21/2013 04:16 PM, Alex Bligh wrote: >>>>> George, >>>>> >>>>> --On 21 May 2013 14:39:55 +0100 George Dunlap >>>>> wrote: >>>>> >>>>>> So this appears to be an xl toolstack thing. I managed to reproduce >>>>>> your results using "xl shutdown -F [domain]"; but if you then do "xl >>>>>> trigger [domian] power", the domain shuts down as normal. >>>>> OK. But doesn't the power thing yank the power rather than send a >>>>> clean shutdown? >>>> No -- if you push the button just once on most modern hardware it will >>>> send an ACPI "poweroff" event that the OS handles gracefully. That's >>>> what gets sent when you do "xl trigger [domain] power". If the OS >>>> ignores it (either on real hardware or virtual hardware) nothing happens. >>>> On real hardware you have to then hold down the button for 5 seconds for >>>> a hard-shutdown, with xl you have to do "xl destroy". >>> OK, great. I am guessing the reason why 'xl shutdown' doesn't do >>> that is to cope with (a) non-HVM domains, and (b) old fashioned >>> HVM domains with PV support but not ACPI support. Correct? >>> >>>>> We are using libxl here (admittedly having looked carefully at >>>>> the xl code for guidance) and get the same problem. >>>> The relevant xl code is here: >>>> >>>> rc=libxl_domain_shutdown(ctx, domid); >>>> if (rc == ERROR_NOPARAVIRT) { >>>> if (fallback_trigger) { >>>> fprintf(stderr, "PV control interface not available:" >>>> " sending ACPI power button event.\n"); >>>> rc = libxl_send_trigger(ctx, domid, LIBXL_TRIGGER_POWER, 0); >>>> } else { >>>> fprintf(stderr, "PV control interface not available:" >>>> " external graceful shutdown not possible.\n"); >>>> fprintf(stderr, "Use \"-F\" to fallback to ACPI power >>>> event.\n"); >>>> } >>>> } >>>> >>>> It looks like libxl_domain_shutdown() will only use the PV shutdown >>>> method. If that method is not available, then it will call >>>> libxl_send_trigger(). >>> OK. Well if that's the case, why is it not working? i.e. how >>> is using 'xl trigger power' a workaround? As our testing was >>> on xl (as well as libxl). Perhaps libxl_domain_shutdown >>> is returning an error other than ERROR_NOPARAVIRT or no error >>> at all? >> xl/libxl is working as designed. xl tried libxl_domain_shutdown() first. >> libxl saw that there were PV drivers available, so it sent the PV >> shutdown signal over xenstore and returned success. libxl and xl have >> no way of knowing that the signal was never received, so it never falls >> back to ACPI. > At a sidenote ... > > This reminds me that there still is the issue that a HVM domain without PV drivers doesn't shutdown properly with the standard init.d scripts. BTW, if you want this to get attention, you should probably either reply to that thread, or start a new thread. Starting a new topic on an unrelated thread is generally frowned upon. :-) -George