]> git.ipfire.org Git - thirdparty/qemu.git/commit
mirror: Error out when a BDS would get two BBs
authorKevin Wolf <kwolf@redhat.com>
Wed, 28 Oct 2015 12:24:26 +0000 (13:24 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 18 Dec 2015 13:34:42 +0000 (14:34 +0100)
commit40365552c2fceacc9800ec9a87b9ead516a9a6ce
tree44e5bcbc633d6a7c167f2056169c1be902c6eade
parentcddff5bae1c8e0e21a5e6da04eff1d0a4423e5f3
mirror: Error out when a BDS would get two BBs

bdrv_replace_in_backing_chain() asserts that not both old and new
BlockDdriverState have a BlockBackend attached to them because both
would have to end up pointing to the new BDS and we don't support more
than one BB per BDS yet.

Before we can safely allow references to existing nodes as backing
files, we need to make sure that even if a backing file has a BB on it,
this doesn't crash qemu.

There are probably also some cases with the 'replaces' option set where
drive-mirror could fail this assertion today. They are fixed with this
error check as well.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block/mirror.c