From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnotN-0002hA-1i for qemu-devel@nongnu.org; Fri, 23 May 2014 08:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnotE-0005f9-0V for qemu-devel@nongnu.org; Fri, 23 May 2014 08:48:08 -0400 Received: from mail-ee0-x236.google.com ([2a00:1450:4013:c00::236]:47795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnotD-0005eq-Q9 for qemu-devel@nongnu.org; Fri, 23 May 2014 08:47:59 -0400 Received: by mail-ee0-f54.google.com with SMTP id b57so3710198eek.27 for ; Fri, 23 May 2014 05:47:57 -0700 (PDT) Date: Fri, 23 May 2014 14:47:55 +0200 From: Stefan Hajnoczi Message-ID: <20140523124755.GB5990@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); bdrv_set_backing_hd() already does bdrv_refresh_limits() when backing_hd != NULL (and base_bs is always non-NULL in this code path). The bdrv_refresh_limits() can be dropped.