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>
die "libvirt shutdown wait not implemented yet."
}
+sub migrate_check ($) {
+ my ($self) = @_;
+ die "Migration check is not yet supported on libvirt.";
+}
+
1;
}, $class;
}
+# xend always supported migration
+sub migrate_check ($) { return 0; }
+
1;
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;
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());