提交 19c41729 编写于 作者: N Nini Gu

multi_disk_random_hotplug: Add codes to handle the hot_unplug error caused by...

multi_disk_random_hotplug: Add codes to handle the hot_unplug error caused by cmd '__com.redhat_drive_del'

1. Add codes to handle unplug error caused by cmd '__com.redhat_drive_del'
2. Change all monitors to QMP ones
3. Add sleep time between/after hotplugs/unplugs
Signed-off-by: NNini Gu <ngu@redhat.com>
上级 eb0de797
......@@ -7,11 +7,11 @@
stg_image_name = "images/stg%s"
stg_image_num = 20
repeat_times = 3
wait_between_hotplugs = 0
wait_after_hotplug = 3
wait_between_unplugs = 0
wait_between_hotplugs = 2
wait_after_hotplug = 10
wait_between_unplugs = 2
# since image check is executed after unplug wait can be 0
wait_after_unplug = 0
wait_after_unplug = 10
Linux:
# We have multiple disks so just ignor first one of each type
no_stress_cmds = 100
......@@ -37,8 +37,8 @@
- @serial:
- parallel:
multi_disk_type = parallel
monitors += " TestHMP1 TestHMP2 TestQMP1 TestQMP2"
monitor_type_TestHMP1 = human
monitor_type_TestHMP2 = human
monitors += " TestQMP1 TestQMP2 TestQMP3 TestQMP4"
monitor_type_TestQMP1 = qmp
monitor_type_TestQMP2 = qmp
monitor_type_TestQMP3 = qmp
monitor_type_TestQMP4 = qmp
......@@ -17,6 +17,7 @@ from virttest import utils_test
from virttest import env_process
from virttest.qemu_devices import utils
from virttest.remote import LoginTimeoutError
from virttest.qemu_monitor import MonitorError
# qdev is not thread safe so in case of dangerous ops lock this thread
......@@ -276,7 +277,20 @@ def run(test, params, env):
if device in qdev: # Some devices are removed with previous one
time.sleep(unplug_sleep)
unplug_devs.append(device)
unplug_outs.append(device.unplug(monitor))
try:
output = device.unplug(monitor)
except MonitorError:
# In new versions of qemu, to unplug a disk, cmd
# '__com.redhat_drive_del' is not necessary; while it's
# necessary in old qemu verisons. Following update is to
# pass the error caused by using the cmd in new
# qemu versions.
if device.get_qid() not in monitor.info("block",
debug=False):
pass
else:
raise
unplug_outs.append(output)
# Remove from qdev even when unplug failed because further in
# this test we compare VM with qdev, which should be without
# these devices. We can do this because we already set the VM
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册