On 28.06.20 13:02, Alberto Garcia wrote:
> Now that the implementation of subclusters is complete we can finally
> add the necessary options to create and read images with this feature,
> which we call "extended L2 entries".
> 
> Signed-off-by: Alberto Garcia <be...@igalia.com>
> Reviewed-by: Eric Blake <ebl...@redhat.com>
> ---
>  qapi/block-core.json             |   7 +++
>  block/qcow2.h                    |   8 ++-
>  include/block/block_int.h        |   1 +
>  block/qcow2.c                    |  74 ++++++++++++++++++++--
>  tests/qemu-iotests/031.out       |   8 +--
>  tests/qemu-iotests/036.out       |   4 +-
>  tests/qemu-iotests/049.out       | 102 +++++++++++++++----------------
>  tests/qemu-iotests/060.out       |   1 +
>  tests/qemu-iotests/061.out       |  20 +++---
>  tests/qemu-iotests/065           |  12 ++--
>  tests/qemu-iotests/082.out       |  48 ++++++++++++---
>  tests/qemu-iotests/085.out       |  38 ++++++------
>  tests/qemu-iotests/144.out       |   4 +-
>  tests/qemu-iotests/182.out       |   2 +-
>  tests/qemu-iotests/185.out       |   8 +--
>  tests/qemu-iotests/198.out       |   2 +
>  tests/qemu-iotests/206.out       |   4 ++
>  tests/qemu-iotests/242.out       |   5 ++
>  tests/qemu-iotests/255.out       |   8 +--
>  tests/qemu-iotests/274.out       |  49 ++++++++-------
>  tests/qemu-iotests/280.out       |   2 +-
>  tests/qemu-iotests/291.out       |   6 +-
>  tests/qemu-iotests/common.filter |   1 +
>  23 files changed, 272 insertions(+), 142 deletions(-)

Looks OK.

Reviewed-by: Max Reitz <mre...@redhat.com>

[...]

> diff --git a/block/qcow2.c b/block/qcow2.c
> index 003f166024..37bfae823c 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c

[...]

> @@ -5491,6 +5539,14 @@ static int qcow2_amend_options(BlockDriverState *bs, 
> QemuOpts *opts,
>                                   "is not supported");
>                  return -ENOTSUP;
>              }
> +        } else if (!strcmp(desc->name, BLOCK_OPT_EXTL2)) {
> +            bool extended_l2 = qemu_opt_get_bool(opts, BLOCK_OPT_EXTL2,
> +                                                 has_subclusters(s));
> +            if (extended_l2 != has_subclusters(s)) {
> +                error_setg(errp, "Toggling extended L2 entries "
> +                           "is not supported");
> +                return -EINVAL;

Just a note: I think ENOTSUP would fit better.

(Then again, Maxim’s “block/amend: refactor qcow2 amend options” removes
all of this code anyway.)

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to