mirror: Allow target that already has a BlockBackend
authorKevin Wolf <kwolf@redhat.com>
Tue, 12 Apr 2016 14:20:59 +0000 (16:20 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 25 May 2016 17:04:21 +0000 (19:04 +0200)
commitb8804815799eb8e924f015de6d1710cbd5b932ee
tree566226f0163d15fe62cb71a476ba9f38992f4049
parent03e35d820d18f23606b4cc821a36cda1f7936170
mirror: Allow target that already has a BlockBackend

We had to forbid mirroring to a target BDS that already had a BB
attached because the node swapping at job completion would add a second
BB and we didn't support multiple BBs on a single BDS at the time. Now
we do, so we can lift the restriction.

As we allow additional BlockBackends for the target, we must expect
other users to be sending requests. There may no requests be in flight
during the graph modification, so we have to drain those users now.

The core part of this patch is a revert of commit 40365552.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block/mirror.c
blockdev.c
tests/qemu-iotests/041
tests/qemu-iotests/041.out