]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Toolstack: Refactor shutdown support
authorIan Campbell <ian.campbell@citrix.com>
Mon, 16 Jun 2014 16:48:57 +0000 (17:48 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 30 Jan 2015 08:05:53 +0000 (08:05 +0000)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Toolstack/libvirt.pm
Osstest/Toolstack/xl.pm
ts-guest-stop

index fb9b9a9f27e3823ba87ae07142aeed7b8cba5856..7f4180e59d183e78183cb251c8b4ac188c7e0546 100644 (file)
@@ -57,4 +57,10 @@ sub consolecmd ($$) {
     return "virsh console $gn";
 }
 
+sub shutdown_wait ($$$) {
+    my ($self,$gho,$timeout) = @_;
+    my $gn = $gho->{Name};
+    die "libvirt shutdown wait not implemented yet."
+}
+
 1;
index 49977755d1d79da4237c7813c753eef831a11d99..f0c15fb37f2530943ceb29d4acf92d710be92b30 100644 (file)
@@ -51,4 +51,11 @@ sub consolecmd ($$) {
     return $self->{Command}." console $gn";
 }
 
+sub shutdown_wait ($$$) {
+    my ($self,$gho,$timeout) = @_;
+    my $ho = $self->{Host};
+    my $gn = $gho->{Name};
+    target_cmd_root($ho,"$self->{Command} shutdown -w $gn", $timeout);
+}
+
 1;
index 0e3a863b87ba15ed97f8a368bb0fa6af4690c572..378f334312d6ab16b9275e5194ffc124ee632acf 100755 (executable)
@@ -26,10 +26,7 @@ our ($ho,$gho) = ts_get_host_guest(@ARGV);
 
 sub stop () {
     guest_checkrunning($ho, $gho) or die "$gho->{Name} not running";
-    target_cmd_root($ho,
-                   toolstack($ho)->{Command}
-                   ." shutdown -w "
-                   .$gho->{Name}, 200);
+    toolstack($ho)->shutdown_wait($gho, 200);
     guest_checkrunning($ho, $gho) and die $gho->{Name};
 }