Signed-off-by: Chris Evich <[email protected]>
---
 client/tests/libvirt/tests/virsh_migrate.py |    6 ++++--
 client/virt/libvirt_vm.py                   |    4 +++-
 client/virt/subtests.cfg.sample             |   13 ++++++++-----
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/client/tests/libvirt/tests/virsh_migrate.py 
b/client/tests/libvirt/tests/virsh_migrate.py
index f58a055..8c6ff9e 100644
--- a/client/tests/libvirt/tests/virsh_migrate.py
+++ b/client/tests/libvirt/tests/virsh_migrate.py
@@ -1,4 +1,4 @@
-import re, os, logging, commands, shutil
+import re, os, logging, commands, shutil, time
 from autotest_lib.client.common_lib import utils, error
 from autotest_lib.client.virt import virt_vm, virt_utils, virt_env_process
 
@@ -14,10 +14,12 @@ def run_virsh_migrate(test, params, env):
     extra = params.get("virsh_migrate_extra")
     destuser = params.get("virsh_migrate_destuser", "root")
     destpwd = params.get("virsh_migrate_destpwd", "")
+    dly = int(params.get("virsh_migrate_delay", 10))
 
     vm = env.get_vm(params["main_vm"])
     vm.verify_alive()
-
+    logging.info("Sleeping %d seconds before migration" % dly)
+    time.sleep(dly)
     # Migrate the guest.
     successful = vm.migrate(dest_host, protocol, options, extra)
     if not successful:
diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index 039c83a..bda07fa 100644
--- a/client/virt/libvirt_vm.py
+++ b/client/virt/libvirt_vm.py
@@ -316,7 +316,7 @@ def virsh_migrate(migrate_cmd, uri = ""):
     logging.debug("Mirating VM with command: virsh %s" % migrate_cmd)
     try:
         virsh_cmd(migrate_cmd, uri)
-    except error.CmdError, defail:
+    except error.CmdError, detail:
         logging.warning("Migration error: %s" % (detail))
         return False
     return True
@@ -1027,6 +1027,8 @@ class VM(virt_vm.BaseVM):
         """
         migrate_cmd = "%s %s %s %s" % (options, self.name,
                 protocol+"://"+dest_host+"/system", extra)
+        logging.info("Migrating VM %s from %s to %s" %\
+                    (self.name, self.connect_uri, dest_host))
         return virsh_migrate(migrate_cmd, self.connect_uri)
 
 
diff --git a/client/virt/subtests.cfg.sample b/client/virt/subtests.cfg.sample
index a098aac..6cdb72f 100644
--- a/client/virt/subtests.cfg.sample
+++ b/client/virt/subtests.cfg.sample
@@ -325,16 +325,12 @@ variants:
 
     - virsh_migrate: install setup image_copy unattended_install.cdrom
         type = virsh_migrate
-        # Default parameters presume hosts are using shared storage (SAN)
-        # and the path to storage on both hosts is exactly the same
         # Migrating non-started VM causes undefined behavior
         start_vm = yes
         # Options to pass to virsh migrate command before <domain> <desturi>
-        # such as --copy-storage-all, --change-protection, --verbose, etc.
         virsh_migrate_options = "--live --undefinesource --persistent"
         # Extra options to pass after <domain> <desturi>
-        # not are normally not needed unless your doing --p2p
-        virsh_migrate_extra = ""
+        virsh_migrate_extra = "--timeout 60"
         # Migration protocol to use (qemu+ssh uses root+pubkey auth)
         virsh_migrate_proto = qemu+ssh
         # Hostname part of <desturi>
@@ -343,6 +339,13 @@ variants:
         # FIXME: Impliment libvirt URI connect user/password
         # virsh_migrate_destuser = root
         # virsh_migrate_destpwd = ""
+        variants:
+            - there:
+                virsh_migrate_delay = 60
+                virsh_migrate_desthost = 
DESTINADDTION_HOSTNAME_OR_IP.example.com
+            - back: there
+                virsh_migrate_delay = 10
+                virsh_migrate_desthost = SOURCE_HOSTNAME_OR_IP.example.com
 
     - migrate: install setup image_copy unattended_install.cdrom
         type = migration
-- 
1.7.1

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to