提交 aaf313d8 编写于 作者: N nanliu

virtio_port_hotplug:fix unfriendly error info

There is a unfriendly log when failed to
hotplug a port. It should give more specific
error info but no more like code error
Signed-off-by: NNana Liu <nanliu@redhat.com>
上级 2d071832
......@@ -67,7 +67,10 @@ def run(test, params, env):
if not virtio_port:
test.fail("Virtio Port named '%s' not found" % port_name)
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.
先完成此消息的编辑!
想要评论请 注册