qemu-iotests/067: Avoid blockdev-add with id

We want to remove the 'id' option for blockdev-add. This removes one
user of the option and makes it use only node names.

In order to keep the test meaningful, some instances of query-block that
want to check whether the node still exists and would now turn up empty
must be converted to query-named-block-nodes (which also return the
protocol level node, but that shouldn't hurt).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Kevin Wolf 2016-09-21 14:56:01 +02:00
parent 476fb028bf
commit 522ce4ecd4
2 changed files with 131 additions and 86 deletions

View File

@ -121,7 +121,7 @@ run_qemu <<EOF
"arguments": { "arguments": {
"options": { "options": {
"driver": "$IMGFMT", "driver": "$IMGFMT",
"id": "disk", "node-name": "disk",
"file": { "file": {
"driver": "file", "driver": "file",
"filename": "$TEST_IMG" "filename": "$TEST_IMG"
@ -129,13 +129,13 @@ run_qemu <<EOF
} }
} }
} }
{ "execute": "query-block" } { "execute": "query-named-block-nodes" }
{ "execute": "device_add", { "execute": "device_add",
"arguments": { "driver": "virtio-blk", "drive": "disk", "arguments": { "driver": "virtio-blk", "drive": "disk",
"id": "virtio0" } } "id": "virtio0" } }
{ "execute": "device_del", "arguments": { "id": "virtio0" } } { "execute": "device_del", "arguments": { "id": "virtio0" } }
{ "execute": "system_reset" } { "execute": "system_reset" }
{ "execute": "query-block" } { "execute": "query-named-block-nodes" }
{ "execute": "quit" } { "execute": "quit" }
EOF EOF

View File

@ -258,49 +258,72 @@ Testing:
{ {
"return": [ "return": [
{ {
"device": "disk", "iops_rd": 0,
"locked": false, "detect_zeroes": "off",
"removable": true, "image": {
"inserted": { "virtual-size": 134217728,
"iops_rd": 0, "filename": "TEST_DIR/t.qcow2",
"detect_zeroes": "off", "cluster-size": 65536,
"image": { "format": "qcow2",
"virtual-size": 134217728, "actual-size": SIZE,
"filename": "TEST_DIR/t.qcow2", "format-specific": {
"cluster-size": 65536, "type": "qcow2",
"format": "qcow2", "data": {
"actual-size": SIZE, "compat": "1.1",
"format-specific": { "lazy-refcounts": false,
"type": "qcow2", "refcount-bits": 16,
"data": { "corrupt": false
"compat": "1.1", }
"lazy-refcounts": false,
"refcount-bits": 16,
"corrupt": false
}
},
"dirty-flag": false
}, },
"iops_wr": 0, "dirty-flag": false
"ro": false,
"node-name": "NODE_NAME",
"backing_file_depth": 0,
"drv": "qcow2",
"iops": 0,
"bps_wr": 0,
"write_threshold": 0,
"encrypted": false,
"bps": 0,
"bps_rd": 0,
"cache": {
"no-flush": false,
"direct": false,
"writeback": true
},
"file": "TEST_DIR/t.qcow2",
"encryption_key_missing": false
}, },
"type": "unknown" "iops_wr": 0,
"ro": false,
"node-name": "disk",
"backing_file_depth": 0,
"drv": "qcow2",
"iops": 0,
"bps_wr": 0,
"write_threshold": 0,
"encrypted": false,
"bps": 0,
"bps_rd": 0,
"cache": {
"no-flush": false,
"direct": false,
"writeback": true
},
"file": "TEST_DIR/t.qcow2",
"encryption_key_missing": false
},
{
"iops_rd": 0,
"detect_zeroes": "off",
"image": {
"virtual-size": 197120,
"filename": "TEST_DIR/t.qcow2",
"format": "file",
"actual-size": SIZE,
"dirty-flag": false
},
"iops_wr": 0,
"ro": false,
"node-name": "NODE_NAME",
"backing_file_depth": 0,
"drv": "file",
"iops": 0,
"bps_wr": 0,
"write_threshold": 0,
"encrypted": false,
"bps": 0,
"bps_rd": 0,
"cache": {
"no-flush": false,
"direct": false,
"writeback": true
},
"file": "TEST_DIR/t.qcow2",
"encryption_key_missing": false
} }
] ]
} }
@ -319,50 +342,72 @@ Testing:
{ {
"return": [ "return": [
{ {
"io-status": "ok", "iops_rd": 0,
"device": "disk", "detect_zeroes": "off",
"locked": false, "image": {
"removable": true, "virtual-size": 134217728,
"inserted": { "filename": "TEST_DIR/t.qcow2",
"iops_rd": 0, "cluster-size": 65536,
"detect_zeroes": "off", "format": "qcow2",
"image": { "actual-size": SIZE,
"virtual-size": 134217728, "format-specific": {
"filename": "TEST_DIR/t.qcow2", "type": "qcow2",
"cluster-size": 65536, "data": {
"format": "qcow2", "compat": "1.1",
"actual-size": SIZE, "lazy-refcounts": false,
"format-specific": { "refcount-bits": 16,
"type": "qcow2", "corrupt": false
"data": { }
"compat": "1.1",
"lazy-refcounts": false,
"refcount-bits": 16,
"corrupt": false
}
},
"dirty-flag": false
}, },
"iops_wr": 0, "dirty-flag": false
"ro": false,
"node-name": "NODE_NAME",
"backing_file_depth": 0,
"drv": "qcow2",
"iops": 0,
"bps_wr": 0,
"write_threshold": 0,
"encrypted": false,
"bps": 0,
"bps_rd": 0,
"cache": {
"no-flush": false,
"direct": false,
"writeback": true
},
"file": "TEST_DIR/t.qcow2",
"encryption_key_missing": false
}, },
"type": "unknown" "iops_wr": 0,
"ro": false,
"node-name": "disk",
"backing_file_depth": 0,
"drv": "qcow2",
"iops": 0,
"bps_wr": 0,
"write_threshold": 0,
"encrypted": false,
"bps": 0,
"bps_rd": 0,
"cache": {
"no-flush": false,
"direct": false,
"writeback": true
},
"file": "TEST_DIR/t.qcow2",
"encryption_key_missing": false
},
{
"iops_rd": 0,
"detect_zeroes": "off",
"image": {
"virtual-size": 197120,
"filename": "TEST_DIR/t.qcow2",
"format": "file",
"actual-size": SIZE,
"dirty-flag": false
},
"iops_wr": 0,
"ro": false,
"node-name": "NODE_NAME",
"backing_file_depth": 0,
"drv": "file",
"iops": 0,
"bps_wr": 0,
"write_threshold": 0,
"encrypted": false,
"bps": 0,
"bps_rd": 0,
"cache": {
"no-flush": false,
"direct": false,
"writeback": true
},
"file": "TEST_DIR/t.qcow2",
"encryption_key_missing": false
} }
] ]
} }