[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v2 11/18] Toolstack: Refactor migration support check.



Not implemented for libvirt (the check itself that is, the hook is present).

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.