Received: from eggs.gnu.org ([2001:4830:134:3::10]:56128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCPHA-000617-HI for qemu-devel@nongnu.org; Thu, 22 Aug 2013 03:25:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCPH4-0004C5-DT for qemu-devel@nongnu.org; Thu, 22 Aug 2013 03:25:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCPH4-0004Bw-3O for qemu-devel@nongnu.org; Thu, 22 Aug 2013 03:25:42 -0400 Date: Thu, 22 Aug 2013 15:25:34 +0800 From: Asias He Message-ID: <20130822072534.GA8147@hj.localdomain> References: <1377073564-25502-1-git-send-email-asias@redhat.com> <20130821154408.GC18303@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130821154408.GC18303@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: Introduce bs->zero_beyond_eof List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, MORITA Kazutaka , Bharata B Rao On Wed, Aug 21, 2013 at 05:44:08PM +0200, Stefan Hajnoczi wrote: > On Wed, Aug 21, 2013 at 04:26:04PM +0800, Asias He wrote: > > @@ -868,6 +868,7 @@ int bdrv_file_open(BlockDriverState **pbs, const char *filename, > > QDECREF(options); > > > > bs->growable = 1; > > + bs->zero_beyond_eof = true; > > *pbs = bs; > > return 0; > > > > @@ -978,6 +979,7 @@ int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options, > > } > > > > bs->options = options; > > + bs->zero_beyond_eof = true; > > options = qdict_clone_shallow(options); > > > > /* For snapshot=on, create a temporary qcow2 overlay */ > > We chatted about whether to duplicate bs->zero_beyond_eof = true on IRC. > Now I think you could put it in bdrv_open_common() to avoid duplication. > Every BDS should have ->zero_beyond_eof = true by default. Nice. v2 is on its way. > Stefan -- Asias