From nobody Wed Nov 19 18:56:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1702301575; cv=none; d=zohomail.com; s=zohoarc; b=J9eR/pC7TxqF2XdlbLIDvmsn2rpV/QGi5tqKUk6ymLBeW72gW0V3k0UyoGlofAESEFkl5twsQv2MYTVRNTmoh4Q84XX1/QOWD2r1KMO11tETg96cSfbn7AuvhE4hHhe9DsK1v+abNr8fpcIx4/xify0EhGmMb1MGEgbUKFo5AAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702301575; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MrAjrlwGGat3xO6OBtrWFbhQBphjfZVOk2fzVKzqyfs=; b=Zxdy1H5doLWVM0C8+2VYn1lfxoS2AMhYTj0lPnL4ymWkQgPRPHut87/bKj0JsEmzfWYPiy2Rrn6SjMQWiNkkoSS7kEasUWEal+CnrL7xDCWnlnNaJ5LXZAvQlGhFsthcxOkcgaEPlGDBn2WObzVAhQCVtgBsjdWbwp2TQKFdYJo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1702301575961767.0573488816366; Mon, 11 Dec 2023 05:32:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCgOq-0000XS-PX; Mon, 11 Dec 2023 08:32:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCgOe-00007S-Jn; Mon, 11 Dec 2023 08:32:32 -0500 Received: from relay.virtuozzo.com ([130.117.225.111]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCgOb-00029U-Bp; Mon, 11 Dec 2023 08:32:32 -0500 Received: from [130.117.225.1] (helo=dev005.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1rCgMg-000OBz-2v; Mon, 11 Dec 2023 14:32:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-Id:Date:Subject:From: Content-Type; bh=MrAjrlwGGat3xO6OBtrWFbhQBphjfZVOk2fzVKzqyfs=; b=qm9at66Z14fs HqAirXrXWEDZhTMjMSPC7fYJQcYBDxtSHFUR4DkM4keyNs4ROb/FebCykpHYnoW6E3CuK9NqvUf1e NJOTLY04VhrFlFzPD7qGd/3vEFWaC2KuSbmPP2OV0T2NAIXduJ2GiFY4UCYoLLQX+Hua9Z0WTV4kH mDuwD5OdX3UtCXIzRrlDsvleh/kg7Xv2kth+FPrE31cTi4P3WEfCQgtADEK8RkMzRFeudFal1n99o jSG16YP87GskXkq3CyyTj24uu8mE6P7lq8OvJMAOH9MEiLFhCZu9hfCktAjAv3B4WRsiYYgcuqzXX 2TYdwXaVayxfpVmYpzGL2A==; From: Andrey Drobyshev To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, kwolf@redhat.com, hreitz@redhat.com, andrey.drobyshev@virtuozzo.com, den@virtuozzo.com Subject: [PATCH] iotests: don't run tests requiring cached writes in '-nocache' mode Date: Mon, 11 Dec 2023 15:32:23 +0200 Message-Id: <20231211133223.695048-1-andrey.drobyshev@virtuozzo.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=130.117.225.111; envelope-from=andrey.drobyshev@virtuozzo.com; helo=relay.virtuozzo.com 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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1702301577507100001 Content-Type: text/plain; charset="utf-8" There're tests whose logic implies running without O_DIRECT set, otherwise they fail when running iotests in '-nocache' mode. For these tests let's add _require_no_o_direct() helper which can be put in the preabmle and which makes sure '-nocache' isn't set. Use it to skip running the following tests: * 271: creates files with unaligned sizes, thus producing multiple errors like: qemu-io: can't open device /path/to/t.qcow2.raw: Cannot get 'write' permission without 'resize': Image size is not a multiple of request alignm= ent * 308, file-io-error: use fuse exports. Though fuse does have 'direct-io' mode (see https://docs.kernel.org/filesystems/fuse-io.html) we aren't using it yet, thus getting errors like: qemu-io: can't open device /path/to/t.qcow2.fuse: Could not open '/path/to/t.qcow2.fuse': filesystem does not support O_DIRECT Signed-off-by: Andrey Drobyshev Reviewed-by: Eric Blake --- tests/qemu-iotests/271 | 1 + tests/qemu-iotests/308 | 2 ++ tests/qemu-iotests/common.rc | 7 +++++++ tests/qemu-iotests/tests/file-io-error | 1 + 4 files changed, 11 insertions(+) diff --git a/tests/qemu-iotests/271 b/tests/qemu-iotests/271 index 59a6fafa2f..1424b6954d 100755 --- a/tests/qemu-iotests/271 +++ b/tests/qemu-iotests/271 @@ -44,6 +44,7 @@ _supported_fmt qcow2 _supported_proto file nfs _supported_os Linux _unsupported_imgopts extended_l2 compat=3D0.10 cluster_size data_file refc= ount_bits=3D1[^0-9] +_require_no_o_direct =20 l2_offset=3D$((0x40000)) =20 diff --git a/tests/qemu-iotests/308 b/tests/qemu-iotests/308 index de12b2b1b9..535455e5b1 100755 --- a/tests/qemu-iotests/308 +++ b/tests/qemu-iotests/308 @@ -52,6 +52,8 @@ _unsupported_fmt vpc _supported_proto file # We create the FUSE export manually _supported_os Linux # We need /dev/urandom =20 +_require_no_o_direct + # $1: Export ID # $2: Options (beyond the node-name and ID) # $3: Expected return value (defaults to 'return') diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 95c12577dd..f61eae73b4 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -857,6 +857,13 @@ _check_o_direct() [[ "$out" !=3D *"O_DIRECT"* ]] } =20 +_require_no_o_direct() +{ + if [ $CACHEMODE =3D=3D "none" ] || [ $CACHEMODE =3D=3D "directsync" ];= then + _notrun "not suitable for cache mode: $CACHEMODE (implies O_DIRECT= )" + fi +} + _require_o_direct() { if ! _check_o_direct; then diff --git a/tests/qemu-iotests/tests/file-io-error b/tests/qemu-iotests/te= sts/file-io-error index 88ee5f670c..2b8dc7f009 100755 --- a/tests/qemu-iotests/tests/file-io-error +++ b/tests/qemu-iotests/tests/file-io-error @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Format-agnostic (we do not use any), but we do test the file protocol _supported_proto file _require_drivers blkdebug null-co +_require_no_o_direct =20 if [ "$IMGOPTSSYNTAX" =3D "true" ]; then # We need `$QEMU_IO -f file` to work; IMGOPTSSYNTAX uses --image-opts, --=20 2.39.3