From nobody Sat Apr 27 08:40:13 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524262284016907.0659522137961; Fri, 20 Apr 2018 15:11:24 -0700 (PDT) Received: from localhost ([::1]:38309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9eFP-0003RX-Ug for importer@patchew.org; Fri, 20 Apr 2018 18:11:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9eDh-0002FS-AH for qemu-devel@nongnu.org; Fri, 20 Apr 2018 18:09:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9eDg-0000wO-27 for qemu-devel@nongnu.org; Fri, 20 Apr 2018 18:09:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41388 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9eDb-0000q0-EL; Fri, 20 Apr 2018 18:09:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 270CF410FBB4; Fri, 20 Apr 2018 22:09:21 +0000 (UTC) Received: from localhost (ovpn-204-52.brq.redhat.com [10.40.204.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C27DA11701C8; Fri, 20 Apr 2018 22:09:20 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 21 Apr 2018 00:09:11 +0200 Message-Id: <20180420220913.27000-2-mreitz@redhat.com> In-Reply-To: <20180420220913.27000-1-mreitz@redhat.com> References: <20180420220913.27000-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 20 Apr 2018 22:09:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 20 Apr 2018 22:09:21 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mreitz@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 1/3] block/file-posix: Pass FD to locking helpers 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: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz 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" raw_apply_lock_bytes() and raw_check_lock_bytes() currently take a BDRVRawState *, but they only use the lock_fd field. During image creation, we do not have a BDRVRawState, but we do have an FD; so if we want to reuse the functions there, we should modify them to receive only the FD. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng --- block/file-posix.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 3794c0007a..c98a4a1556 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -630,7 +630,7 @@ typedef enum { * file; if @unlock =3D=3D true, also unlock the unneeded bytes. * @shared_perm_lock_bits is the mask of all permissions that are NOT shar= ed. */ -static int raw_apply_lock_bytes(BDRVRawState *s, +static int raw_apply_lock_bytes(int fd, uint64_t perm_lock_bits, uint64_t shared_perm_lock_bits, bool unlock, Error **errp) @@ -641,13 +641,13 @@ static int raw_apply_lock_bytes(BDRVRawState *s, PERM_FOREACH(i) { int off =3D RAW_LOCK_PERM_BASE + i; if (perm_lock_bits & (1ULL << i)) { - ret =3D qemu_lock_fd(s->lock_fd, off, 1, false); + ret =3D qemu_lock_fd(fd, off, 1, false); if (ret) { error_setg(errp, "Failed to lock byte %d", off); return ret; } } else if (unlock) { - ret =3D qemu_unlock_fd(s->lock_fd, off, 1); + ret =3D qemu_unlock_fd(fd, off, 1); if (ret) { error_setg(errp, "Failed to unlock byte %d", off); return ret; @@ -657,13 +657,13 @@ static int raw_apply_lock_bytes(BDRVRawState *s, PERM_FOREACH(i) { int off =3D RAW_LOCK_SHARED_BASE + i; if (shared_perm_lock_bits & (1ULL << i)) { - ret =3D qemu_lock_fd(s->lock_fd, off, 1, false); + ret =3D qemu_lock_fd(fd, off, 1, false); if (ret) { error_setg(errp, "Failed to lock byte %d", off); return ret; } } else if (unlock) { - ret =3D qemu_unlock_fd(s->lock_fd, off, 1); + ret =3D qemu_unlock_fd(fd, off, 1); if (ret) { error_setg(errp, "Failed to unlock byte %d", off); return ret; @@ -674,8 +674,7 @@ static int raw_apply_lock_bytes(BDRVRawState *s, } =20 /* Check "unshared" bytes implied by @perm and ~@shared_perm in the file. = */ -static int raw_check_lock_bytes(BDRVRawState *s, - uint64_t perm, uint64_t shared_perm, +static int raw_check_lock_bytes(int fd, uint64_t perm, uint64_t shared_per= m, Error **errp) { int ret; @@ -685,7 +684,7 @@ static int raw_check_lock_bytes(BDRVRawState *s, int off =3D RAW_LOCK_SHARED_BASE + i; uint64_t p =3D 1ULL << i; if (perm & p) { - ret =3D qemu_lock_fd_test(s->lock_fd, off, 1, true); + ret =3D qemu_lock_fd_test(fd, off, 1, true); if (ret) { char *perm_name =3D bdrv_perm_names(p); error_setg(errp, @@ -702,7 +701,7 @@ static int raw_check_lock_bytes(BDRVRawState *s, int off =3D RAW_LOCK_PERM_BASE + i; uint64_t p =3D 1ULL << i; if (!(shared_perm & p)) { - ret =3D qemu_lock_fd_test(s->lock_fd, off, 1, true); + ret =3D qemu_lock_fd_test(fd, off, 1, true); if (ret) { char *perm_name =3D bdrv_perm_names(p); error_setg(errp, @@ -739,11 +738,11 @@ static int raw_handle_perm_lock(BlockDriverState *bs, =20 switch (op) { case RAW_PL_PREPARE: - ret =3D raw_apply_lock_bytes(s, s->perm | new_perm, + ret =3D raw_apply_lock_bytes(s->lock_fd, s->perm | new_perm, ~s->shared_perm | ~new_shared, false, errp); if (!ret) { - ret =3D raw_check_lock_bytes(s, new_perm, new_shared, errp); + ret =3D raw_check_lock_bytes(s->lock_fd, new_perm, new_shared,= errp); if (!ret) { return 0; } @@ -751,7 +750,8 @@ static int raw_handle_perm_lock(BlockDriverState *bs, op =3D RAW_PL_ABORT; /* fall through to unlock bytes. */ case RAW_PL_ABORT: - raw_apply_lock_bytes(s, s->perm, ~s->shared_perm, true, &local_err= ); + raw_apply_lock_bytes(s->lock_fd, s->perm, ~s->shared_perm, + true, &local_err); if (local_err) { /* Theoretically the above call only unlocks bytes and it cann= ot * fail. Something weird happened, report it. @@ -760,7 +760,8 @@ static int raw_handle_perm_lock(BlockDriverState *bs, } break; case RAW_PL_COMMIT: - raw_apply_lock_bytes(s, new_perm, ~new_shared, true, &local_err); + raw_apply_lock_bytes(s->lock_fd, new_perm, ~new_shared, + true, &local_err); if (local_err) { /* Theoretically the above call only unlocks bytes and it cann= ot * fail. Something weird happened, report it. --=20 2.14.3 From nobody Sat Apr 27 08:40:13 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152426241458685.45429219191169; Fri, 20 Apr 2018 15:13:34 -0700 (PDT) Received: from localhost ([::1]:38389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9eHd-000553-Qn for importer@patchew.org; Fri, 20 Apr 2018 18:13:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9eDh-0002F8-1T for qemu-devel@nongnu.org; Fri, 20 Apr 2018 18:09:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9eDf-0000w7-VJ for qemu-devel@nongnu.org; Fri, 20 Apr 2018 18:09:28 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57186 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9eDb-0000qP-Et; Fri, 20 Apr 2018 18:09:23 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 203324072456; Fri, 20 Apr 2018 22:09:23 +0000 (UTC) Received: from localhost (ovpn-204-52.brq.redhat.com [10.40.204.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A59FFBDC59; Fri, 20 Apr 2018 22:09:22 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 21 Apr 2018 00:09:12 +0200 Message-Id: <20180420220913.27000-3-mreitz@redhat.com> In-Reply-To: <20180420220913.27000-1-mreitz@redhat.com> References: <20180420220913.27000-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 20 Apr 2018 22:09:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 20 Apr 2018 22:09:23 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mreitz@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 2/3] block/file-posix: File locking during creation 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: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz 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" When creating a file, we should take the WRITE and RESIZE permissions. We do not need either for the creation itself, but we do need them for clearing and resizing it. So we can take the proper permissions by replacing O_TRUNC with an explicit truncation to 0, and by taking the appropriate file locks between those two steps. Signed-off-by: Max Reitz --- block/file-posix.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index c98a4a1556..ed7932d6e8 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1992,6 +1992,7 @@ static int raw_co_create(BlockdevCreateOptions *optio= ns, Error **errp) { BlockdevCreateOptionsFile *file_opts; int fd; + int perm, shared; int result =3D 0; =20 /* Validate options and set default values */ @@ -2006,14 +2007,48 @@ static int raw_co_create(BlockdevCreateOptions *opt= ions, Error **errp) } =20 /* Create file */ - fd =3D qemu_open(file_opts->filename, O_RDWR | O_CREAT | O_TRUNC | O_B= INARY, - 0644); + fd =3D qemu_open(file_opts->filename, O_RDWR | O_CREAT | O_BINARY, 064= 4); if (fd < 0) { result =3D -errno; error_setg_errno(errp, -result, "Could not create file"); goto out; } =20 + /* Take permissions: We want to discard everything, so we need + * BLK_PERM_WRITE; and truncation to the desired size requires + * BLK_PERM_RESIZE. + * On the other hand, we cannot share the RESIZE permission + * because we promise that after this function, the file has the + * size given in the options. If someone else were to resize it + * concurrently, we could not guarantee that. */ + perm =3D BLK_PERM_WRITE | BLK_PERM_RESIZE; + shared =3D BLK_PERM_ALL & ~BLK_PERM_RESIZE; + + /* Step one: Take locks in shared mode */ + result =3D raw_apply_lock_bytes(fd, perm, shared, false, errp); + if (result < 0) { + goto out_close; + } + + /* Step two: Try to get them exclusively */ + result =3D raw_check_lock_bytes(fd, perm, shared, errp); + if (result < 0) { + goto out_close; + } + + /* Step three: Downgrade them to shared again, and keep + * them that way until we are done */ + result =3D raw_apply_lock_bytes(fd, perm, shared, true, errp); + if (result < 0) { + goto out_close; + } + + /* Clear the file by truncating it to 0 */ + result =3D raw_regular_truncate(fd, 0, PREALLOC_MODE_OFF, errp); + if (result < 0) { + goto out_close; + } + if (file_opts->nocow) { #ifdef __linux__ /* Set NOCOW flag to solve performance issue on fs like btrfs. @@ -2029,6 +2064,8 @@ static int raw_co_create(BlockdevCreateOptions *optio= ns, Error **errp) #endif } =20 + /* Resize and potentially preallocate the file to the desired + * final size */ result =3D raw_regular_truncate(fd, file_opts->size, file_opts->preall= ocation, errp); if (result < 0) { --=20 2.14.3 From nobody Sat Apr 27 08:40:13 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524262293013243.66615176860557; Fri, 20 Apr 2018 15:11:33 -0700 (PDT) Received: from localhost ([::1]:38315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9eFg-0003bp-81 for importer@patchew.org; Fri, 20 Apr 2018 18:11:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9eDh-0002FT-C3 for qemu-devel@nongnu.org; Fri, 20 Apr 2018 18:09:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9eDg-0000xO-9J for qemu-devel@nongnu.org; Fri, 20 Apr 2018 18:09:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44800 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9eDd-0000sb-AF; Fri, 20 Apr 2018 18:09:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 020047D83F; Fri, 20 Apr 2018 22:09:25 +0000 (UTC) Received: from localhost (ovpn-204-52.brq.redhat.com [10.40.204.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F7E42166BAD; Fri, 20 Apr 2018 22:09:24 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 21 Apr 2018 00:09:13 +0200 Message-Id: <20180420220913.27000-4-mreitz@redhat.com> In-Reply-To: <20180420220913.27000-1-mreitz@redhat.com> References: <20180420220913.27000-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 20 Apr 2018 22:09:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 20 Apr 2018 22:09:25 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mreitz@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 3/3] iotests: Add creation test to 153 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: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz 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" This patch adds a test case to 153 which tries to overwrite an image (using qemu-img create) while it is in use. Without the original user explicitly sharing the necessary permissions (writing and truncation), this should not be allowed. Signed-off-by: Max Reitz Reviewed-by: Fam Zheng --- tests/qemu-iotests/153 | 18 ++++++++++++++++++ tests/qemu-iotests/153.out | 13 +++++++++++++ 2 files changed, 31 insertions(+) diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153 index a0fd815483..1be83912f8 100755 --- a/tests/qemu-iotests/153 +++ b/tests/qemu-iotests/153 @@ -137,6 +137,24 @@ for opts1 in "" "read-only=3Don" "read-only=3Don,force= -share=3Don"; do _run_cmd $QEMU_IMG dd $L if=3D"${TEST_IMG}" of=3D"${TEST_= IMG}.convert" bs=3D512 count=3D1 _run_cmd $QEMU_IMG bench $L -c 1 "${TEST_IMG}" _run_cmd $QEMU_IMG bench $L -w -c 1 "${TEST_IMG}" + + # qemu-img create does not support -U + if [ -z "$L" ]; then + _run_cmd $QEMU_IMG create -f $IMGFMT "${TEST_IMG}" \ + -b ${TEST_IMG}.base + # Read the file format. It used to be the case that + # file-posix simply truncated the file, but the qcow2 + # driver then failed to format it because it was unable + # to acquire the necessary WRITE permission. However, the + # truncation was already wrong, and the whole process + # resulted in the file being completely empty and thus its + # format would be detected to be raw. + # So we read it here to see that creation either completed + # successfully (thus the format is qcow2) or it aborted + # before the file was changed at all (thus the format stays + # qcow2). + _img_info -U | grep 'file format' + fi done _send_qemu_cmd $h "{ 'execute': 'quit', }" "" echo diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out index bb721cb747..e8eb369cae 100644 --- a/tests/qemu-iotests/153.out +++ b/tests/qemu-iotests/153.out @@ -92,6 +92,11 @@ _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock Is another process using the image? =20 +_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base +qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock +Is another process using the image? +file format: IMGFMT + =3D=3D Running utility commands -U =3D=3D =20 _qemu_io_wrapper -U -c read 0 512 TEST_DIR/t.qcow2 @@ -209,6 +214,11 @@ _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2 qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock Is another process using the image? =20 +_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base +qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock +Is another process using the image? +file format: IMGFMT + =3D=3D Running utility commands -U =3D=3D =20 _qemu_io_wrapper -U -c read 0 512 TEST_DIR/t.qcow2 @@ -309,6 +319,9 @@ _qemu_img_wrapper bench -c 1 TEST_DIR/t.qcow2 =20 _qemu_img_wrapper bench -w -c 1 TEST_DIR/t.qcow2 =20 +_qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base +file format: IMGFMT + =3D=3D Running utility commands -U =3D=3D =20 _qemu_io_wrapper -U -c read 0 512 TEST_DIR/t.qcow2 --=20 2.14.3