[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH for-2.10 14/16] block/qcow2: falloc/full preallo
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH for-2.10 14/16] block/qcow2: falloc/full preallocating growth |
Date: |
Mon, 20 Mar 2017 11:29:00 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Mon, Mar 13, 2017 at 10:41:15PM +0100, Max Reitz wrote:
> Implement the preallocation modes falloc and full for growing qcow2
> images.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/qcow2.c | 36 +++++++++++++++++++++++++++++++++++-
> 1 file changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 80fb815b15..b6b08d70da 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2604,7 +2604,9 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t
> offset,
> int64_t new_l1_size;
> int ret;
>
> - if (prealloc != PREALLOC_MODE_OFF && prealloc != PREALLOC_MODE_METADATA)
> {
> + if (prealloc != PREALLOC_MODE_OFF && prealloc != PREALLOC_MODE_METADATA
> &&
> + prealloc != PREALLOC_MODE_FALLOC && prealloc != PREALLOC_MODE_FULL)
Now all cases are covered so this if statement can be dropped. If you
are worried about new preallocation modes being added in the future then
the error_setg() can be moved into the switch statement's default case.
signature.asc
Description: PGP signature
- [Qemu-block] [PATCH for-2.10 10/16] block/qcow2: Lock s->lock in preallocate(), (continued)
- [Qemu-block] [PATCH for-2.10 10/16] block/qcow2: Lock s->lock in preallocate(), Max Reitz, 2017/03/13
- [Qemu-block] [PATCH for-2.10 11/16] block/qcow2: Metadata preallocation for truncate, Max Reitz, 2017/03/13
- [Qemu-block] [PATCH for-2.10 12/16] block/qcow2: Extract qcow2_calc_size_usage(), Max Reitz, 2017/03/13
- [Qemu-block] [PATCH for-2.10 13/16] block/qcow2: qcow2_calc_size_usage() for truncate, Max Reitz, 2017/03/13
- [Qemu-block] [PATCH for-2.10 14/16] block/qcow2: falloc/full preallocating growth, Max Reitz, 2017/03/13
- Re: [Qemu-block] [PATCH for-2.10 14/16] block/qcow2: falloc/full preallocating growth,
Stefan Hajnoczi <=
- [Qemu-block] [PATCH for-2.10 15/16] iotests: Add preallocated resize test for raw, Max Reitz, 2017/03/13
- [Qemu-block] [PATCH for-2.10 16/16] iotests: Add preallocated growth test for qcow2, Max Reitz, 2017/03/13