From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wnou8-0003LN-Jo for qemu-devel@nongnu.org; Fri, 23 May 2014 08:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wnotz-0005lq-6I for qemu-devel@nongnu.org; Fri, 23 May 2014 08:48:56 -0400 Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:57828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wnoty-0005lf-Tf for qemu-devel@nongnu.org; Fri, 23 May 2014 08:48:47 -0400 Received: by mail-ee0-f43.google.com with SMTP id d17so3640529eek.2 for ; Fri, 23 May 2014 05:48:46 -0700 (PDT) Date: Fri, 23 May 2014 14:48:43 +0200 From: Stefan Hajnoczi Message-ID: <20140523124843.GC5990@stefanha-thinkpad.hitronhub.home> References: <1400815403-7719-1-git-send-email-famz@redhat.com> <1400815403-7719-7-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1400815403-7719-7-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 6/7] block: Use bdrv_set_backing_hd everywhere List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , Benoit Canet , jcody@redhat.com, qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Paolo Bonzini On Fri, May 23, 2014 at 11:23:22AM +0800, Fam Zheng wrote: > We need to handle the coming backing_blocker properly, so don't open > code the assignment, instead, call bdrv_set_backing_hd to change > backing_hd. > > Signed-off-by: Fam Zheng > --- > block.c | 4 ++-- > block/stream.c | 4 ++-- > block/vvfat.c | 2 +- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/block.c b/block.c > index 911ba68..91c866c 100644 > --- a/block.c > +++ b/block.c > @@ -2652,13 +2652,13 @@ int bdrv_drop_intermediate(BlockDriverState *active, BlockDriverState *top, > if (ret) { > goto exit; > } > - new_top_bs->backing_hd = base_bs; > + bdrv_set_backing_hd(new_top_bs, base_bs); > > bdrv_refresh_limits(new_top_bs); Please ignore what I said about backing_hd and base_bs being non-NULL, it doesn't matter. bdrv_set_backing_hd() always calls bdrv_refresh_limits() so we definitely don't need to call it again here.