From nobody Sun May 5 06:33:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500339296439482.54259802530214; Mon, 17 Jul 2017 17:54:56 -0700 (PDT) Received: from localhost ([::1]:53281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXGms-0004SI-Vm for importer@patchew.org; Mon, 17 Jul 2017 20:54:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXGTB-0002KA-CF for qemu-devel@nongnu.org; Mon, 17 Jul 2017 20:34:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXGTA-00060z-Do for qemu-devel@nongnu.org; Mon, 17 Jul 2017 20:34:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39884) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXGT5-0005xQ-Jb; Mon, 17 Jul 2017 20:34:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B4CB2F86D6; Tue, 18 Jul 2017 00:34:26 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-231.bos.redhat.com [10.18.17.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF28677C1E; Tue, 18 Jul 2017 00:34:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8B4CB2F86D6 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jsnow@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8B4CB2F86D6 From: John Snow To: qemu-block@nongnu.org Date: Mon, 17 Jul 2017 20:34:21 -0400 Message-Id: <20170718003422.4497-2-jsnow@redhat.com> In-Reply-To: <20170718003422.4497-1-jsnow@redhat.com> References: <20170718003422.4497-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 18 Jul 2017 00:34:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 1/2] blockdev: move BDRV_O_NO_BACKING option forward X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, John Snow , qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" For both external_snapshot_prepare and qmp_drive_mirror, we eventually append the option BDRV_O_NO_BACKING. However, we generally do so after we create the image. To accommodate image creation wanting to verify that a backing file exists or not, add this option prior to create to override checking the existence of the backing file. This prevents QEMU from trying to re-open a backing file that's already in use (thanks to qcow2 locking). Signed-off-by: John Snow Reviewed-by: Eric Blake --- blockdev.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/blockdev.c b/blockdev.c index 7f53cc8..6469f16 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1710,7 +1710,8 @@ static void external_snapshot_prepare(BlkActionState = *common, } =20 flags =3D state->old_bs->open_flags; - flags &=3D ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_= READ); + flags &=3D ~(BDRV_O_SNAPSHOT | BDRV_O_COPY_ON_READ); + flags |=3D BDRV_O_NO_BACKING; =20 /* create new image w/backing file */ mode =3D s->has_mode ? s->mode : NEW_IMAGE_MODE_ABSOLUTE_PATHS; @@ -1735,8 +1736,6 @@ static void external_snapshot_prepare(BlkActionState = *common, qdict_put_str(options, "node-name", snapshot_node_name); } qdict_put_str(options, "driver", format); - - flags |=3D BDRV_O_NO_BACKING; } =20 state->new_bs =3D bdrv_open(new_image_file, snapshot_ref, options, fla= gs, @@ -3548,6 +3547,9 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp) backing_mode =3D MIRROR_OPEN_BACKING_CHAIN; } =20 + /* Don't open backing image in create() */ + flags |=3D BDRV_O_NO_BACKING; + if ((arg->sync =3D=3D MIRROR_SYNC_MODE_FULL || !source) && arg->mode !=3D NEW_IMAGE_MODE_EXISTING) { @@ -3587,8 +3589,7 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp) /* Mirroring takes care of copy-on-write using the source's backing * file. */ - target_bs =3D bdrv_open(arg->target, NULL, options, - flags | BDRV_O_NO_BACKING, errp); + target_bs =3D bdrv_open(arg->target, NULL, options, flags, errp); if (!target_bs) { goto out; } --=20 2.9.4 From nobody Sun May 5 06:33:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500339391474986.7473570991012; Mon, 17 Jul 2017 17:56:31 -0700 (PDT) Received: from localhost ([::1]:53291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXGoQ-0005Zu-5z for importer@patchew.org; Mon, 17 Jul 2017 20:56:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXGTD-0002Mm-LR for qemu-devel@nongnu.org; Mon, 17 Jul 2017 20:34:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXGTB-00062H-Ll for qemu-devel@nongnu.org; Mon, 17 Jul 2017 20:34:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43188) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXGT6-0005xv-GE; Mon, 17 Jul 2017 20:34:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 79FD67D0C9; Tue, 18 Jul 2017 00:34:27 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-231.bos.redhat.com [10.18.17.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB1DC77BE1; Tue, 18 Jul 2017 00:34:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 79FD67D0C9 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jsnow@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 79FD67D0C9 From: John Snow To: qemu-block@nongnu.org Date: Mon, 17 Jul 2017 20:34:22 -0400 Message-Id: <20170718003422.4497-3-jsnow@redhat.com> In-Reply-To: <20170718003422.4497-1-jsnow@redhat.com> References: <20170718003422.4497-1-jsnow@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 18 Jul 2017 00:34:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 2/2] qemu-img: Check for backing image if specified during create X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, John Snow , qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Or, rather, force the open of a backing image if one was specified for creation. Using a similar -unsafe option as rebase, allow qemu-img to ignore the backing file validation if possible. It may not always be possible, as in the existing case when a filesize for the new image was not specified. This is accomplished by shifting around the conditionals in bdrv_img_create, such that a backing file is always opened unless we provide BDRV_O_NO_BACKING. qemu-img is adjusted to pass this new flag when -u is provided to create. Sorry for the heinous looking diffstat, but it's mostly whitespace. Inspired by: https://bugzilla.redhat.com/show_bug.cgi?id=3D1213786 Reviewed-by: Eric Blake Signed-off-by: John Snow --- block.c | 96 +++++++++++++++++++++++++-----------------= ---- qemu-img-cmds.hx | 4 +- qemu-img.c | 16 +++++--- tests/qemu-iotests/082 | 4 +- tests/qemu-iotests/082.out | 4 +- tests/qemu-iotests/085 | 2 +- tests/qemu-iotests/111.out | 1 + tests/qemu-iotests/139 | 2 +- tests/qemu-iotests/156 | 2 +- tests/qemu-iotests/158 | 2 +- 10 files changed, 75 insertions(+), 58 deletions(-) diff --git a/block.c b/block.c index 98a9209..17d0d4a 100644 --- a/block.c +++ b/block.c @@ -4396,55 +4396,65 @@ void bdrv_img_create(const char *filename, const ch= ar *fmt, =20 backing_fmt =3D qemu_opt_get(opts, BLOCK_OPT_BACKING_FMT); =20 - // The size for the image must always be specified, with one exception: - // If we are using a backing file, we can obtain the size from there + /* The size for the image must always be specified, unless we have a b= acking + * file and we have not been forbidden from opening it */ size =3D qemu_opt_get_size(opts, BLOCK_OPT_SIZE, 0); - if (size =3D=3D -1) { - if (backing_file) { - BlockDriverState *bs; - char *full_backing =3D g_new0(char, PATH_MAX); - int64_t size; - int back_flags; - QDict *backing_options =3D NULL; - - bdrv_get_full_backing_filename_from_filename(filename, backing= _file, - full_backing, PAT= H_MAX, - &local_err); - if (local_err) { - g_free(full_backing); - goto out; - } - - /* backing files always opened read-only */ - back_flags =3D flags; - back_flags &=3D ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT | BDRV_O_NO_BA= CKING); - - if (backing_fmt) { - backing_options =3D qdict_new(); - qdict_put_str(backing_options, "driver", backing_fmt); - } - - bs =3D bdrv_open(full_backing, NULL, backing_options, back_fla= gs, - &local_err); + if (backing_file && !(flags & BDRV_O_NO_BACKING)) { + BlockDriverState *bs; + char *full_backing =3D g_new0(char, PATH_MAX); + int back_flags; + QDict *backing_options =3D NULL; + + bdrv_get_full_backing_filename_from_filename(filename, backing_fil= e, + full_backing, PATH_MA= X, + &local_err); + if (local_err) { g_free(full_backing); - if (!bs) { - goto out; - } - size =3D bdrv_getlength(bs); - if (size < 0) { - error_setg_errno(errp, -size, "Could not get size of '%s'", - backing_file); - bdrv_unref(bs); - goto out; - } + goto out; + } =20 - qemu_opt_set_number(opts, BLOCK_OPT_SIZE, size, &error_abort); + /* backing files always opened read-only */ + back_flags =3D flags; + back_flags &=3D ~(BDRV_O_RDWR | BDRV_O_SNAPSHOT | BDRV_O_NO_BACKIN= G); =20 + if (backing_fmt) { + backing_options =3D qdict_new(); + qdict_put_str(backing_options, "driver", backing_fmt); + } + + bs =3D bdrv_open(full_backing, NULL, backing_options, back_flags, + &local_err); + g_free(full_backing); + if (!bs && size !=3D -1) { + /* Couldn't open BS, but we have a size, so it's nonfatal */ + error_reportf_err(local_err, + "Warning: could not verify backing image. " + "This may become an error in future versions= .\n"); + local_err =3D NULL; + } else if (!bs) { + /* Couldn't open bs, do not have size */ + error_append_hint(&local_err, + "Could not open backing image to determine s= ize.\n"); + goto out; + } else { + if (size =3D=3D -1) { + /* Opened BS, have no size */ + size =3D bdrv_getlength(bs); + if (size < 0) { + error_setg_errno(errp, -size, "Could not get size of '= %s'", + backing_file); + bdrv_unref(bs); + goto out; + } + qemu_opt_set_number(opts, BLOCK_OPT_SIZE, size, &error_abo= rt); + } bdrv_unref(bs); - } else { - error_setg(errp, "Image creation needs a size parameter"); - goto out; } + } /* (backing_file && !(flags & BDRV_O_NO_BACKING)) */ + + if (size =3D=3D -1) { + error_setg(errp, "Image creation needs a size parameter"); + goto out; } =20 if (!quiet) { diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index ac5946b..3763f13 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -22,9 +22,9 @@ STEXI ETEXI =20 DEF("create", img_create, - "create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backi= ng_fmt] [-o options] filename [size]") + "create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backi= ng_fmt] [-u] [-o options] filename [size]") STEXI -@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backi= ng_file}] [-F @var{backing_fmt}] [-o @var{options}] @var{filename} [@var{si= ze}] +@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backi= ng_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@v= ar{size}] ETEXI =20 DEF("commit", img_commit, diff --git a/qemu-img.c b/qemu-img.c index 182e697..eb32b93 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -150,9 +150,11 @@ static void QEMU_NORETURN help(void) " 'snapshot_id_or_name' is deprecated, use 'snapshot_param'\n" " instead\n" " '-c' indicates that target image must be compressed (qcow fo= rmat only)\n" - " '-u' enables unsafe rebasing. It is assumed that old and new= backing file\n" - " match exactly. The image doesn't need a working backing= file before\n" - " rebasing in this case (useful for renaming the backing = file)\n" + " '-u' allows unsafe backing chains. For rebasing, it is assum= ed that old and\n" + " new backing file match exactly. The image doesn't need = a working\n" + " backing file before rebasing in this case (useful for r= enaming the\n" + " backing file). For image creation, allow creating witho= ut attempting\n" + " to open the backing file.\n" " '-h' with or without a command shows this help and lists the= supported formats\n" " '-p' show progress of command (only certain commands)\n" " '-q' use Quiet mode - do not print any output (except errors= )\n" @@ -429,6 +431,7 @@ static int img_create(int argc, char **argv) char *options =3D NULL; Error *local_err =3D NULL; bool quiet =3D false; + int flags =3D 0; =20 for(;;) { static const struct option long_options[] =3D { @@ -436,7 +439,7 @@ static int img_create(int argc, char **argv) {"object", required_argument, 0, OPTION_OBJECT}, {0, 0, 0, 0} }; - c =3D getopt_long(argc, argv, ":F:b:f:ho:q", + c =3D getopt_long(argc, argv, ":F:b:f:ho:qu", long_options, NULL); if (c =3D=3D -1) { break; @@ -476,6 +479,9 @@ static int img_create(int argc, char **argv) case 'q': quiet =3D true; break; + case 'u': + flags |=3D BDRV_O_NO_BACKING; + break; case OPTION_OBJECT: { QemuOpts *opts; opts =3D qemu_opts_parse_noisily(&qemu_object_opts, @@ -528,7 +534,7 @@ static int img_create(int argc, char **argv) } =20 bdrv_img_create(filename, fmt, base_filename, base_fmt, - options, img_size, 0, quiet, &local_err); + options, img_size, flags, quiet, &local_err); if (local_err) { error_reportf_err(local_err, "%s: ", filename); goto fail; diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082 index ad1d9fa..d5c83d4 100755 --- a/tests/qemu-iotests/082 +++ b/tests/qemu-iotests/082 @@ -85,8 +85,8 @@ run_qemu_img create -f $IMGFMT -o cluster_size=3D4k -o he= lp "$TEST_IMG" $size run_qemu_img create -f $IMGFMT -o cluster_size=3D4k -o \? "$TEST_IMG" $size =20 # Looks like a help option, but is part of the backing file name -run_qemu_img create -f $IMGFMT -o backing_file=3D"$TEST_IMG",,help "$TEST_= IMG" $size -run_qemu_img create -f $IMGFMT -o backing_file=3D"$TEST_IMG",,\? "$TEST_IM= G" $size +run_qemu_img create -f $IMGFMT -u -o backing_file=3D"$TEST_IMG",,help "$TE= ST_IMG" $size +run_qemu_img create -f $IMGFMT -u -o backing_file=3D"$TEST_IMG",,\? "$TEST= _IMG" $size =20 # Try to trick qemu-img into creating escaped commas run_qemu_img create -f $IMGFMT -o backing_file=3D"$TEST_IMG", -o help "$TE= ST_IMG" $size diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out index dbed67f..1527fbe 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -210,10 +210,10 @@ lazy_refcounts Postpone refcount updates refcount_bits Width of a reference count entry in bits nocow Turn off copy-on-write (valid only on btrfs) =20 -Testing: create -f qcow2 -o backing_file=3DTEST_DIR/t.qcow2,,help TEST_DIR= /t.qcow2 128M +Testing: create -f qcow2 -u -o backing_file=3DTEST_DIR/t.qcow2,,help TEST_= DIR/t.qcow2 128M Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 backing_file= =3DTEST_DIR/t.qcow2,,help cluster_size=3D65536 lazy_refcounts=3Doff refcoun= t_bits=3D16 =20 -Testing: create -f qcow2 -o backing_file=3DTEST_DIR/t.qcow2,,? TEST_DIR/t.= qcow2 128M +Testing: create -f qcow2 -u -o backing_file=3DTEST_DIR/t.qcow2,,? TEST_DIR= /t.qcow2 128M Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 backing_file= =3DTEST_DIR/t.qcow2,,? cluster_size=3D65536 lazy_refcounts=3Doff refcount_b= its=3D16 =20 Testing: create -f qcow2 -o backing_file=3DTEST_DIR/t.qcow2, -o help TEST_= DIR/t.qcow2 128M diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085 index b97adcd..71efe50 100755 --- a/tests/qemu-iotests/085 +++ b/tests/qemu-iotests/085 @@ -104,7 +104,7 @@ function add_snapshot_image() { base_image=3D"${TEST_DIR}/$((${1}-1))-${snapshot_virt0}" snapshot_file=3D"${TEST_DIR}/${1}-${snapshot_virt0}" - _make_test_img -b "${base_image}" "$size" + _make_test_img -u -b "${base_image}" "$size" mv "${TEST_IMG}" "${snapshot_file}" do_blockdev_add "$1" "'backing': '', " "${snapshot_file}" } diff --git a/tests/qemu-iotests/111.out b/tests/qemu-iotests/111.out index 683c01a..5279c46 100644 --- a/tests/qemu-iotests/111.out +++ b/tests/qemu-iotests/111.out @@ -1,3 +1,4 @@ QA output created by 111 qemu-img: TEST_DIR/t.IMGFMT: Could not open 'TEST_DIR/t.IMGFMT.inexistent'= : No such file or directory +Could not open backing image to determine size. *** done diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index 175d8f0..9ff51d9 100644 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -65,7 +65,7 @@ class TestBlockdevDel(iotests.QMPTestCase): # Add a BlockDriverState that will be used as overlay for the base_img= BDS def addBlockDriverStateOverlay(self, node): self.checkBlockDriverState(node, False) - iotests.qemu_img('create', '-f', iotests.imgfmt, + iotests.qemu_img('create', '-u', '-f', iotests.imgfmt, '-b', base_img, new_img, '1M') opts =3D {'driver': iotests.imgfmt, 'node-name': node, diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156 index d799b73..2c4a06e 100755 --- a/tests/qemu-iotests/156 +++ b/tests/qemu-iotests/156 @@ -66,7 +66,7 @@ _send_qemu_cmd $QEMU_HANDLE \ 'return' =20 # Create snapshot -TEST_IMG=3D"$TEST_IMG.overlay" _make_test_img -b "$TEST_IMG" 1M +TEST_IMG=3D"$TEST_IMG.overlay" _make_test_img -u -b "$TEST_IMG" 1M _send_qemu_cmd $QEMU_HANDLE \ "{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'source', diff --git a/tests/qemu-iotests/158 b/tests/qemu-iotests/158 index 823c120..24ac600 100755 --- a/tests/qemu-iotests/158 +++ b/tests/qemu-iotests/158 @@ -66,7 +66,7 @@ echo "=3D=3D verify pattern =3D=3D" $QEMU_IO --object $SECRET -c "read -P 0xa 0 $size" --image-opts $IMGSPECBA= SE | _filter_qemu_io | _filter_testdir =20 echo "=3D=3D create overlay =3D=3D" -_make_test_img --object $SECRET -o "encryption=3Don,encrypt.key-secret=3Ds= ec0" -b "$TEST_IMG_BASE" $size +_make_test_img -u --object $SECRET -o "encryption=3Don,encrypt.key-secret= =3Dsec0" -b "$TEST_IMG_BASE" $size =20 echo echo "=3D=3D writing part of a cluster =3D=3D" --=20 2.9.4