提交 6827ac3e 编写于 作者: Y Yiqiao Pu

Merge pull request #36 from FengYang/migrate

qemu.tests: Add env parameter for vm.migrate() function call.
...@@ -176,7 +176,7 @@ def run(test, params, env): ...@@ -176,7 +176,7 @@ def run(test, params, env):
vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay, vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay,
offline, check, offline, check,
migration_exec_cmd_src=mig_exec_cmd_src, migration_exec_cmd_src=mig_exec_cmd_src,
migration_exec_cmd_dst=mig_exec_cmd_dst) migration_exec_cmd_dst=mig_exec_cmd_dst, env=env)
# Set deamon thread action to stop after migrate # Set deamon thread action to stop after migrate
params["action"] = "stop" params["action"] = "stop"
......
...@@ -90,7 +90,7 @@ def run(test, params, env): ...@@ -90,7 +90,7 @@ def run(test, params, env):
set_link(nic_name, up=True) set_link(nic_name, up=True)
error.context("Migrate from source VM to Destination VM", logging.info) error.context("Migrate from source VM to Destination VM", logging.info)
vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay) vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay, env=env)
error.context("Disable the primary link", logging.info) error.context("Disable the primary link", logging.info)
set_link(nic_name, up=False) set_link(nic_name, up=False)
......
...@@ -360,7 +360,8 @@ def run(test, params, env): ...@@ -360,7 +360,8 @@ def run(test, params, env):
"-o hard,timeo=14,rsize=8192,wsize=8192") "-o hard,timeo=14,rsize=8192,wsize=8192")
vm_guest.migrate(mig_timeout, mig_protocol, vm_guest.migrate(mig_timeout, mig_protocol,
not_wait_for_migration=True, not_wait_for_migration=True,
migration_exec_cmd_src=migration_exec_cmd_src) migration_exec_cmd_src=migration_exec_cmd_src,
env=env)
if not utils_misc.wait_for(lambda: process_output_check( if not utils_misc.wait_for(lambda: process_output_check(
vm_guest.process, exp_str), vm_guest.process, exp_str),
...@@ -409,7 +410,8 @@ def run(test, params, env): ...@@ -409,7 +410,8 @@ def run(test, params, env):
vm_guest.migrate(mig_timeout, mig_protocol, vm_guest.migrate(mig_timeout, mig_protocol,
not_wait_for_migration=True, not_wait_for_migration=True,
migration_exec_cmd_src=migration_exec_cmd_src) migration_exec_cmd_src=migration_exec_cmd_src,
env=env)
if not utils_misc.wait_for(lambda: process_output_check( if not utils_misc.wait_for(lambda: process_output_check(
vm_guest.process, exp_str), vm_guest.process, exp_str),
...@@ -490,7 +492,7 @@ def run(test, params, env): ...@@ -490,7 +492,7 @@ def run(test, params, env):
self.restart_server() self.restart_server()
self.vm_guest.migrate(mig_timeout, mig_protocol) self.vm_guest.migrate(mig_timeout, mig_protocol, env=env)
try: try:
self.vm_guest.verify_alive() self.vm_guest.verify_alive()
......
...@@ -53,7 +53,8 @@ def run(test, params, env): ...@@ -53,7 +53,8 @@ def run(test, params, env):
vm.params["vhost"] = "vhost=off" vm.params["vhost"] = "vhost=off"
elif vhost_status == "vhost=off": elif vhost_status == "vhost=off":
vm.params["vhost"] = "vhost=on" vm.params["vhost"] = "vhost=on"
vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay) vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay,
env=env)
except Exception: except Exception:
# If something bad happened in the main thread, ignore # If something bad happened in the main thread, ignore
# exceptions raised in the background thread # exceptions raised in the background thread
......
...@@ -82,7 +82,7 @@ def run(test, params, env): ...@@ -82,7 +82,7 @@ def run(test, params, env):
m_count += 1 m_count += 1
error.context("Start migration iterations: %s " % m_count, error.context("Start migration iterations: %s " % m_count,
logging.info) logging.info)
vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay) vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay, env=env)
finally: finally:
netperf_server.stop() netperf_server.stop()
netperf_server.env_cleanup(True) netperf_server.env_cleanup(True)
......
...@@ -32,7 +32,8 @@ def run(test, params, env): ...@@ -32,7 +32,8 @@ def run(test, params, env):
bg.start() bg.start()
try: try:
while bg.isAlive(): while bg.isAlive():
vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay) vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay,
env=env)
except Exception: except Exception:
# If something bad happened in the main thread, ignore exceptions # If something bad happened in the main thread, ignore exceptions
# raised in the background thread # raised in the background thread
......
...@@ -96,7 +96,7 @@ def run(test, params, env): ...@@ -96,7 +96,7 @@ def run(test, params, env):
time.sleep(2) time.sleep(2)
clonevm = vm.migrate(mig_timeout, mig_protocol, clonevm = vm.migrate(mig_timeout, mig_protocol,
not_wait_for_migration=True) not_wait_for_migration=True, env=env)
mig_speed = utils.convert_data_size(mig_speed, "M") mig_speed = utils.convert_data_size(mig_speed, "M")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册