From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGKqp-0007Sn-Jw for qemu-devel@nongnu.org; Fri, 24 Jun 2016 02:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGKqo-0001Hf-Hs for qemu-devel@nongnu.org; Fri, 24 Jun 2016 02:44:27 -0400 Date: Fri, 24 Jun 2016 14:44:14 +0800 From: Fam Zheng Message-ID: <20160624064414.GD13266@ad.usersys.redhat.com> References: <1466721446-27737-1-git-send-email-eblake@redhat.com> <1466721446-27737-19-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466721446-27737-19-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 18/22] block: Drop raw_refresh_limits() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, kwolf@redhat.com, stefanha@redhat.com, Max Reitz On Thu, 06/23 16:37, Eric Blake wrote: > The raw block driver was blindly copying all limits from bs->file, > even though: 1. the main bdrv_refresh_limits() already does this > for many of the limits, and 2. blindly copying from the children > can weaken any stricter limits that were already inherited from > the backing chain during the main bdrv_refresh_limits(). Also, > a future patch is about to move .request_alignment into > BlockLimits, and that is a limit that should NOT be copied from > other layers in the BDS chain. > > Thus, we can completely drop raw_refresh_limits(), and rely on > the block layer setting up the proper limits. > > Signed-off-by: Eric Blake > > --- > v3: new patch, split out from 'block: Split bdrv_merge_limits()...' > --- > block/raw_bsd.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/block/raw_bsd.c b/block/raw_bsd.c > index 7f63791..5855e84 100644 > --- a/block/raw_bsd.c > +++ b/block/raw_bsd.c > @@ -1,6 +1,6 @@ > /* BlockDriver implementation for "raw" > * > - * Copyright (C) 2010, 2013, Red Hat, Inc. > + * Copyright (C) 2010-2016 Red Hat, Inc. > * Copyright (C) 2010, Blue Swirl > * Copyright (C) 2009, Anthony Liguori > * > @@ -150,11 +150,6 @@ static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) > return bdrv_get_info(bs->file->bs, bdi); > } > > -static void raw_refresh_limits(BlockDriverState *bs, Error **errp) > -{ > - bs->bl = bs->file->bs->bl; > -} > - > static int raw_truncate(BlockDriverState *bs, int64_t offset) > { > return bdrv_truncate(bs->file->bs, offset); > @@ -252,7 +247,6 @@ BlockDriver bdrv_raw = { > .bdrv_getlength = &raw_getlength, > .has_variable_length = true, > .bdrv_get_info = &raw_get_info, > - .bdrv_refresh_limits = &raw_refresh_limits, > .bdrv_probe_blocksizes = &raw_probe_blocksizes, > .bdrv_probe_geometry = &raw_probe_geometry, > .bdrv_media_changed = &raw_media_changed, > -- > 2.5.5 > Reviewed-by: Fam Zheng