Signed-off-by: Ian Campbell <ian.campb...@citrix.com> --- v3: Timeout is set in the caller, not the method handler. "Different guests might take different times to shut down - but different toolstacks shouldn't." --- Osstest/Toolstack/libvirt.pm | 6 ++++++ Osstest/Toolstack/xl.pm | 7 +++++++ ts-guest-stop | 5 +---- 3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm index fb9b9a9..7f4180e 100644 --- a/Osstest/Toolstack/libvirt.pm +++ b/Osstest/Toolstack/libvirt.pm @@ -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; diff --git a/Osstest/Toolstack/xl.pm b/Osstest/Toolstack/xl.pm index 4997775..f0c15fb 100644 --- a/Osstest/Toolstack/xl.pm +++ b/Osstest/Toolstack/xl.pm @@ -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; diff --git a/ts-guest-stop b/ts-guest-stop index 0e3a863..378f334 100755 --- a/ts-guest-stop +++ b/ts-guest-stop @@ -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}; } -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel