diff mbox

[1/4] KVM test: Include the preprocessing param migration_mode

Message ID 1291171977-14327-1-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Dec. 1, 2010, 2:52 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py
index 5ec38fb..d2f94cd 100644
--- a/client/tests/kvm/kvm_preprocessing.py
+++ b/client/tests/kvm/kvm_preprocessing.py
@@ -60,6 +60,8 @@  def preprocess_vm(test, params, env, name):
 
     start_vm = False
 
+    migration_mode = params.get("migration_mode", None)
+
     if params.get("restart_vm") == "yes":
         logging.debug("'restart_vm' specified; (re)starting VM...")
         start_vm = True
@@ -72,11 +74,19 @@  def preprocess_vm(test, params, env, name):
             logging.debug("VM's qemu command differs from requested one; "
                           "restarting it...")
             start_vm = True
+    elif migration_mode is not None:
+        logging.debug("Starting VM on migration incoming mode...")
+        start_vm = True
 
     if start_vm:
-        # Start the VM (or restart it if it's already up)
-        if not vm.create(name, params, test.bindir):
-            raise error.TestError("Could not start VM")
+        if migration_mode is not None:
+            if not vm.create(name, params, test.bindir,
+                             migration_mode=migration_mode):
+                raise error.TestError("Could not start VM for migration")
+        else:
+            # Start the VM (or restart it if it's already up)
+            if not vm.create(name, params, test.bindir):
+                raise error.TestError("Could not start VM")
     else:
         # Don't start the VM, just update its params
         vm.params = params