From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJ0fq-0000wF-F7 for qemu-devel@nongnu.org; Thu, 27 Feb 2014 08:06:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJ0fi-0004g1-2D for qemu-devel@nongnu.org; Thu, 27 Feb 2014 08:06:50 -0500 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:48338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJ0fh-0004ft-QO for qemu-devel@nongnu.org; Thu, 27 Feb 2014 08:06:41 -0500 Received: by mail-wi0-f169.google.com with SMTP id bs8so605151wib.2 for ; Thu, 27 Feb 2014 05:06:41 -0800 (PST) Date: Thu, 27 Feb 2014 14:06:37 +0100 From: Stefan Hajnoczi Message-ID: <20140227130637.GE30387@stefanha-thinkpad.redhat.com> References: <1392089319-25307-1-git-send-email-famz@redhat.com> <1392089319-25307-4-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1392089319-25307-4-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 3/5] block: Change BlockDriverInfo.cluster_size to 64 bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, jcody@redhat.com, gentoo.integer@gmail.com, qemu-devel@nongnu.org, stefanha@redhat.com On Tue, Feb 11, 2014 at 11:28:37AM +0800, Fam Zheng wrote: > VMDK could have big cluster_size for monolithicFlat. It implements > .bdrv_get_info now, a 32 bit field is likely to overflow. > > Signed-off-by: Fam Zheng > --- > include/block/block.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/block/block.h b/include/block/block.h > index 826b5da..3eb4e54 100644 > --- a/include/block/block.h > +++ b/include/block/block.h > @@ -14,7 +14,7 @@ typedef struct BlockJob BlockJob; > > typedef struct BlockDriverInfo { > /* in bytes, 0 if irrelevant */ > - int cluster_size; > + int64_t cluster_size; Not sure if this commit is enough: If the cluster size is really larger than 2 GB and a compressed image is in use, then we will attempt 2 GB I/O. There are also other codepaths that use cluster_size and would similarly allocate 2 GB bounce buffers! We need to think through what happens in those cases. Should we refuse after a certain size? Will we need to enhance some code paths to actually split up the bounce buffers (if possible)? Stefan