From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCAa4-0003g7-MB for qemu-devel@nongnu.org; Wed, 21 Aug 2013 11:44:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCAZw-0004lk-66 for qemu-devel@nongnu.org; Wed, 21 Aug 2013 11:44:20 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:49396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCAZv-0004lE-Uo for qemu-devel@nongnu.org; Wed, 21 Aug 2013 11:44:12 -0400 Received: by mail-wg0-f45.google.com with SMTP id n12so532521wgh.0 for ; Wed, 21 Aug 2013 08:44:11 -0700 (PDT) Date: Wed, 21 Aug 2013 17:44:08 +0200 From: Stefan Hajnoczi Message-ID: <20130821154408.GC18303@stefanha-thinkpad.redhat.com> References: <1377073564-25502-1-git-send-email-asias@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1377073564-25502-1-git-send-email-asias@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: Asias He Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, MORITA Kazutaka , Bharata B Rao 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. Stefan