]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
block: Catch duplicate IDs in bdrv_new()
authorKevin Wolf <kwolf@redhat.com>
Thu, 17 Apr 2014 11:27:05 +0000 (13:27 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 22 Apr 2014 10:00:28 +0000 (12:00 +0200)
commitf2d953ec31eeeb3029ca915a55938c538a14efa8
treecdf3f33ebe91969f843d784e03c798ef80d6fad8
parent9ffe333276de8ef463896303fb951f03fd4ffcb4
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>
block.c
blockdev.c
tests/qemu-iotests/087
tests/qemu-iotests/087.out