From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIN58-0005IJ-DJ for qemu-devel@nongnu.org; Mon, 02 Feb 2015 14:54:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIN55-0002ny-1Y for qemu-devel@nongnu.org; Mon, 02 Feb 2015 14:54:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIN54-0002nk-PF for qemu-devel@nongnu.org; Mon, 02 Feb 2015 14:54:46 -0500 Message-ID: <54CFD600.20300@redhat.com> Date: Mon, 02 Feb 2015 14:54:40 -0500 From: Max Reitz MIME-Version: 1.0 References: <1422284444-12529-1-git-send-email-mreitz@redhat.com> <1422284444-12529-14-git-send-email-mreitz@redhat.com> <20150202194658.GG19586@noname.redhat.com> In-Reply-To: <20150202194658.GG19586@noname.redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Kevin Wolf Cc: Stefano Stabellini , qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster On 2015-02-02 at 14:46, Kevin Wolf wrote: > 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? Indeed, there shouldn't be any harm in keeping it. Max