]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Toolstack: Refactor migration support check.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 16 Jun 2014 16:41:38 +0000 (17:41 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 30 Jan 2015 08:05:53 +0000 (08:05 +0000)
Not implemented for libvirt (the check itself that is, the hook is
present).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Toolstack/libvirt.pm
Osstest/Toolstack/xend.pm
Osstest/Toolstack/xl.pm
ts-migrate-support-check

index 7f4180e59d183e78183cb251c8b4ac188c7e0546..b74c8cb10ea995c40c28bfd03eeb602ea13e4f7e 100644 (file)
@@ -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;
index 720bcc8d35a833b5f60f4c1fa0a7efb57fa06ac9..8e77a0536a9ef600f7ae19f97524d29f1abac21f 100644 (file)
@@ -35,4 +35,7 @@ sub new {
     }, $class;
 }
 
+# xend always supported migration
+sub migrate_check ($) { return 0; }
+
 1;
index f0c15fb37f2530943ceb29d4acf92d710be92b30..dcf3b08aea41dff9f6dba8800d2930b806071ee0 100644 (file)
@@ -58,4 +58,13 @@ sub shutdown_wait ($$$) {
     target_cmd_root($ho,"$self->{Command} shutdown -w $gn", $timeout);
 }
 
+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;
index c70b77a239f77887acf0c4f2c295f74b0e227a86..cd41f683415bbc78d2192cc2023a10dc9c762d78 100755 (executable)
@@ -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());