[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 14/24] qcow2: Allow creation with refcount or
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v6 14/24] qcow2: Allow creation with refcount order != 4 |
Date: |
Wed, 18 Feb 2015 12:01:33 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 10.02.2015 um 21:28 hat Max Reitz geschrieben:
> Add a creation option to qcow2 for setting the refcount order of images
> to be created, and respect that option's value.
>
> This breaks some test outputs, fix them.
>
> Signed-off-by: Max Reitz <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---
> block/qcow2.c | 20 +++++++++
> include/block/block_int.h | 1 +
> tests/qemu-iotests/049.out | 108
> ++++++++++++++++++++++-----------------------
> tests/qemu-iotests/082.out | 41 ++++++++++++++---
> tests/qemu-iotests/085.out | 38 ++++++++--------
> 5 files changed, 128 insertions(+), 80 deletions(-)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 65f7e91..99f6604 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2077,6 +2077,17 @@ static int qcow2_create(const char *filename, QemuOpts
> *opts, Error **errp)
> goto finish;
> }
>
> + refcount_bits = qemu_opt_get_number_del(opts, BLOCK_OPT_REFCOUNT_BITS,
> + refcount_bits);
This truncates the uint64_t result to an int, so the code accepts inputs
like refcount_bits=4294967297 (treating it as refcount_bits=1).
> + if (refcount_bits <= 0 || refcount_bits > 64 ||
Should we have a constant MAX_REFCOUNT_ORDER that is shared between
qcow2_open() and qcow2_create()?
> + !is_power_of_2(refcount_bits))
> + {
> + error_setg(errp, "Refcount width must be a power of two and may not "
> + "exceed 64 bits");
> + ret = -EINVAL;
> + goto finish;
> + }
> +
Kevin
- [Qemu-devel] [PATCH v6 09/24] qcow2: More helpers for refcount modification, (continued)
- [Qemu-devel] [PATCH v6 09/24] qcow2: More helpers for refcount modification, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 13/24] iotests: Prepare for refcount_bits option, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 15/24] progress: Allow regressing progress, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 11/24] qcow2: refcount_order parameter for qcow2_create2, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 20/24] qcow2: Use intermediate helper CB for amend, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 16/24] block: Add opaque value to the amend CB, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 14/24] qcow2: Allow creation with refcount order != 4, Max Reitz, 2015/02/10
- Re: [Qemu-devel] [PATCH v6 14/24] qcow2: Allow creation with refcount order != 4,
Kevin Wolf <=
- [Qemu-devel] [PATCH v6 17/24] qcow2: Use error_report() in qcow2_amend_options(), Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 18/24] qcow2: Use abort() instead of assert(false), Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 23/24] qcow2: Point to amend function in check, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 19/24] qcow2: Split upgrade/downgrade paths for amend, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 22/24] qcow2: Invoke refcount order amendment function, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 21/24] qcow2: Add function for refcount order amendment, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 24/24] iotests: Add test for different refcount widths, Max Reitz, 2015/02/10
- Re: [Qemu-devel] [PATCH v6 00/24] qcow2: Support refcount orders != 4, Kevin Wolf, 2015/02/17