qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v3 6/6] qcow2: Add full image preallocation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC PATCH v3 6/6] qcow2: Add full image preallocation option
Date: Fri, 20 Dec 2013 11:21:52 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Dec 19, 2013 at 10:27:41AM +0800, Hu Tao wrote:
> -static int preallocate(BlockDriverState *bs)
> +static int preallocate(BlockDriverState *bs, enum prealloc_mode mode)
>  {
>      uint64_t nb_sectors;
>      uint64_t offset;
> @@ -1395,9 +1395,19 @@ static int preallocate(BlockDriverState *bs)
>      int ret;
>      QCowL2Meta *meta;
>  
> +    assert(mode != PREALLOC_OFF);
> +
>      nb_sectors = bdrv_getlength(bs) >> 9;
>      offset = 0;
>  
> +    if (mode == PREALLOC_FULL) {
> +        ret = bdrv_preallocate(bs->file, 0, bdrv_getlength(bs));

This doesn't make sense since it fails to factor in qcow2 metadata and
the file layout.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]