qemu-iotests/087: 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.

The test cases that test conflicts between the 'id' option to
blockdev-add and existing block devices or the 'node-name' of the same
command can be removed because it won't be possible to specify this at
the end of the series.

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:04 +02:00
parent 26d5fa10ff
commit 5feb08ed8f
2 changed files with 6 additions and 62 deletions

View File

@ -77,50 +77,12 @@ echo
echo === Duplicate ID === echo === Duplicate ID ===
echo echo
run_qemu <<EOF run_qemu -drive driver=$IMGFMT,id=disk,node-name=test-node,file="$TEST_IMG" <<EOF
{ "execute": "qmp_capabilities" } { "execute": "qmp_capabilities" }
{ "execute": "blockdev-add", { "execute": "blockdev-add",
"arguments": { "arguments": {
"options": { "options": {
"driver": "$IMGFMT", "driver": "$IMGFMT",
"id": "disk",
"node-name": "test-node",
"file": {
"driver": "file",
"filename": "$TEST_IMG"
}
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {
"driver": "$IMGFMT",
"id": "disk",
"file": {
"driver": "file",
"filename": "$TEST_IMG"
}
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {
"driver": "$IMGFMT",
"id": "test-node",
"file": {
"driver": "file",
"filename": "$TEST_IMG"
}
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {
"driver": "$IMGFMT",
"id": "disk2",
"node-name": "disk", "node-name": "disk",
"file": { "file": {
"driver": "file", "driver": "file",
@ -133,7 +95,6 @@ run_qemu <<EOF
"arguments": { "arguments": {
"options": { "options": {
"driver": "$IMGFMT", "driver": "$IMGFMT",
"id": "disk2",
"node-name": "test-node", "node-name": "test-node",
"file": { "file": {
"driver": "file", "driver": "file",
@ -142,19 +103,6 @@ run_qemu <<EOF
} }
} }
} }
{ "execute": "blockdev-add",
"arguments": {
"options": {
"driver": "$IMGFMT",
"id": "disk3",
"node-name": "disk3",
"file": {
"driver": "file",
"filename": "$TEST_IMG"
}
}
}
}
{ "execute": "quit" } { "execute": "quit" }
EOF EOF
@ -168,7 +116,7 @@ run_qemu <<EOF
"arguments": { "arguments": {
"options": { "options": {
"driver": "$IMGFMT", "driver": "$IMGFMT",
"id": "disk", "node-name": "disk",
"aio": "native", "aio": "native",
"file": { "file": {
"driver": "file", "driver": "file",
@ -191,7 +139,7 @@ run_qemu -S <<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"
@ -208,7 +156,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"
@ -229,7 +177,7 @@ run_qemu -S <<EOF
{ "execute": "blockdev-add", { "execute": "blockdev-add",
"arguments": { "arguments": {
"options": { "options": {
"id": "disk" "node-name": "disk"
} }
} }
} }

View File

@ -13,15 +13,11 @@ QMP_VERSION
=== Duplicate ID === === Duplicate ID ===
Testing: Testing: -drive driver=IMGFMT,id=disk,node-name=test-node,file=TEST_DIR/t.IMGFMT
QMP_VERSION QMP_VERSION
{"return": {}} {"return": {}}
{"return": {}}
{"error": {"class": "GenericError", "desc": "Device with id 'disk' already exists"}}
{"error": {"class": "GenericError", "desc": "Device name 'test-node' conflicts with an existing node name"}}
{"error": {"class": "GenericError", "desc": "node-name=disk is conflicting with a device id"}} {"error": {"class": "GenericError", "desc": "node-name=disk is conflicting with a device id"}}
{"error": {"class": "GenericError", "desc": "Duplicate node name"}} {"error": {"class": "GenericError", "desc": "Duplicate node name"}}
{"error": {"class": "GenericError", "desc": "Device name 'disk3' conflicts with an existing node name"}}
{"return": {}} {"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"}