From nobody Tue Feb 10 04:14:03 2026 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 1510191846196324.3544897481744; Wed, 8 Nov 2017 17:44:06 -0800 (PST) Received: from localhost ([::1]:34749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCbsx-0006So-HD for importer@patchew.org; Wed, 08 Nov 2017 20:44:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCbnr-0003Lq-GF for qemu-devel@nongnu.org; Wed, 08 Nov 2017 20:38:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCbnm-0004Iv-Rx for qemu-devel@nongnu.org; Wed, 08 Nov 2017 20:38:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45192) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eCbne-0004EN-7E; Wed, 08 Nov 2017 20:38:34 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 594AD81DEA; Thu, 9 Nov 2017 01:38:33 +0000 (UTC) Received: from localhost (ovpn-204-35.brq.redhat.com [10.40.204.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7051660BE3; Thu, 9 Nov 2017 01:38:30 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Thu, 9 Nov 2017 02:38:04 +0100 Message-Id: <20171109013804.14488-6-mreitz@redhat.com> In-Reply-To: <20171109013804.14488-1-mreitz@redhat.com> References: <20171109013804.14488-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 09 Nov 2017 01:38:33 +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 5/5] iotests: Make 136 less flaky 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, Stefan Hajnoczi , 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" 136 executes some AIO requests without a final aio_flush; then it advances the virtual clock and thus expects the last access time of the device to be less than the current time when queried (i.e. idle_time_ns to be greater than 0). However, without the aio_flush, some requests may be settled after the clock_step invocation. In that case, idle_time_ns would be 0 and the test fails. Fix this by adding an aio_flush if any AIO request but some other aio_flush has been executed. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/136 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/136 b/tests/qemu-iotests/136 index 4b994897af..88b97ea7c6 100644 --- a/tests/qemu-iotests/136 +++ b/tests/qemu-iotests/136 @@ -238,6 +238,18 @@ sector =3D "%d" for i in range(failed_wr_ops): ops.append("aio_write %d 512" % bad_offset) =20 + # We need an extra aio_flush to settle all outstanding AIO + # operations before we can advance the virtual clock, so that + # the last access happens before clock_step and idle_time_ns + # will be greater than 0 + extra_flush =3D 0 + if rd_ops + wr_ops + invalid_rd_ops + invalid_wr_ops + \ + failed_rd_ops + failed_wr_ops > 0: + extra_flush =3D 1 + + if extra_flush > 0: + ops.append("aio_flush") + if failed_wr_ops > 0: highest_offset =3D max(highest_offset, bad_offset + 512) =20 @@ -251,7 +263,7 @@ sector =3D "%d" self.total_wr_bytes +=3D wr_ops * wr_size self.total_wr_ops +=3D wr_ops self.total_wr_merged +=3D wr_merged - self.total_flush_ops +=3D flush_ops + self.total_flush_ops +=3D flush_ops + extra_flush self.invalid_rd_ops +=3D invalid_rd_ops self.invalid_wr_ops +=3D invalid_wr_ops self.failed_rd_ops +=3D failed_rd_ops --=20 2.13.6