]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
Toolstack::libvirt: Support for ACPI fallback for shutdown
authorIan Campbell <ian.campbell@citrix.com>
Thu, 7 May 2015 15:37:18 +0000 (16:37 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 14 May 2015 10:56:19 +0000 (11:56 +0100)
This is the libvirt counterpart to "Toolstack::xl: Support for ACPI
fallback for shutdown". Currently there are no jobs which test HVM
guests with libvirt and so this is completely untested in the context
of osstest (but at least should be harmless to current jobs).

This relies on an assumption that "virsh shutdown" behaves the same as
"virsh reboot" and accepts a comma separated list of methods to try
given to the --mode argument, which Jim has tested and confirmed to be
true.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jim Fehlig <jfehlig@suse.com>
Acked by: Jim Fehlig <jfehlig@suse.com>

Osstest/Toolstack/libvirt.pm

index 8bd7f4f69a4c5c68a2db5d3582c9f14f117b716c..e7f48607bf7c8066f237a35983241cd811828a78 100644 (file)
@@ -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);
 }