From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 11/18] Toolstack: Refactor migration support check. Date: Tue, 2 Dec 2014 16:04:52 +0000 Message-ID: <1417536299-1810-11-git-send-email-ian.campbell@citrix.com> References: <1417536141.29004.6.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417536141.29004.6.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Jim Fehlig , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Not implemented for libvirt (the check itself that is, the hook is present). Signed-off-by: Ian Campbell --- Osstest/Toolstack/libvirt.pm | 5 +++++ Osstest/Toolstack/xend.pm | 3 +++ Osstest/Toolstack/xl.pm | 9 +++++++++ ts-migrate-support-check | 10 +--------- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm index d039c06..75e49d0 100644 --- a/Osstest/Toolstack/libvirt.pm +++ b/Osstest/Toolstack/libvirt.pm @@ -63,4 +63,9 @@ sub shutdown_wait ($$) { die "libvirt shutdown wait not implemented yet." } +sub migrate_check ($) { + my ($self) = @_; + die "Migration check is not yet supported on libvirt."; +} + 1; diff --git a/Osstest/Toolstack/xend.pm b/Osstest/Toolstack/xend.pm index d0e1113..e69bb1f 100644 --- a/Osstest/Toolstack/xend.pm +++ b/Osstest/Toolstack/xend.pm @@ -39,4 +39,7 @@ sub create { return &Osstest::Toolstack::xl::create; } sub consolecmd { return &Osstest::Toolstack::xl::consolecmd; } sub shutdown_wait { return &Osstest::Toolstack::xl::shutdown_wait; } +# xend always supported migration +sub migrate_check ($) { return 0; } + 1; diff --git a/Osstest/Toolstack/xl.pm b/Osstest/Toolstack/xl.pm index ce2456b..3c59da3 100644 --- a/Osstest/Toolstack/xl.pm +++ b/Osstest/Toolstack/xl.pm @@ -58,4 +58,13 @@ sub shutdown_wait ($$) { target_cmd_root($ho,"$self->{Command} shutdown -w $gn", 200); } +sub migrate_check ($) { + my ($self) = @_; + my $ho = $self->{Host}; + my $help = target_cmd_output_root($ho, $self->{Command}." help"); + my $rc = ($help =~ m/^\s*migrate/m) ? 0 : 1; + logm("rc=$rc"); + return $rc; +} + 1; diff --git a/ts-migrate-support-check b/ts-migrate-support-check index c70b77a..cd41f68 100755 --- a/ts-migrate-support-check +++ b/ts-migrate-support-check @@ -24,12 +24,4 @@ tsreadconfig(); our $ho = selecthost($ARGV[0]); -# all xend/xm platforms support migration -exit(0) if toolstack($ho)->{Command} eq "xm"; - -my $help = target_cmd_output_root($ho, toolstack($ho)->{Command}." help"); - -my $rc = ($help =~ m/^\s*migrate/m) ? 0 : 1; - -logm("rc=$rc"); -exit($rc); +exit(toolstack($ho)->migrate_check()); -- 2.1.1