From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIMxg-0005j7-EF for qemu-devel@nongnu.org; Mon, 02 Feb 2015 14:47:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIMxd-0000Ej-8h for qemu-devel@nongnu.org; Mon, 02 Feb 2015 14:47:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIMxd-0000EX-09 for qemu-devel@nongnu.org; Mon, 02 Feb 2015 14:47:05 -0500 Date: Mon, 2 Feb 2015 20:46:58 +0100 From: Kevin Wolf Message-ID: <20150202194658.GG19586@noname.redhat.com> References: <1422284444-12529-1-git-send-email-mreitz@redhat.com> <1422284444-12529-14-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1422284444-12529-14-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 13/14] block: Remove "growable" from BDS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Stefano Stabellini , qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster Am 26.01.2015 um 16:00 hat Max Reitz geschrieben: > Now that request clamping is done in the BlockBackend, the "growable" > field can be removed from the BlockDriverState. All BDSs are now treated > as being "growable" (that is, they are allowed to grow; they are not > necessarily actually able to). > > Signed-off-by: Max Reitz > --- > block.c | 24 +++++------------------- > block/qcow2.c | 6 ------ > block/raw-posix.c | 2 +- > block/raw-win32.c | 2 +- > block/sheepdog.c | 2 +- > include/block/block_int.h | 3 --- > 6 files changed, 8 insertions(+), 31 deletions(-) > > diff --git a/block.c b/block.c > index d45e4dd..356a857 100644 > --- a/block.c > +++ b/block.c > @@ -970,7 +970,6 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file, > bs->zero_beyond_eof = true; > open_flags = bdrv_open_flags(bs, flags); > bs->read_only = !(open_flags & BDRV_O_RDWR); > - bs->growable = !!(flags & BDRV_O_PROTOCOL); > > if (use_bdrv_whitelist && !bdrv_is_whitelisted(drv, bs->read_only)) { > error_setg(errp, > @@ -1885,7 +1884,6 @@ void bdrv_close(BlockDriverState *bs) > bs->encrypted = 0; > bs->valid_key = 0; > bs->sg = 0; > - bs->growable = 0; > bs->zero_beyond_eof = false; > QDECREF(bs->options); > bs->options = NULL; > @@ -2645,25 +2643,13 @@ exit: > static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset, > size_t size) > { > - int64_t len; > - > if (size > INT_MAX) { > return -EIO; > } > > - if (!bdrv_is_inserted(bs)) > + if (!bdrv_is_inserted(bs)) { > return -ENOMEDIUM; > - > - if (bs->growable) > - return 0; > - > - len = bdrv_getlength(bs); > - > - if (offset < 0) > - return -EIO; Wouldn't it be better to keep this one, even though bs->growable used to disable it? Kevin