xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: ian.jackson@eu.citrix.com, Wei Liu <wei.liu2@citrix.com>,
	ian.campbell@citrix.com
Subject: [PATCH OSSTEST v2 04/13] toolstack: distinguish local and remote migration support
Date: Sun, 12 Jul 2015 17:20:27 +0100	[thread overview]
Message-ID: <1436718036-7985-5-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1436718036-7985-1-git-send-email-wei.liu2@citrix.com>

Libvirt supports migrating a guest to remote host but not local host.
Distinguish the concept of local migration support and remote migration
support.

Toolstack's migrate_check now takes an extra argument to indicate which
mode we're interested in.

In sg-run-job we still check for local migration support because that's
the implicit target in test-guest-migr. Libvirt will still be blocked.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: use bool instead of "local" "remote" string
---
 Osstest/Toolstack/libvirt.pm | 18 +++++++++++++++---
 Osstest/Toolstack/xend.pm    |  2 +-
 Osstest/Toolstack/xl.pm      |  4 ++--
 sg-run-job                   |  2 +-
 ts-migrate-support-check     |  6 +++++-
 5 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm
index 592cfa2..ddf84df 100644
--- a/Osstest/Toolstack/libvirt.pm
+++ b/Osstest/Toolstack/libvirt.pm
@@ -72,9 +72,21 @@ sub shutdown_wait ($$$) {
     guest_await_destroy($gho,$timeout);
 }
 
-sub migrate_check ($) {
-    my ($self) = @_;
-    die "Migration check is not yet supported on libvirt.";
+sub migrate_check ($$) {
+    my ($self, $local) = @_;
+    my $rc;
+
+    if ($local) {
+        # local migration is not supported
+        $rc = 1;
+    } else {
+	my $ho = $self->{Host};
+	my $caps = target_cmd_output_root($ho, "virsh capabilities");
+	$rc = ($caps =~ m/<migration_features>/) ? 0 : 1
+    }
+
+    logm("rc=$rc");
+    return $rc;
 }
 
 sub _libvirt_check_for_command($$) {
diff --git a/Osstest/Toolstack/xend.pm b/Osstest/Toolstack/xend.pm
index fd54ae1..b435938 100644
--- a/Osstest/Toolstack/xend.pm
+++ b/Osstest/Toolstack/xend.pm
@@ -36,7 +36,7 @@ sub new {
 }
 
 # xend always supported migration
-sub migrate_check ($) { return 0; }
+sub migrate_check ($$) { return 0; }
 
 # xend always supported save / restore
 sub saverestore_check ($) { return 0; }
diff --git a/Osstest/Toolstack/xl.pm b/Osstest/Toolstack/xl.pm
index 440d9d0..0c4aff8 100644
--- a/Osstest/Toolstack/xl.pm
+++ b/Osstest/Toolstack/xl.pm
@@ -70,8 +70,8 @@ sub _xl_check_for_command($$) {
     return $rc;
 }
 
-sub migrate_check ($) {
-    my ($self) = @_;
+sub migrate_check ($$) {
+    my ($self,$local) = @_;
     return _xl_check_for_command($self, "migrate");
 }
 
diff --git a/sg-run-job b/sg-run-job
index 61f88fb..16fcfc1 100755
--- a/sg-run-job
+++ b/sg-run-job
@@ -300,7 +300,7 @@ proc run-job/test-pair {} {
 }
 
 proc test-guest-migr {g} {
-    set to_reap [spawn-ts . = ts-migrate-support-check + host $g]
+    set to_reap [spawn-ts . = ts-migrate-support-check + host $g 1]
     set can_migrate [reap-ts $to_reap]
     if {!$can_migrate} return
 
diff --git a/ts-migrate-support-check b/ts-migrate-support-check
index cd41f68..f877c09 100755
--- a/ts-migrate-support-check
+++ b/ts-migrate-support-check
@@ -23,5 +23,9 @@ use Osstest::TestSupport;
 tsreadconfig();
 
 our $ho = selecthost($ARGV[0]);
+# $ARGV[1] is guest name, $ARG[2] indicates whether it is checking for
+# local migration or remote migration
+# Mode should be either 1 ("local") or 0 ("remote")
+our $mode = $ARGV[2];
 
-exit(toolstack($ho)->migrate_check());
+exit(toolstack($ho)->migrate_check($mode));
-- 
1.9.1

  parent reply	other threads:[~2015-07-12 16:20 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-12 16:20 [PATCH OSSTEST v2 00/13] Libvirt migration and HVM tests Wei Liu
2015-07-12 16:20 ` [PATCH OSSTEST v2 01/13] toolstack: save / restore check Wei Liu
2015-07-13 11:09   ` Ian Campbell
2015-07-12 16:20 ` [PATCH OSSTEST v2 02/13] Introduce ts-saverestore-support-check Wei Liu
2015-07-12 16:20 ` [PATCH OSSTEST v2 03/13] osstest migrate support check catch -> variables Wei Liu
2015-07-13 11:14   ` Ian Campbell
2015-07-21 16:32     ` Ian Jackson
2015-07-21 17:12       ` Wei Liu
2015-07-21 17:36         ` Ian Jackson
2015-07-22  9:44           ` Ian Campbell
2015-07-12 16:20 ` Wei Liu [this message]
2015-07-13 11:19   ` [PATCH OSSTEST v2 04/13] toolstack: distinguish local and remote migration support Ian Campbell
2015-07-12 16:20 ` [PATCH OSSTEST v2 05/13] sg-run-job: remove save/restore dependency on local " Wei Liu
2015-07-13 11:22   ` Ian Campbell
2015-07-12 16:20 ` [PATCH OSSTEST v2 06/13] toolstack/libvirt: guest migrate, save and restore support Wei Liu
2015-07-13 11:23   ` Ian Campbell
2015-07-21 16:17     ` Wei Liu
2015-07-12 16:20 ` [PATCH OSSTEST v2 07/13] ts-xen-build-prep: install ebtables Wei Liu
2015-07-12 16:20 ` [PATCH OSSTEST v2 08/13] ts-libvirt-build: run libvirt test suite Wei Liu
2015-07-13 11:25   ` Ian Campbell
2015-07-21 16:22     ` Wei Liu
2015-07-21 16:33       ` Ian Campbell
2015-07-12 16:20 ` [PATCH OSSTEST v2 09/13] ts-debian-hvm-install: stub out libvirt + ovmf / rombios Wei Liu
2015-07-13 11:27   ` Ian Campbell
2015-07-21 16:24     ` Wei Liu
2015-07-12 16:20 ` [PATCH OSSTEST v2 10/13] TestSupport: don't put kernel='hvmloader' in HVM config Wei Liu
2015-07-13 11:28   ` Ian Campbell
2015-07-13 11:34     ` Ian Campbell
2015-07-12 16:20 ` [PATCH OSSTEST v2 11/13] make-flight: debian hvm tests with libvirt Wei Liu
2015-07-13 11:33   ` Ian Campbell
2015-07-13 13:12     ` Wei Liu
2015-07-12 16:20 ` [PATCH OSSTEST v2 12/13] make-flight, mfi-common: rename onetoolstack to pairtoolstack Wei Liu
2015-07-12 16:20 ` [PATCH OSSTEST v2 13/13] make-flight, mfi-common: create live migration test for libvirt Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436718036-7985-5-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).