diff options
author | Kevin Wolf <kwolf@redhat.com> | 2014-04-17 13:27:05 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-04-22 12:00:28 +0200 |
commit | f2d953ec31eeeb3029ca915a55938c538a14efa8 (patch) | |
tree | cdf3f33ebe91969f843d784e03c798ef80d6fad8 /tests/qemu-iotests/087 | |
parent | 9ffe333276de8ef463896303fb951f03fd4ffcb4 (diff) |
block: Catch duplicate IDs in bdrv_new()
Since commit f298d071, block devices added with blockdev-add don't have
a QemuOpts around in dinfo->opts. Consequently, we can't rely any more
on QemuOpts catching duplicate IDs for block devices.
This patch adds a new check for duplicate IDs to bdrv_new(), and moves
the existing check that the ID isn't already taken for a node-name there
as well.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/087')
-rwxr-xr-x | tests/qemu-iotests/087 | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087 index a38bb702b3..37d82fcdcd 100755 --- a/tests/qemu-iotests/087 +++ b/tests/qemu-iotests/087 @@ -73,6 +73,39 @@ run_qemu <<EOF EOF echo +echo === Duplicate ID === +echo + +run_qemu <<EOF +{ "execute": "qmp_capabilities" } +{ "execute": "blockdev-add", + "arguments": { + "options": { + "driver": "$IMGFMT", + "id": "disk", + "file": { + "driver": "file", + "filename": "$TEST_IMG" + } + } + } + } +{ "execute": "blockdev-add", + "arguments": { + "options": { + "driver": "$IMGFMT", + "id": "disk", + "file": { + "driver": "file", + "filename": "$TEST_IMG" + } + } + } + } +{ "execute": "quit" } +EOF + +echo echo === aio=native without O_DIRECT === echo |