From nobody Tue Nov 18 09:21:19 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1610042460; cv=none; d=zohomail.com; s=zohoarc; b=NTXEsQZlBrxjJDqP4XTZGsYqdMYQGXctgpFUGE7aqYdX+BGS7sa0VNGkoMuYY48JkgkYhtXQCQPfBHvocwIqBXyfJXRq6KsL82ZEUXnLuwBeU8bvMBhJtJ0Z0bt04L+0K3E9/TDpa+TBQK/3AFjnmMu0kdFqieAHKVoCeB9wL3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610042460; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=FLZaIYJ1q4mjgLVTgvrKIvmyDkyl2kANwLnc0+diaZo=; b=WiU44GKbJq2e4NCSkpXFxSnLxqtQwEt6yWWrqORu5XsefxKbnAKHIhcrIkhmTuoKsiJoKgWg6TBAyaWpBp2prchrTx+ku9Fy6D20sxxrT2KbLHIp0dSmiXWnnpKZ90hHzn3b1idwKNpQXj+z7fXqcqZbhb5twWNYYxVB/hZcCC8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610042460176403.59881999804213; Thu, 7 Jan 2021 10:01:00 -0800 (PST) Received: from localhost ([::1]:44124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxZai-00070b-82 for importer@patchew.org; Thu, 07 Jan 2021 13:00:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxZYT-0005dL-QK; Thu, 07 Jan 2021 12:58:37 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:59518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxZYP-00037y-UB; Thu, 07 Jan 2021 12:58:36 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 107HtRqI148162; Thu, 7 Jan 2021 17:58:19 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 35wepmdk84-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 07 Jan 2021 17:58:19 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 107HsxPs096664; Thu, 7 Jan 2021 17:56:18 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 35v1fbhnep-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Jan 2021 17:56:18 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 107HuEDZ013150; Thu, 7 Jan 2021 17:56:15 GMT Received: from disaster-area.hh.sledj.net (/81.187.26.238) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Jan 2021 09:55:40 -0800 Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 8da2db61; Thu, 7 Jan 2021 17:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=FLZaIYJ1q4mjgLVTgvrKIvmyDkyl2kANwLnc0+diaZo=; b=NgS3xLUiP/gcu4wyCKWZPLC92BmopX518LmOPbIRhp2YbQSGlQ8nedo0tmAQypjxF3aW 6IAiJ23C0oagdTK5kOD9pcd204EvhBcEQYafo4W0nIqx7pJvzHR2axA6bLeoBTBw9uTk P3txsdNL73lsrA8jpQVngpFcNtsoYQoHI6Ll+k6n+ieiUNlVx6JnGA8G+K17Ldh4u/2m Hfq9uvJCiVMz1n8WP6eum1Dam+h0SgLaubo3NROjaf0OZ3lSAswsAwQOPkbGqj5Dt2Tl adeA8ivwsghi20ZIn3TmhWkmCxAMFZLJlOwDFDJJuDiRzdD0Oi4x9aDNhlyZt0sUmvVm uA== From: David Edmondson To: qemu-devel@nongnu.org Subject: [PATCH v3] block: report errno when flock fcntl fails Date: Thu, 7 Jan 2021 17:55:38 +0000 Message-Id: <20210107175538.381304-1-david.edmondson@oracle.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 bulkscore=0 adultscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070105 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 clxscore=1011 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070105 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=141.146.126.78; envelope-from=david.edmondson@oracle.com; helo=aserp2120.oracle.com X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.246, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Reitz , David Edmondson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When a call to fcntl(2) for the purpose of manipulating file locks fails with an error other than EAGAIN or EACCES, report the error returned by fcntl. EAGAIN or EACCES are elided as they are considered to be common failures, indicating that a conflicting lock is held by another process. Signed-off-by: David Edmondson --- v3: - Remove the now unnecessary updates to the test framework (Max). - Elide the error detail for EAGAIN or EACCES when locking (Kevin, sort-of Max). - Philippe and Vladimir sent Reviewed-by, but things have changed noticeably, so I didn't add them (dme). block/file-posix.c | 52 +++++++++++++++++++++----- tests/qemu-iotests/153.out | 76 +++++++++++++++++++------------------- tests/qemu-iotests/182.out | 2 +- 3 files changed, 81 insertions(+), 49 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 00cdaaa2d4..c5142f7ffa 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -836,7 +836,13 @@ static int raw_apply_lock_bytes(BDRVRawState *s, int f= d, if ((perm_lock_bits & bit) && !(locked_perm & bit)) { ret =3D qemu_lock_fd(fd, off, 1, false); if (ret) { - error_setg(errp, "Failed to lock byte %d", off); + int err =3D -ret; + + if (err =3D=3D EAGAIN || err =3D=3D EACCES) { + error_setg(errp, "Failed to lock byte %d", off); + } else { + error_setg_errno(errp, err, "Failed to lock byte %d", = off); + } return ret; } else if (s) { s->locked_perm |=3D bit; @@ -844,7 +850,13 @@ static int raw_apply_lock_bytes(BDRVRawState *s, int f= d, } else if (unlock && (locked_perm & bit) && !(perm_lock_bits & bit= )) { ret =3D qemu_unlock_fd(fd, off, 1); if (ret) { - error_setg(errp, "Failed to unlock byte %d", off); + int err =3D -ret; + + if (err =3D=3D EAGAIN || err =3D=3D EACCES) { + error_setg(errp, "Failed to lock byte %d", off); + } else { + error_setg_errno(errp, err, "Failed to lock byte %d", = off); + } return ret; } else if (s) { s->locked_perm &=3D ~bit; @@ -857,7 +869,13 @@ static int raw_apply_lock_bytes(BDRVRawState *s, int f= d, if ((shared_perm_lock_bits & bit) && !(locked_shared_perm & bit)) { ret =3D qemu_lock_fd(fd, off, 1, false); if (ret) { - error_setg(errp, "Failed to lock byte %d", off); + int err =3D -ret; + + if (err =3D=3D EAGAIN || err =3D=3D EACCES) { + error_setg(errp, "Failed to lock byte %d", off); + } else { + error_setg_errno(errp, err, "Failed to lock byte %d", = off); + } return ret; } else if (s) { s->locked_shared_perm |=3D bit; @@ -866,7 +884,7 @@ static int raw_apply_lock_bytes(BDRVRawState *s, int fd, !(shared_perm_lock_bits & bit)) { ret =3D qemu_unlock_fd(fd, off, 1); if (ret) { - error_setg(errp, "Failed to unlock byte %d", off); + error_setg_errno(errp, -ret, "Failed to unlock byte %d", o= ff); return ret; } else if (s) { s->locked_shared_perm &=3D ~bit; @@ -890,9 +908,16 @@ static int raw_check_lock_bytes(int fd, uint64_t perm,= uint64_t shared_perm, ret =3D qemu_lock_fd_test(fd, off, 1, true); if (ret) { char *perm_name =3D bdrv_perm_names(p); - error_setg(errp, - "Failed to get \"%s\" lock", - perm_name); + int err =3D -ret; + + if (err =3D=3D EAGAIN || err =3D=3D EACCES) { + error_setg(errp, "Failed to get \"%s\" lock", + perm_name); + } else { + error_setg_errno(errp, err, + "Failed to get \"%s\" lock", + perm_name); + } g_free(perm_name); return ret; } @@ -905,9 +930,16 @@ static int raw_check_lock_bytes(int fd, uint64_t perm,= uint64_t shared_perm, ret =3D qemu_lock_fd_test(fd, off, 1, true); if (ret) { char *perm_name =3D bdrv_perm_names(p); - error_setg(errp, - "Failed to get shared \"%s\" lock", - perm_name); + int err =3D -ret; + + if (err =3D=3D EAGAIN || err =3D=3D EACCES) { + error_setg(errp, "Failed to get shared \"%s\" lock", + perm_name); + } else { + error_setg_errno(errp, err, + "Failed to get shared \"%s\" lock", + perm_name); + } g_free(perm_name); return ret; } diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out index ff8e55864a..14da13a1a5 100644 --- a/tests/qemu-iotests/153.out +++ b/tests/qemu-iotests/153.out @@ -11,11 +11,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D335= 54432 backing_file=3DTEST_DIR/t =3D=3D Launching QEMU, opts: '' =3D=3D =20 =3D=3D Launching another QEMU, opts: '' =3D=3D -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,: Failed to get "write= " lock +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,: Failed to get "write= " lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Launching another QEMU, opts: 'read-only=3Don' =3D=3D -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,read-only=3Don: Failed= to get shared "write" lock +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,read-only=3Don: Failed= to get shared "write" lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Launching another QEMU, opts: 'read-only=3Don,force-share=3Don' =3D= =3D @@ -23,77 +23,77 @@ Is another process using the image [TEST_DIR/t.qcow2]? =3D=3D Running utility commands =3D=3D =20 _qemu_io_wrapper -c read 0 512 TEST_DIR/t.qcow2 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_io_wrapper -r -c read 0 512 TEST_DIR/t.qcow2 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get shared "write" = lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_io_wrapper -c open TEST_DIR/t.qcow2 -c read 0 512 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? no file open, try 'help open' =20 _qemu_io_wrapper -c open -r TEST_DIR/t.qcow2 -c read 0 512 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get shared "write" = lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? no file open, try 'help open' =20 _qemu_img_wrapper info TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper check TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper compare TEST_DIR/t.qcow2 TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper map TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper amend -o size=3D32M TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper commit TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper snapshot -l TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper convert TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.convert -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper dd if=3DTEST_DIR/t.qcow2 of=3DTEST_DIR/t.qcow2.convert b= s=3D512 count=3D1 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper bench -c 1 TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get shared "write" = lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _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 +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.bas= e -F qcow2 -qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock: Resource temporari= ly unavailable Is another process using the image [TEST_DIR/t.qcow2]? file format: IMGFMT backing file format: IMGFMT @@ -132,7 +132,7 @@ qemu-img: unrecognized option '-U' Try 'qemu-img --help' for more information =20 _qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F q= cow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper snapshot -l -U TEST_DIR/t.qcow2 @@ -158,7 +158,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D335= 54432 backing_file=3DTEST_DIR/t =3D=3D Launching QEMU, opts: 'read-only=3Don' =3D=3D =20 =3D=3D Launching another QEMU, opts: '' =3D=3D -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,: Failed to get "write= " lock +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,: Failed to get "write= " lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Launching another QEMU, opts: 'read-only=3Don' =3D=3D @@ -168,13 +168,13 @@ Is another process using the image [TEST_DIR/t.qcow2]? =3D=3D Running utility commands =3D=3D =20 _qemu_io_wrapper -c read 0 512 TEST_DIR/t.qcow2 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_io_wrapper -r -c read 0 512 TEST_DIR/t.qcow2 =20 _qemu_io_wrapper -c open TEST_DIR/t.qcow2 -c read 0 512 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? no file open, try 'help open' =20 @@ -189,19 +189,19 @@ _qemu_img_wrapper compare TEST_DIR/t.qcow2 TEST_DIR/t= .qcow2 _qemu_img_wrapper map TEST_DIR/t.qcow2 =20 _qemu_img_wrapper amend -o size=3D32M TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper commit TEST_DIR/t.qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper resize TEST_DIR/t.qcow2 32M -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper rebase TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F qcow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper snapshot -l TEST_DIR/t.qcow2 @@ -213,11 +213,11 @@ _qemu_img_wrapper dd if=3DTEST_DIR/t.qcow2 of=3DTEST_= DIR/t.qcow2.convert bs=3D512 coun _qemu_img_wrapper bench -c 1 TEST_DIR/t.qcow2 =20 _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 +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper create -f qcow2 TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.bas= e -F qcow2 -qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-img: TEST_DIR/t.qcow2: Failed to get "write" lock: Resource temporari= ly unavailable Is another process using the image [TEST_DIR/t.qcow2]? file format: IMGFMT backing file format: IMGFMT @@ -256,7 +256,7 @@ qemu-img: unrecognized option '-U' Try 'qemu-img --help' for more information =20 _qemu_img_wrapper rebase -U TEST_DIR/t.qcow2 -b TEST_DIR/t.qcow2.base -F q= cow2 -qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock +qemu-img: Could not open 'TEST_DIR/t.qcow2': Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 _qemu_img_wrapper snapshot -l -U TEST_DIR/t.qcow2 @@ -377,17 +377,17 @@ qemu-img: Could not open 'TEST_DIR/t.qcow2': force-sh= are=3Don can only be used wit Round done =20 =3D=3D Two devices with the same image (read-only=3Doff - read-only=3Doff)= =3D=3D -QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2,read-only=3Doff: Faile= d to get "write" lock +QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2,read-only=3Doff: Faile= d to get "write" lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Two devices with the same image (read-only=3Doff - read-only=3Don) = =3D=3D -QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2,read-only=3Don: Failed= to get shared "write" lock +QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2,read-only=3Don: Failed= to get shared "write" lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Two devices with the same image (read-only=3Doff - read-only=3Don,f= orce-share=3Don) =3D=3D =20 =3D=3D Two devices with the same image (read-only=3Don - read-only=3Doff) = =3D=3D -QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2,read-only=3Doff: Faile= d to get "write" lock +QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2,read-only=3Doff: Faile= d to get "write" lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Two devices with the same image (read-only=3Don - read-only=3Don) = =3D=3D @@ -408,13 +408,13 @@ Formatting 'TEST_DIR/t.IMGFMT.c', fmt=3DIMGFMT size= =3D33554432 backing_file=3DTEST_DIR =3D=3D Two devices sharing the same file in backing chain =3D=3D =20 =3D=3D Backing image also as an active device =3D=3D -QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2: Failed to get "write"= lock +QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2: Failed to get "write"= lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Backing image also as an active device (ro) =3D=3D =20 =3D=3D Symbolic link =3D=3D -QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2: Failed to get "write"= lock +QEMU_PROG: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2: Failed to get "write"= lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D Active commit to intermediate layer should work when base in use = =3D=3D @@ -430,7 +430,7 @@ Adding drive {"return": "OKrn"} =20 _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? Creating overlay with qemu-img when the guest is running should be allowed =20 @@ -455,7 +455,7 @@ _qemu_img_wrapper info TEST_DIR/t.qcow2 {"return": ""} =20 _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 -qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock: R= esource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? Closing the other { 'execute': 'human-monitor-command', diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out index 57f7265458..0e23f30f84 100644 --- a/tests/qemu-iotests/182.out +++ b/tests/qemu-iotests/182.out @@ -3,7 +3,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D33554432 Starting QEMU =20 Starting a second QEMU using the same image should fail -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,id=3Ddrive0,file.locki= ng=3Don: Failed to get "write" lock +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,id=3Ddrive0,file.locki= ng=3Don: Failed to get "write" lock: Resource temporarily unavailable Is another process using the image [TEST_DIR/t.qcow2]? =20 =3D=3D=3D Testing reopen =3D=3D=3D --=20 2.29.2