All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, Jim Fehlig <jfehlig@suse.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [PATCH OSSTEST] Toolstack::xl: Support for ACPI fallback for shutdown
Date: Thu, 7 May 2015 11:11:56 +0100	[thread overview]
Message-ID: <1430993516.2660.358.camel@citrix.com> (raw)
In-Reply-To: <1430989624-21654-1-git-send-email-ian.campbell@citrix.com>

On Thu, 2015-05-07 at 10:07 +0100, Ian Campbell wrote:
> HVM guests which do not include PV drivers will not shutdown after a
> simple "xl shutdown". Add a runvar to indicate that the guest will
> shutdown in response to an ACPI power event and apply this to the win7
> and winxp test jobs.
> 
> Tested with:
>     test-amd64-amd64-xl-qemuu-winxpsp3
>     test-amd64-amd64-xl-qemuu-win7-amd64
>     test-amd64-amd64-xl-qemuu-debianhvm-amd64
>     test-amd64-amd64-xl
> 
> The first two correctly used the extra flag and the domains shutdown,
> the other two correctly didn't use the extra flag and still shutdown.
> Not currently implemented for libvirt, since we currently have no
> libvirt tests I could try it with.

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/sect-Managing_guest_virtual_machines_with_virsh-Shutting_down_rebooting_and_force_shutdown_of_a_guest_virtual_machine.html
suggests that virsh reboot can take a comma separated list for the
--mode option and will try them each in turn.

It doesn't say the same for virsh shutdown but it might be reasonable to
assume that this is a docs issue not a functionality one.

If that were the case then I think the below would do the trick, but as
I say I don't have an immediately convenient way to test, nor a need
since there are no such tests right now.

Ian.

diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm
index 8bd7f4f..e7f4860 100644
--- a/Osstest/Toolstack/libvirt.pm
+++ b/Osstest/Toolstack/libvirt.pm
@@ -60,7 +60,11 @@ sub shutdown_wait ($$$) {
     my ($self,$gho,$timeout) = @_;
     my $ho = $self->{Host};
     my $gn = $gho->{Name};
-    target_cmd_root($ho, "virsh shutdown $gn", 30);
+    my $mode = "paravirt";
+    $mode .= ",acpi"
+	if guest_var($gho,'acpi_shutdown','false') eq 'true';
+
+    target_cmd_root($ho, "virsh shutdown --mode $mode $gn", 30);
     guest_await_destroy($gho,$timeout);
 }

  reply	other threads:[~2015-05-07 10:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07  9:07 [PATCH OSSTEST] Toolstack::xl: Support for ACPI fallback for shutdown Ian Campbell
2015-05-07 10:11 ` Ian Campbell [this message]
2015-05-12 15:03   ` Ian Jackson
2015-05-12 15:19     ` Ian Campbell
2015-05-12 15:34       ` Ian Campbell
2015-05-12 20:36         ` Jim Fehlig
2015-05-13  8:35           ` Ian Campbell
2015-05-13 17:52             ` Jim Fehlig
2015-05-14 18:05         ` Ian Jackson
2015-05-12 15:02 ` Ian Jackson

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=1430993516.2660.358.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jfehlig@suse.com \
    --cc=xen-devel@lists.xen.org \
    /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.