{"id":1307029,"url":"http://patchwork.ozlabs.org/api/patches/1307029/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/8849254cc31e0de8f7b8163926f5f9990f40f0bf.1591801197.git.berto@igalia.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<8849254cc31e0de8f7b8163926f5f9990f40f0bf.1591801197.git.berto@igalia.com>","list_archive_url":null,"date":"2020-06-10T15:03:09","name":"[v8,31/34] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"4d5cbca5b151f156d410470b38b73a28eb2943a0","submitter":{"id":65704,"url":"http://patchwork.ozlabs.org/api/people/65704/?format=json","name":"Alberto Garcia","email":"berto@igalia.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/8849254cc31e0de8f7b8163926f5f9990f40f0bf.1591801197.git.berto@igalia.com/mbox/","series":[{"id":182563,"url":"http://patchwork.ozlabs.org/api/series/182563/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=182563","date":"2020-06-10T15:02:49","name":"Add subcluster allocation to qcow2","version":8,"mbox":"http://patchwork.ozlabs.org/series/182563/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1307029/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/1307029/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=<UNKNOWN>)","ozlabs.org;\n dmarc=none (p=none dis=none) header.from=igalia.com","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=igalia.com header.i=@igalia.com header.a=rsa-sha256\n header.s=20170329 header.b=BwPCwBSV;\n\tdkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49hrQf45vbz9sQx\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 11 Jun 2020 01:25:14 +1000 (AEST)","from localhost ([::1]:57122 helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1jj2bI-0006lv-0J\n\tfor incoming@patchwork.ozlabs.org; Wed, 10 Jun 2020 11:25:12 -0400","from eggs.gnu.org ([2001:470:142:3::10]:36186)\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <berto@igalia.com>)\n id 1jj2H3-0002op-27; Wed, 10 Jun 2020 11:04:17 -0400","from fanzine.igalia.com ([178.60.130.6]:58260)\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <berto@igalia.com>)\n id 1jj2Gs-0006wl-9G; Wed, 10 Jun 2020 11:04:15 -0400","from [81.0.38.199] (helo=perseus.local)\n by fanzine.igalia.com with esmtpsa\n (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim)\n id 1jj2GR-0007hI-Qh; Wed, 10 Jun 2020 17:03:40 +0200","from berto by perseus.local with local (Exim 4.92)\n (envelope-from <berto@igalia.com>)\n id 1jj2GC-0007Nr-JO; Wed, 10 Jun 2020 17:03:24 +0200"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n s=20170329;\n h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From;\n bh=KrEalh789KkHGcsFJCSG+dZ5Pph3arYDPqiuO4lOuDs=;\n b=BwPCwBSVNKrxAM/gMioMZgN1DccLirGZ3Wbc+1V1WjdtU9900T8GlHYTjZD1t6RDaNjqiGkxsrLKBzTctdZZykv8NG7l2Ykn69o+YaoCHvwor7zFRwyJ3sr0uyTnlCje48pxMJPcw0ER7swQd2xkqdsjZOj/kmdsnvGgSzHhd2i41KNZDpKX9C1v4Pbjhsq/v964TQs4beXYKu0wQ9meefmRDLPTcr0x03vNWryI01pw+b+0KVT7xRckcyXk4VVNc5hT5m+Qvt/fSjTpoadyCHqWKwzV0ODcUB20sgGH1Vqlj+m1b7Km5p433D+XxOnmjypGtW/FUS9cgFGWZtMAAg==;","From":"Alberto Garcia <berto@igalia.com>","To":"qemu-devel@nongnu.org","Subject":"[PATCH v8 31/34] qcow2: Add the 'extended_l2' option and the\n QCOW2_INCOMPAT_EXTL2 bit","Date":"Wed, 10 Jun 2020 17:03:09 +0200","Message-Id":"\n <8849254cc31e0de8f7b8163926f5f9990f40f0bf.1591801197.git.berto@igalia.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<cover.1591801197.git.berto@igalia.com>","References":"<cover.1591801197.git.berto@igalia.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=178.60.130.6; envelope-from=berto@igalia.com;\n helo=fanzine.igalia.com","X-detected-operating-system":"by eggs.gnu.org: First seen = 2020/06/10 11:03:39","X-ACL-Warn":"Detected OS   = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy]","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=_AUTOLEARN","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>,\n Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,\n Alberto Garcia <berto@igalia.com>, qemu-block@nongnu.org,\n Derek Su <dereksu@qnap.com>, Max Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Now that the implementation of subclusters is complete we can finally\nadd the necessary options to create and read images with this feature,\nwhich we call \"extended L2 entries\".\n\nSigned-off-by: Alberto Garcia <berto@igalia.com>\nReviewed-by: Eric Blake <eblake@redhat.com>\n---\n qapi/block-core.json             |   7 +++\n block/qcow2.h                    |   8 ++-\n include/block/block_int.h        |   1 +\n block/qcow2.c                    |  74 ++++++++++++++++++++--\n tests/qemu-iotests/031.out       |   8 +--\n tests/qemu-iotests/036.out       |   4 +-\n tests/qemu-iotests/049.out       | 102 +++++++++++++++----------------\n tests/qemu-iotests/060.out       |   1 +\n tests/qemu-iotests/061.out       |  20 +++---\n tests/qemu-iotests/065           |  12 ++--\n tests/qemu-iotests/082.out       |  48 ++++++++++++---\n tests/qemu-iotests/085.out       |  38 ++++++------\n tests/qemu-iotests/144.out       |   4 +-\n tests/qemu-iotests/182.out       |   2 +-\n tests/qemu-iotests/185.out       |   8 +--\n tests/qemu-iotests/198.out       |   2 +\n tests/qemu-iotests/206.out       |   4 ++\n tests/qemu-iotests/242.out       |   5 ++\n tests/qemu-iotests/255.out       |   8 +--\n tests/qemu-iotests/274.out       |  49 ++++++++-------\n tests/qemu-iotests/280.out       |   2 +-\n tests/qemu-iotests/291.out       |   2 +\n tests/qemu-iotests/common.filter |   1 +\n 23 files changed, 270 insertions(+), 140 deletions(-)","diff":"diff --git a/qapi/block-core.json b/qapi/block-core.json\nindex 0e1c6a59f2..24e002ebae 100644\n--- a/qapi/block-core.json\n+++ b/qapi/block-core.json\n@@ -66,6 +66,9 @@\n #                 standalone (read-only) raw image without looking at qcow2\n #                 metadata (since: 4.0)\n #\n+# @extended-l2: true if the image has extended L2 entries; only valid for\n+#               compat >= 1.1 (since 5.1)\n+#\n # @lazy-refcounts: on or off; only valid for compat >= 1.1\n #\n # @corrupt: true if the image has been marked corrupt; only valid for\n@@ -87,6 +90,7 @@\n       'compat': 'str',\n       '*data-file': 'str',\n       '*data-file-raw': 'bool',\n+      '*extended-l2': 'bool',\n       '*lazy-refcounts': 'bool',\n       '*corrupt': 'bool',\n       'refcount-bits': 'int',\n@@ -4318,6 +4322,8 @@\n # @data-file-raw: True if the external data file must stay valid as a\n #                 standalone (read-only) raw image without looking at qcow2\n #                 metadata (default: false; since: 4.0)\n+# @extended-l2      True to make the image have extended L2 entries\n+#                   (default: false; since 5.1)\n # @size: Size of the virtual disk in bytes\n # @version: Compatibility level (default: v3)\n # @backing-file: File name of the backing file if a backing file\n@@ -4338,6 +4344,7 @@\n   'data': { 'file':             'BlockdevRef',\n             '*data-file':       'BlockdevRef',\n             '*data-file-raw':   'bool',\n+            '*extended-l2':     'bool',\n             'size':             'size',\n             '*version':         'BlockdevQcow2Version',\n             '*backing-file':    'str',\ndiff --git a/block/qcow2.h b/block/qcow2.h\nindex f3499e53bf..065ec3df0b 100644\n--- a/block/qcow2.h\n+++ b/block/qcow2.h\n@@ -246,15 +246,18 @@ enum {\n     QCOW2_INCOMPAT_CORRUPT_BITNR    = 1,\n     QCOW2_INCOMPAT_DATA_FILE_BITNR  = 2,\n     QCOW2_INCOMPAT_COMPRESSION_BITNR = 3,\n+    QCOW2_INCOMPAT_EXTL2_BITNR      = 4,\n     QCOW2_INCOMPAT_DIRTY            = 1 << QCOW2_INCOMPAT_DIRTY_BITNR,\n     QCOW2_INCOMPAT_CORRUPT          = 1 << QCOW2_INCOMPAT_CORRUPT_BITNR,\n     QCOW2_INCOMPAT_DATA_FILE        = 1 << QCOW2_INCOMPAT_DATA_FILE_BITNR,\n     QCOW2_INCOMPAT_COMPRESSION      = 1 << QCOW2_INCOMPAT_COMPRESSION_BITNR,\n+    QCOW2_INCOMPAT_EXTL2            = 1 << QCOW2_INCOMPAT_EXTL2_BITNR,\n \n     QCOW2_INCOMPAT_MASK             = QCOW2_INCOMPAT_DIRTY\n                                     | QCOW2_INCOMPAT_CORRUPT\n                                     | QCOW2_INCOMPAT_DATA_FILE\n-                                    | QCOW2_INCOMPAT_COMPRESSION,\n+                                    | QCOW2_INCOMPAT_COMPRESSION\n+                                    | QCOW2_INCOMPAT_EXTL2,\n };\n \n /* Compatible feature bits */\n@@ -581,8 +584,7 @@ typedef enum QCow2MetadataOverlap {\n \n static inline bool has_subclusters(BDRVQcow2State *s)\n {\n-    /* FIXME: Return false until this feature is complete */\n-    return false;\n+    return s->incompatible_features & QCOW2_INCOMPAT_EXTL2;\n }\n \n static inline size_t l2_entry_size(BDRVQcow2State *s)\ndiff --git a/include/block/block_int.h b/include/block/block_int.h\nindex 791de6a59c..36e1993788 100644\n--- a/include/block/block_int.h\n+++ b/include/block/block_int.h\n@@ -58,6 +58,7 @@\n #define BLOCK_OPT_DATA_FILE         \"data_file\"\n #define BLOCK_OPT_DATA_FILE_RAW     \"data_file_raw\"\n #define BLOCK_OPT_COMPRESSION_TYPE  \"compression_type\"\n+#define BLOCK_OPT_EXTL2             \"extended_l2\"\n \n #define BLOCK_PROBE_BUF_SIZE        512\n \ndiff --git a/block/qcow2.c b/block/qcow2.c\nindex 003f166024..37bfae823c 100644\n--- a/block/qcow2.c\n+++ b/block/qcow2.c\n@@ -1438,6 +1438,12 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,\n     s->subcluster_size = s->cluster_size / s->subclusters_per_cluster;\n     s->subcluster_bits = ctz32(s->subcluster_size);\n \n+    if (s->subcluster_size < (1 << MIN_CLUSTER_BITS)) {\n+        error_setg(errp, \"Unsupported subcluster size: %d\", s->subcluster_size);\n+        ret = -EINVAL;\n+        goto fail;\n+    }\n+\n     /* Check support for various header values */\n     if (header.refcount_order > 6) {\n         error_setg(errp, \"Reference count entry width too large; may not \"\n@@ -2924,6 +2930,11 @@ int qcow2_update_header(BlockDriverState *bs)\n                 .bit  = QCOW2_INCOMPAT_COMPRESSION_BITNR,\n                 .name = \"compression type\",\n             },\n+            {\n+                .type = QCOW2_FEAT_TYPE_INCOMPATIBLE,\n+                .bit  = QCOW2_INCOMPAT_EXTL2_BITNR,\n+                .name = \"extended L2 entries\",\n+            },\n             {\n                 .type = QCOW2_FEAT_TYPE_COMPATIBLE,\n                 .bit  = QCOW2_COMPAT_LAZY_REFCOUNTS_BITNR,\n@@ -3271,7 +3282,8 @@ static int64_t qcow2_calc_prealloc_size(int64_t total_size,\n     return meta_size + aligned_total_size;\n }\n \n-static bool validate_cluster_size(size_t cluster_size, Error **errp)\n+static bool validate_cluster_size(size_t cluster_size, bool extended_l2,\n+                                  Error **errp)\n {\n     int cluster_bits = ctz32(cluster_size);\n     if (cluster_bits < MIN_CLUSTER_BITS || cluster_bits > MAX_CLUSTER_BITS ||\n@@ -3281,16 +3293,28 @@ static bool validate_cluster_size(size_t cluster_size, Error **errp)\n                    \"%dk\", 1 << MIN_CLUSTER_BITS, 1 << (MAX_CLUSTER_BITS - 10));\n         return false;\n     }\n+\n+    if (extended_l2) {\n+        unsigned min_cluster_size =\n+            (1 << MIN_CLUSTER_BITS) * QCOW_EXTL2_SUBCLUSTERS_PER_CLUSTER;\n+        if (cluster_size < min_cluster_size) {\n+            error_setg(errp, \"Extended L2 entries are only supported with \"\n+                       \"cluster sizes of at least %u bytes\", min_cluster_size);\n+            return false;\n+        }\n+    }\n+\n     return true;\n }\n \n-static size_t qcow2_opt_get_cluster_size_del(QemuOpts *opts, Error **errp)\n+static size_t qcow2_opt_get_cluster_size_del(QemuOpts *opts, bool extended_l2,\n+                                             Error **errp)\n {\n     size_t cluster_size;\n \n     cluster_size = qemu_opt_get_size_del(opts, BLOCK_OPT_CLUSTER_SIZE,\n                                          DEFAULT_CLUSTER_SIZE);\n-    if (!validate_cluster_size(cluster_size, errp)) {\n+    if (!validate_cluster_size(cluster_size, extended_l2, errp)) {\n         return 0;\n     }\n     return cluster_size;\n@@ -3405,7 +3429,20 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)\n         cluster_size = DEFAULT_CLUSTER_SIZE;\n     }\n \n-    if (!validate_cluster_size(cluster_size, errp)) {\n+    if (!qcow2_opts->has_extended_l2) {\n+        qcow2_opts->extended_l2 = false;\n+    }\n+    if (qcow2_opts->extended_l2) {\n+        if (version < 3) {\n+            error_setg(errp, \"Extended L2 entries are only supported with \"\n+                       \"compatibility level 1.1 and above (use version=v3 or \"\n+                       \"greater)\");\n+            ret = -EINVAL;\n+            goto out;\n+        }\n+    }\n+\n+    if (!validate_cluster_size(cluster_size, qcow2_opts->extended_l2, errp)) {\n         ret = -EINVAL;\n         goto out;\n     }\n@@ -3556,6 +3593,11 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)\n             cpu_to_be64(QCOW2_INCOMPAT_COMPRESSION);\n     }\n \n+    if (qcow2_opts->extended_l2) {\n+        header->incompatible_features |=\n+            cpu_to_be64(QCOW2_INCOMPAT_EXTL2);\n+    }\n+\n     ret = blk_pwrite(blk, 0, header, cluster_size, 0);\n     g_free(header);\n     if (ret < 0) {\n@@ -3736,6 +3778,7 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,\n         { BLOCK_OPT_BACKING_FMT,        \"backing-fmt\" },\n         { BLOCK_OPT_CLUSTER_SIZE,       \"cluster-size\" },\n         { BLOCK_OPT_LAZY_REFCOUNTS,     \"lazy-refcounts\" },\n+        { BLOCK_OPT_EXTL2,              \"extended-l2\" },\n         { BLOCK_OPT_REFCOUNT_BITS,      \"refcount-bits\" },\n         { BLOCK_OPT_ENCRYPT,            BLOCK_OPT_ENCRYPT_FORMAT },\n         { BLOCK_OPT_COMPAT_LEVEL,       \"version\" },\n@@ -4854,11 +4897,14 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,\n     PreallocMode prealloc;\n     bool has_backing_file;\n     bool has_luks;\n-    bool extended_l2 = false; /* Set to false until the option is added */\n+    bool extended_l2;\n     size_t l2e_size;\n \n     /* Parse image creation options */\n-    cluster_size = qcow2_opt_get_cluster_size_del(opts, &local_err);\n+    extended_l2 = qemu_opt_get_bool_del(opts, BLOCK_OPT_EXTL2, false);\n+\n+    cluster_size = qcow2_opt_get_cluster_size_del(opts, extended_l2,\n+                                                  &local_err);\n     if (local_err) {\n         goto err;\n     }\n@@ -5062,6 +5108,8 @@ static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs,\n             .corrupt            = s->incompatible_features &\n                                   QCOW2_INCOMPAT_CORRUPT,\n             .has_corrupt        = true,\n+            .has_extended_l2    = true,\n+            .extended_l2        = has_subclusters(s),\n             .refcount_bits      = s->refcount_bits,\n             .has_bitmaps        = !!bitmaps,\n             .bitmaps            = bitmaps,\n@@ -5491,6 +5539,14 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,\n                                  \"is not supported\");\n                 return -ENOTSUP;\n             }\n+        } else if (!strcmp(desc->name, BLOCK_OPT_EXTL2)) {\n+            bool extended_l2 = qemu_opt_get_bool(opts, BLOCK_OPT_EXTL2,\n+                                                 has_subclusters(s));\n+            if (extended_l2 != has_subclusters(s)) {\n+                error_setg(errp, \"Toggling extended L2 entries \"\n+                           \"is not supported\");\n+                return -EINVAL;\n+            }\n         } else {\n             /* if this point is reached, this probably means a new option was\n              * added without having it covered here */\n@@ -5751,6 +5807,12 @@ static QemuOptsList qcow2_create_opts = {\n             .help = \"Postpone refcount updates\",\n             .def_value_str = \"off\"\n         },\n+        {\n+            .name = BLOCK_OPT_EXTL2,\n+            .type = QEMU_OPT_BOOL,\n+            .help = \"Extended L2 tables\",\n+            .def_value_str = \"off\"\n+        },\n         {\n             .name = BLOCK_OPT_REFCOUNT_BITS,\n             .type = QEMU_OPT_NUMBER,\ndiff --git a/tests/qemu-iotests/031.out b/tests/qemu-iotests/031.out\nindex 5a4beda6a2..cdda111c75 100644\n--- a/tests/qemu-iotests/031.out\n+++ b/tests/qemu-iotests/031.out\n@@ -117,7 +117,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n Header extension:\n@@ -150,7 +150,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n Header extension:\n@@ -164,7 +164,7 @@ No errors were found on the image.\n \n magic                     0x514649fb\n version                   3\n-backing_file_offset       0x210\n+backing_file_offset       0x240\n backing_file_size         0x17\n cluster_bits              16\n size                      67108864\n@@ -188,7 +188,7 @@ data                      'host_device'\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n Header extension:\ndiff --git a/tests/qemu-iotests/036.out b/tests/qemu-iotests/036.out\nindex e409acf60e..0f6cffc2c3 100644\n--- a/tests/qemu-iotests/036.out\n+++ b/tests/qemu-iotests/036.out\n@@ -26,7 +26,7 @@ compatible_features       []\n autoclear_features        [63]\n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n \n@@ -38,7 +38,7 @@ compatible_features       []\n autoclear_features        []\n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n *** done\ndiff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out\nindex c54ae21b86..c8356be551 100644\n--- a/tests/qemu-iotests/049.out\n+++ b/tests/qemu-iotests/049.out\n@@ -4,90 +4,90 @@ QA output created by 049\n == 1. Traditional size parameter ==\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024b\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1k\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1K\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1G\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1T\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0b\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5k\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5K\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5G\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5T\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n == 2. Specifying size via -o ==\n \n qemu-img create -f qcow2 -o size=1024 TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1024b TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1k TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1K TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1M TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1G TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1T TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1024.0 TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1024.0b TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1.5k TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1.5K TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1.5M TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1.5G TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o size=1.5T TEST_DIR/t.qcow2\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n == 3. Invalid sizes ==\n \n@@ -129,84 +129,84 @@ qemu-img: TEST_DIR/t.qcow2: The image size must be specified only once\n == Check correct interpretation of suffixes for cluster size ==\n \n qemu-img create -f qcow2 -o cluster_size=1024 TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=1024b TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=1k TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=1K TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=1M TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1048576 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1048576 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=1024.0 TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=1024.0b TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=0.5k TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=0.5K TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o cluster_size=0.5M TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=524288 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=524288 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n == Check compat level option ==\n \n qemu-img create -f qcow2 -o compat=0.10 TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o compat=1.1 TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o compat=0.42 TEST_DIR/t.qcow2 64M\n qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.42 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.42 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o compat=foobar TEST_DIR/t.qcow2 64M\n qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=foobar cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=foobar cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n == Check preallocation option ==\n \n qemu-img create -f qcow2 -o preallocation=off TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=off lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=off lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o preallocation=metadata TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=metadata lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o preallocation=1234 TEST_DIR/t.qcow2 64M\n qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=1234 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=1234 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n == Check encryption option ==\n \n qemu-img create -f qcow2 -o encryption=off TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 --object secret,id=sec0,data=123456 -o encryption=on,encrypt.key-secret=sec0 TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=on encrypt.key-secret=sec0 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=on encrypt.key-secret=sec0 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n == Check lazy_refcounts option (only with v3) ==\n \n qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=off TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=on TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=on refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=on extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=off TEST_DIR/t.qcow2 64M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=on TEST_DIR/t.qcow2 64M\n qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=on refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=on extended_l2=off refcount_bits=16 compression_type=zlib\n \n *** done\ndiff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out\nindex be5f8707a3..b420a89e6c 100644\n--- a/tests/qemu-iotests/060.out\n+++ b/tests/qemu-iotests/060.out\n@@ -21,6 +21,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: true\n+    extended l2: false\n qemu-io: can't open device TEST_DIR/t.IMGFMT: IMGFMT: Image is corrupt; cannot be opened read/write\n no file open, try 'help open'\n read 512/512 bytes at offset 0\ndiff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out\nindex a51ad1b5ba..39812d8cf8 100644\n--- a/tests/qemu-iotests/061.out\n+++ b/tests/qemu-iotests/061.out\n@@ -26,7 +26,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n magic                     0x514649fb\n@@ -84,7 +84,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n magic                     0x514649fb\n@@ -140,7 +140,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n ERROR cluster 5 refcount=0 reference=1\n@@ -195,7 +195,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n magic                     0x514649fb\n@@ -264,7 +264,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n read 65536/65536 bytes at offset 44040192\n@@ -326,7 +326,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n ERROR cluster 5 refcount=0 reference=1\n@@ -355,7 +355,7 @@ header_length             112\n \n Header extension:\n magic                     0x6803f857\n-length                    336\n+length                    384\n data                      <binary>\n \n read 131072/131072 bytes at offset 0\n@@ -525,6 +525,7 @@ Format specific information:\n     data file: TEST_DIR/t.IMGFMT.data\n     data file raw: false\n     corrupt: false\n+    extended l2: false\n No errors were found on the image.\n \n === Try changing the external data file ===\n@@ -546,6 +547,7 @@ Format specific information:\n     data file: foo\n     data file raw: false\n     corrupt: false\n+    extended l2: false\n \n qemu-img: Could not open 'TEST_DIR/t.IMGFMT': 'data-file' is required for this image\n image: TEST_DIR/t.IMGFMT\n@@ -559,6 +561,7 @@ Format specific information:\n     refcount bits: 16\n     data file raw: false\n     corrupt: false\n+    extended l2: false\n \n === Clearing and setting data-file-raw ===\n \n@@ -575,6 +578,7 @@ Format specific information:\n     data file: TEST_DIR/t.IMGFMT.data\n     data file raw: true\n     corrupt: false\n+    extended l2: false\n No errors were found on the image.\n image: TEST_DIR/t.IMGFMT\n file format: IMGFMT\n@@ -588,6 +592,7 @@ Format specific information:\n     data file: TEST_DIR/t.IMGFMT.data\n     data file raw: false\n     corrupt: false\n+    extended l2: false\n No errors were found on the image.\n qemu-img: data-file-raw cannot be set on existing images\n image: TEST_DIR/t.IMGFMT\n@@ -602,5 +607,6 @@ Format specific information:\n     data file: TEST_DIR/t.IMGFMT.data\n     data file raw: false\n     corrupt: false\n+    extended l2: false\n No errors were found on the image.\n *** done\ndiff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065\nindex 18dc488c7a..29a7f7ad60 100755\n--- a/tests/qemu-iotests/065\n+++ b/tests/qemu-iotests/065\n@@ -98,20 +98,20 @@ class TestQCow3NotLazy(TestQemuImgInfo):\n     img_options = 'compat=1.1,lazy_refcounts=off'\n     json_compare = { 'compat': '1.1', 'lazy-refcounts': False,\n                      'refcount-bits': 16, 'corrupt': False,\n-                     'compression-type': 'zlib' }\n+                     'compression-type': 'zlib', 'extended-l2': False }\n     human_compare = [ 'compat: 1.1', 'compression type: zlib',\n                       'lazy refcounts: false', 'refcount bits: 16',\n-                      'corrupt: false' ]\n+                      'corrupt: false', 'extended l2: false' ]\n \n class TestQCow3Lazy(TestQemuImgInfo):\n     '''Testing a qcow2 version 3 image with lazy refcounts enabled'''\n     img_options = 'compat=1.1,lazy_refcounts=on'\n     json_compare = { 'compat': '1.1', 'lazy-refcounts': True,\n                      'refcount-bits': 16, 'corrupt': False,\n-                     'compression-type': 'zlib' }\n+                     'compression-type': 'zlib', 'extended-l2': False }\n     human_compare = [ 'compat: 1.1', 'compression type: zlib',\n                       'lazy refcounts: true', 'refcount bits: 16',\n-                      'corrupt: false' ]\n+                      'corrupt: false', 'extended l2: false' ]\n \n class TestQCow3NotLazyQMP(TestQMP):\n     '''Testing a qcow2 version 3 image with lazy refcounts disabled, opening\n@@ -120,7 +120,7 @@ class TestQCow3NotLazyQMP(TestQMP):\n     qemu_options = 'lazy-refcounts=on'\n     compare = { 'compat': '1.1', 'lazy-refcounts': False,\n                 'refcount-bits': 16, 'corrupt': False,\n-                'compression-type': 'zlib' }\n+                'compression-type': 'zlib', 'extended-l2': False }\n \n \n class TestQCow3LazyQMP(TestQMP):\n@@ -130,7 +130,7 @@ class TestQCow3LazyQMP(TestQMP):\n     qemu_options = 'lazy-refcounts=off'\n     compare = { 'compat': '1.1', 'lazy-refcounts': True,\n                 'refcount-bits': 16, 'corrupt': False,\n-                'compression-type': 'zlib' }\n+                'compression-type': 'zlib', 'extended-l2': False }\n \n TestImageInfoSpecific = None\n TestQemuImgInfo = None\ndiff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out\nindex 529a1214e1..efc0328e8d 100644\n--- a/tests/qemu-iotests/082.out\n+++ b/tests/qemu-iotests/082.out\n@@ -3,14 +3,14 @@ QA output created by 082\n === create: Options specified more than once ===\n \n Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n image: TEST_DIR/t.IMGFMT\n file format: IMGFMT\n virtual size: 128 MiB (134217728 bytes)\n cluster_size: 65536\n \n Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 128M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=4096 lazy_refcounts=on refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=4096 lazy_refcounts=on extended_l2=off refcount_bits=16 compression_type=zlib\n image: TEST_DIR/t.IMGFMT\n file format: IMGFMT\n virtual size: 128 MiB (134217728 bytes)\n@@ -21,9 +21,10 @@ Format specific information:\n     lazy refcounts: true\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 128M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=on refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=on extended_l2=off refcount_bits=16 compression_type=zlib\n image: TEST_DIR/t.IMGFMT\n file format: IMGFMT\n virtual size: 128 MiB (134217728 bytes)\n@@ -34,9 +35,10 @@ Format specific information:\n     lazy refcounts: true\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Testing: create -f qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 128M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n image: TEST_DIR/t.IMGFMT\n file format: IMGFMT\n virtual size: 128 MiB (134217728 bytes)\n@@ -62,6 +64,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -86,6 +89,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -110,6 +114,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -134,6 +139,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -158,6 +164,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -182,6 +189,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -206,6 +214,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -230,6 +239,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -237,10 +247,10 @@ Supported options:\n   size=<size>            - Virtual disk size\n \n Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 128M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,help cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,help cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 128M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,? cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,? cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 128M\n qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2,\n@@ -269,6 +279,7 @@ Supported qcow2 options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -290,7 +301,7 @@ qemu-img: Format driver 'bochs' does not support image creation\n === convert: Options specified more than once ===\n \n Testing: create -f qcow2 TEST_DIR/t.qcow2 128M\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base\n image: TEST_DIR/t.IMGFMT.base\n@@ -314,6 +325,7 @@ Format specific information:\n     lazy refcounts: true\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base\n image: TEST_DIR/t.IMGFMT.base\n@@ -326,6 +338,7 @@ Format specific information:\n     lazy refcounts: true\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Testing: convert -O qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base\n image: TEST_DIR/t.IMGFMT.base\n@@ -353,6 +366,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -377,6 +391,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -401,6 +416,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -425,6 +441,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -449,6 +466,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -473,6 +491,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -497,6 +516,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -521,6 +541,7 @@ Supported options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   nocow=<bool (on/off)>  - Turn off copy-on-write (valid only on btrfs)\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n@@ -560,6 +581,7 @@ Supported qcow2 options:\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -605,6 +627,7 @@ Format specific information:\n     lazy refcounts: true\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Testing: amend -f qcow2 -o size=130M -o lazy_refcounts=off TEST_DIR/t.qcow2\n image: TEST_DIR/t.IMGFMT\n@@ -617,6 +640,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Testing: amend -f qcow2 -o size=8M -o lazy_refcounts=on -o size=132M TEST_DIR/t.qcow2\n image: TEST_DIR/t.IMGFMT\n@@ -629,6 +653,7 @@ Format specific information:\n     lazy refcounts: true\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Testing: amend -f qcow2 -o size=4M,size=148M TEST_DIR/t.qcow2\n image: TEST_DIR/t.IMGFMT\n@@ -656,6 +681,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -681,6 +707,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -706,6 +733,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -731,6 +759,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -756,6 +785,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -781,6 +811,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -806,6 +837,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -831,6 +863,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\n@@ -873,6 +906,7 @@ Creation options for 'qcow2':\n   encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm\n   encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase\n   encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)\n+  extended_l2=<bool (on/off)> - Extended L2 tables\n   lazy_refcounts=<bool (on/off)> - Postpone refcount updates\n   preallocation=<str>    - Preallocation mode (allowed values: off, metadata, falloc, full)\n   refcount_bits=<num>    - Width of a reference count entry in bits\ndiff --git a/tests/qemu-iotests/085.out b/tests/qemu-iotests/085.out\nindex a822ff4ef6..0431743808 100644\n--- a/tests/qemu-iotests/085.out\n+++ b/tests/qemu-iotests/085.out\n@@ -13,7 +13,7 @@ Formatting 'TEST_DIR/t.IMGFMT.2', fmt=IMGFMT size=134217728\n === Create a single snapshot on virtio0 ===\n \n { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/1-snapshot-v0.IMGFMT', 'format': 'IMGFMT' } }\n-Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2.1 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2.1 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n \n === Invalid command - missing device and nodename ===\n@@ -30,40 +30,40 @@ Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file\n === Create several transactional group snapshots ===\n \n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/2-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/2-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/1-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2.2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/1-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2.2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/3-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/3-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/2-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/2-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/2-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/2-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/4-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/4-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/3-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/3-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/3-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/3-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/5-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/5-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/4-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/4-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/4-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/4-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/6-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/6-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/5-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/5-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/5-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/5-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/7-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/7-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/6-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/6-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/6-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/6-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/8-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/8-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/7-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/7-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/7-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/7-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/9-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/9-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/8-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/8-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/8-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/8-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/10-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/10-snapshot-v1.IMGFMT' } } ] } }\n-Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/9-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n-Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/9-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/9-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/9-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n \n === Create a couple of snapshots using blockdev-snapshot ===\ndiff --git a/tests/qemu-iotests/144.out b/tests/qemu-iotests/144.out\nindex 885a8874a5..a2627f0cc5 100644\n--- a/tests/qemu-iotests/144.out\n+++ b/tests/qemu-iotests/144.out\n@@ -9,7 +9,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=536870912\n { 'execute': 'qmp_capabilities' }\n {\"return\": {}}\n { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp.IMGFMT', 'format': 'IMGFMT' } }\n-Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n \n === Performing block-commit on active layer ===\n@@ -31,6 +31,6 @@ Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/\n === Performing Live Snapshot 2 ===\n \n { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp2.IMGFMT', 'format': 'IMGFMT' } }\n-Formatting 'TEST_DIR/tmp2.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/tmp2.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n *** done\ndiff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out\nindex ae43654d32..e4290ec028 100644\n--- a/tests/qemu-iotests/182.out\n+++ b/tests/qemu-iotests/182.out\n@@ -13,7 +13,7 @@ Is another process using the image [TEST_DIR/t.qcow2]?\n {'execute': 'blockdev-add', 'arguments': { 'node-name': 'node0', 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } }\n {\"return\": {}}\n {'execute': 'blockdev-snapshot-sync', 'arguments': { 'node-name': 'node0', 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'snapshot-node-name': 'node1' } }\n-Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_DIR/t.qcow2 backing_fmt=file cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_DIR/t.qcow2 backing_fmt=file cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n {'execute': 'blockdev-add', 'arguments': { 'node-name': 'node1', 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } }\n {\"return\": {}}\ndiff --git a/tests/qemu-iotests/185.out b/tests/qemu-iotests/185.out\nindex ac5ab16bc8..4e0f018bf2 100644\n--- a/tests/qemu-iotests/185.out\n+++ b/tests/qemu-iotests/185.out\n@@ -9,14 +9,14 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864\n === Creating backing chain ===\n \n { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 'snapshot-file': 'TEST_DIR/t.IMGFMT.mid', 'format': 'IMGFMT', 'mode': 'absolute-paths' } }\n-Formatting 'TEST_DIR/t.qcow2.mid', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.base backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2.mid', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.base backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu-io disk \"write 0 4M\"' } }\n wrote 4194304/4194304 bytes at offset 0\n 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n {\"return\": \"\"}\n { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 'snapshot-file': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'absolute-paths' } }\n-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.mid backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.mid backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"return\": {}}\n \n === Start commit job and exit qemu ===\n@@ -48,7 +48,7 @@ Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.q\n { 'execute': 'qmp_capabilities' }\n {\"return\": {}}\n { 'execute': 'drive-mirror', 'arguments': { 'device': 'disk', 'target': 'TEST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 } }\n-Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"disk\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"disk\"}}\n {\"return\": {}}\n@@ -62,7 +62,7 @@ Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 l\n { 'execute': 'qmp_capabilities' }\n {\"return\": {}}\n { 'execute': 'drive-backup', 'arguments': { 'device': 'disk', 'target': 'TEST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 } }\n-Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"disk\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"disk\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"paused\", \"id\": \"disk\"}}\ndiff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out\nindex 6280ae6eed..821a052bb1 100644\n--- a/tests/qemu-iotests/198.out\n+++ b/tests/qemu-iotests/198.out\n@@ -73,6 +73,7 @@ Format specific information:\n                 key offset: 1810432\n         payload offset: 2068480\n         master key iters: 1024\n+    extended l2: false\n \n == checking image layer ==\n image: json:{ /* filtered */ }\n@@ -117,4 +118,5 @@ Format specific information:\n                 key offset: 1810432\n         payload offset: 2068480\n         master key iters: 1024\n+    extended l2: false\n *** done\ndiff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out\nindex 1a14255a83..363c5abe35 100644\n--- a/tests/qemu-iotests/206.out\n+++ b/tests/qemu-iotests/206.out\n@@ -22,6 +22,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n === Successful image creation (inline blockdev-add, explicit defaults) ===\n \n@@ -45,6 +46,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n === Successful image creation (v3 non-default options) ===\n \n@@ -68,6 +70,7 @@ Format specific information:\n     lazy refcounts: true\n     refcount bits: 1\n     corrupt: false\n+    extended l2: false\n \n === Successful image creation (v2 non-default options) ===\n \n@@ -146,6 +149,7 @@ Format specific information:\n         payload offset: 528384\n         master key iters: XXX\n     corrupt: false\n+    extended l2: false\n \n === Invalid BlockdevRef ===\n \ndiff --git a/tests/qemu-iotests/242.out b/tests/qemu-iotests/242.out\nindex 091b9126ce..3759c99284 100644\n--- a/tests/qemu-iotests/242.out\n+++ b/tests/qemu-iotests/242.out\n@@ -16,6 +16,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n No bitmap in JSON format output\n \n@@ -42,6 +43,7 @@ Format specific information:\n             granularity: 32768\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n The same bitmaps in JSON format:\n [\n@@ -80,6 +82,7 @@ Format specific information:\n             granularity: 65536\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n The same bitmaps in JSON format:\n [\n@@ -123,6 +126,7 @@ Format specific information:\n             granularity: 65536\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n The same bitmaps in JSON format:\n [\n@@ -167,5 +171,6 @@ Format specific information:\n             granularity: 16384\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n Test complete\ndiff --git a/tests/qemu-iotests/255.out b/tests/qemu-iotests/255.out\nindex a3c99fd62e..38ac1a4e95 100644\n--- a/tests/qemu-iotests/255.out\n+++ b/tests/qemu-iotests/255.out\n@@ -3,9 +3,9 @@ Finishing a commit job with background reads\n \n === Create backing chain and start VM ===\n \n-Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n === Start background read requests ===\n \n@@ -23,9 +23,9 @@ Closing the VM while a job is being cancelled\n \n === Create images and start VM ===\n \n-Formatting 'TEST_DIR/PID-src.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-src.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-dst.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-dst.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 1048576/1048576 bytes at offset 0\n 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\ndiff --git a/tests/qemu-iotests/274.out b/tests/qemu-iotests/274.out\nindex d24ff681af..47edc3c423 100644\n--- a/tests/qemu-iotests/274.out\n+++ b/tests/qemu-iotests/274.out\n@@ -1,9 +1,9 @@\n == Commit tests ==\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 2097152/2097152 bytes at offset 0\n 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -56,6 +56,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n read 1048576/1048576 bytes at offset 0\n 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -64,11 +65,11 @@ read 1048576/1048576 bytes at offset 1048576\n 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n \n === Testing HMP commit (top -> mid) ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 2097152/2097152 bytes at offset 0\n 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -86,6 +87,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n read 1048576/1048576 bytes at offset 0\n 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -94,11 +96,11 @@ read 1048576/1048576 bytes at offset 1048576\n 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n \n === Testing QMP active commit (top -> mid) ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 2097152/2097152 bytes at offset 0\n 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -122,6 +124,7 @@ Format specific information:\n     lazy refcounts: false\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n read 1048576/1048576 bytes at offset 0\n 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -131,9 +134,9 @@ read 1048576/1048576 bytes at offset 1048576\n \n == Resize tests ==\n === preallocation=off ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=6442450944 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=6442450944 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=1073741824 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=1073741824 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 65536/65536 bytes at offset 5368709120\n 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -150,9 +153,9 @@ read 65536/65536 bytes at offset 5368709120\n { \"start\": 1073741824, \"length\": 7516192768, \"depth\": 0, \"zero\": true, \"data\": false}]\n \n === preallocation=metadata ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=34359738368 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=34359738368 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=32212254720 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=32212254720 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 65536/65536 bytes at offset 33285996544\n 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -174,9 +177,9 @@ read 65536/65536 bytes at offset 33285996544\n { \"start\": 34896609280, \"length\": 536870912, \"depth\": 0, \"zero\": true, \"data\": false, \"offset\": 2685075456}]\n \n === preallocation=falloc ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=10485760 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=10485760 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=5242880 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=5242880 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 65536/65536 bytes at offset 9437184\n 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -193,9 +196,9 @@ read 65536/65536 bytes at offset 9437184\n { \"start\": 5242880, \"length\": 10485760, \"depth\": 0, \"zero\": false, \"data\": true, \"offset\": 327680}]\n \n === preallocation=full ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=16777216 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=16777216 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=8388608 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=8388608 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 65536/65536 bytes at offset 11534336\n 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -212,9 +215,9 @@ read 65536/65536 bytes at offset 11534336\n { \"start\": 8388608, \"length\": 4194304, \"depth\": 0, \"zero\": false, \"data\": true, \"offset\": 327680}]\n \n === preallocation=off ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=393216 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=393216 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=259072 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=259072 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 65536/65536 bytes at offset 259072\n 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -232,9 +235,9 @@ read 65536/65536 bytes at offset 259072\n { \"start\": 262144, \"length\": 262144, \"depth\": 0, \"zero\": true, \"data\": false}]\n \n === preallocation=off ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=409600 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=409600 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 65536/65536 bytes at offset 344064\n 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n@@ -251,9 +254,9 @@ read 65536/65536 bytes at offset 344064\n { \"start\": 262144, \"length\": 262144, \"depth\": 0, \"zero\": true, \"data\": false}]\n \n === preallocation=off ===\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=524288 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=524288 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n-Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n wrote 65536/65536 bytes at offset 446464\n 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\ndiff --git a/tests/qemu-iotests/280.out b/tests/qemu-iotests/280.out\nindex 92e4d14079..372e9f70ad 100644\n--- a/tests/qemu-iotests/280.out\n+++ b/tests/qemu-iotests/280.out\n@@ -1,4 +1,4 @@\n-Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib\n+Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off extended_l2=off refcount_bits=16 compression_type=zlib\n \n === Launch VM ===\n Enabling migration QMP events on VM...\ndiff --git a/tests/qemu-iotests/291.out b/tests/qemu-iotests/291.out\nindex 8c62017567..bc72161d91 100644\n--- a/tests/qemu-iotests/291.out\n+++ b/tests/qemu-iotests/291.out\n@@ -41,6 +41,7 @@ Format specific information:\n             granularity: 65536\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n image: TEST_DIR/t.IMGFMT\n file format: IMGFMT\n virtual size: 10 MiB (10485760 bytes)\n@@ -65,6 +66,7 @@ Format specific information:\n             granularity: 65536\n     refcount bits: 16\n     corrupt: false\n+    extended l2: false\n \n === Check bitmap contents ===\n \ndiff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter\nindex 03e4f71808..2ca66de0f0 100644\n--- a/tests/qemu-iotests/common.filter\n+++ b/tests/qemu-iotests/common.filter\n@@ -146,6 +146,7 @@ _filter_img_create()\n         -e \"s# adapter_type=[^ ]*##g\" \\\n         -e \"s# hwversion=[^ ]*##g\" \\\n         -e \"s# lazy_refcounts=\\\\(on\\\\|off\\\\)##g\" \\\n+        -e \"s# extended_l2=\\\\(on\\\\|off\\\\)##g\" \\\n         -e \"s# block_size=[0-9]\\\\+##g\" \\\n         -e \"s# block_state_zero=\\\\(on\\\\|off\\\\)##g\" \\\n         -e \"s# log_size=[0-9]\\\\+##g\" \\\n","prefixes":["v8","31/34"]}