From e12f3784097a26a1ba51be420f41038b4c0ae5d1 Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Fri, 17 Jul 2015 10:12:22 +0800 Subject: 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 Message-id: 55A86486.1000404@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi --- block/mirror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'block') diff --git a/block/mirror.c b/block/mirror.c index 9474443..a258926 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -644,9 +644,9 @@ static void mirror_complete(BlockJob *job, Error **errp) if (s->replaces) { AioContext *replace_aio_context; - s->to_replace = check_to_replace_node(s->replaces, &local_err); + s->to_replace = bdrv_find_node(s->replaces); if (!s->to_replace) { - error_propagate(errp, local_err); + error_setg(errp, "Node name '%s' not found", s->replaces); return; } -- cgit v1.1