未验证 提交 9a87dce9 编写于 作者: Q Qianqian Zhu 提交者: GitHub

Merge pull request #1881 from nanliu-r/virtio_port_hotplug

virtio_port_hotplug:fix unfriendly error info
......@@ -42,7 +42,10 @@ def run(test, params, env):
if not virtio_port:
test.fail("Virtio Port '%s' not found" % port)
chardev_qid = virtio_port.get_param("chardev")
port_chardev = vm.devices.get_by_qid(chardev_qid)[0]
try:
port_chardev = vm.devices.get_by_qid(chardev_qid)[0]
except IndexError:
test.error("Failed to get device %s" % chardev_qid)
if module:
error_context.context("Unload module %s" % module,
logging.info)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册