]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: Don't queue the same BDS twice in bdrv_reopen_queue_child()
authorAlberto Garcia <berto@igalia.com>
Thu, 15 Sep 2016 14:53:03 +0000 (17:53 +0300)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Sep 2016 11:36:10 +0000 (13:36 +0200)
commit5b7ba05fe7313b03712e129a86fa70c2c215e908
tree823ad772380ab73e20d0e23962bee032a49df851
parentf87a0e29a9814a7ab6ee92b238989fed6186c4f3
block: Don't queue the same BDS twice in bdrv_reopen_queue_child()

bdrv_reopen_queue_child() assumes that a BlockDriverState is never
added twice to BlockReopenQueue.

That's however not the case: commit_start() adds 'base' (and its
children) to a new reopen queue, and then 'overlay_bs' (and its
children, which include 'base') to the same queue. The effect of this
is that the first set of options is ignored and overriden by the
second.

We fixed this by swapping the order in which both BDSs were added to
the queue in 3db2bd5508c86a1605258bc77c9672d93b5c350e. This patch
checks if a BDS is already in the reopen queue and keeps its options.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c