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

Reply via email to