block: more check for replaced node
commite12f3784097a26a1ba51be420f41038b4c0ae5d1
authorWen Congyang <wency@cn.fujitsu.com>
Fri, 17 Jul 2015 02:12:22 +0000 (17 10:12 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 2 Sep 2015 13:56:39 +0000 (2 14:56 +0100)
tree14f552aa3fac589c508d646f93243a942698c7fb
parentf307371217c42d62015b8d83300a11cd9d3966f3
block: more check for replaced node

We use mirror+replace to fix quorum's broken child. bs/s->common.bs
is quorum, and to_replace is the broken child. The new child is target_bs.
Without this patch, the replace node can be any node, and it can be
top BDS with BB, or another quorum's child. We just check if the broken
child is part of the quorum BDS in this patch.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Message-id: 55A86486.1000404@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c
block/mirror.c
blockdev.c
include/block/block.h