From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Ub1-0004KA-TN for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Uax-00075y-Qu for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:27:11 -0400 Received: from mail-pd0-x22d.google.com ([2607:f8b0:400e:c02::22d]:36147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Uax-00074y-J9 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:27:07 -0400 Received: by pdcu2 with SMTP id u2so76068404pdc.3 for ; Fri, 26 Jun 2015 07:27:06 -0700 (PDT) Message-ID: <558D6136.2090904@gmail.com> Date: Fri, 26 Jun 2015 22:27:02 +0800 From: Wen Congyang MIME-Version: 1.0 References: <558BA2B5.3080107@cn.fujitsu.com> <558D57D4.1090609@redhat.com> In-Reply-To: <558D57D4.1090609@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] refresh filename after the node is replaced List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Wen Congyang , qemu-devl , Jeff Cody Cc: Fam Zheng , Stefan Hajnoczi At 2015/6/26 21:47, Max Reitz Wrote: > On 25.06.2015 08:41, Wen Congyang wrote: >> We can use block job mirror to repair broken quorum files. But the >> command >> 'info block' doesn't output correct filename after block job mirror >> finishes. > > Which filename? The quorum filename is broken after this patch, too. In In my test, quorum has two children, s->common.bs->drv is quorum, and s->to_replace is one of his child. Without this patch, info block will output obsolete information. With this patch, the quorum's filename is right. I don't know why quorum filename is broken. Thanks Wen Congyang > order to fix this, we need to call bdrv_refresh_filename() after > bdrv_swap() on all BDSs which reference one of the swapped BDSs. I think > this will not be reasonably possible until Kevin's "bdrv_reopen() > overhaul" series is merged which introduces a generic parent-child > relationship for BDSs. > > Max > >> Signed-off-by: Wen Congyang >> --- >> block/mirror.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/block/mirror.c b/block/mirror.c >> index 8aa2b21..2ca2c21 100644 >> --- a/block/mirror.c >> +++ b/block/mirror.c >> @@ -351,6 +351,9 @@ static void mirror_exit(BlockJob *job, void *opaque) >> bdrv_set_backing_hd(s->base, NULL); >> bdrv_unref(p); >> } >> + if (s->to_replace != s->common.bs) { >> + bdrv_refresh_filename(s->common.bs); >> + } >> } >> if (s->to_replace) { >> bdrv_op_unblock_all(s->to_replace, s->replace_blocker); > > >