提交 2731e096 编写于 作者: C Chen Qun

qmp_command: add qmp 'node-name' expect value for blockdev

The disk device qemu command line has two configurations:
   1). blockdev config, eg:
       -blockdev node-name=file_image1,driver=file,filename=/var/**.qcow2
       -blockdev node-name=drive_image1,driver=qcow2,file=file_image1

   2). disk drive config, eg:
       -drive id=drive_image1,if=none,format=qcow2,file=/var/***.qcow2

If disk drive config, the expect value should be:
 {'device': 'drive_image1', 'qdev': 'image1', 'format': 'qcow2'}

If blockdev config, the expect value should be:
 {'node-name': 'drive_image1', 'qdev': 'image1', 'format': 'qcow2'}
Signed-off-by: NChen Qun <kuhn.chenqun@huawei.com>
上级 d1d0e310
......@@ -113,6 +113,9 @@ def run(test, params, env):
elif result_check == "contain":
for o in expect_o:
if isinstance(o, dict):
if 'device' in o and not check_list(qmp_o, 'device', o['device']):
o['node-name'] = o['device']
del o['device']
for key, val in o.items():
result = check_list(qmp_o, key, val)
if not result:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册