From nobody Tue Nov 11 17:32:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1564414194; cv=none; d=zoho.com; s=zohoarc; b=QhtZ7ql7ad/24Kif1fZUCKE/dn9pJNtQS+2E54QzQadn+HMjn0bJvAdL0+QYnbGxZ1JTTgOu23xHzq9BJKG/bkS51lV5dq/rrech1Kali0z0iuB4PCSq3+ZHq/VLiSaCp6N3UNd1CvoBbtZ6MhkVrmCPGvd62665bKDnXSj8lVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564414194; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gOorbCfkOfD5hZ9Ne/IGI2m869VvMpyg8Fi+6sPnwi8=; b=J1hg0TZVUkHlijGUPrb98xsNh/IldtUDRUQQJ4Jw+X/cQsO9Ty2XbrMz0L74noUQTQHCQQMofaaGYjODVDZP0gG8MCdFbnRh3p7lW1kO+CxjRzr2u5Pzr6PYe5oDpva85Uvq6MxmSkjhSbrozQfljfZtjIuspFU1ib9UK52EW7w= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1564414194393590.6117140918072; Mon, 29 Jul 2019 08:29:54 -0700 (PDT) Received: from localhost ([::1]:53976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7ax-0005VE-N3 for importer@patchew.org; Mon, 29 Jul 2019 11:29:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44159) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7Qf-0000Sd-BK for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:19:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs7Qe-000298-2C for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:19:13 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:38384) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hs7Qd-00026N-RX; Mon, 29 Jul 2019 11:19:11 -0400 Received: by mail-pg1-x541.google.com with SMTP id f5so19605898pgu.5; Mon, 29 Jul 2019 08:19:11 -0700 (PDT) Received: from localhost.localdomain ([136.233.9.97]) by smtp.gmail.com with ESMTPSA id h129sm58693941pfb.110.2019.07.29.08.19.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 08:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gOorbCfkOfD5hZ9Ne/IGI2m869VvMpyg8Fi+6sPnwi8=; b=F1G6OjQEueVHGDuOxyiPHc/6rCXIpTHvBUxDKg/GCcSs7LIom8AHRKoVzpeGTt0kl1 AHwgGNguLmZQbE/2H+3CvRrKuWgippajWFoUFLlIKFstyGEp649gMHswlVcEvyglMk0Y /+Bf3gd2t4SI8uNc/bxPrP/E9c3UOX3u5PklkDRcPsm24HnJzVsXqblo4OJmLKI2hnuq RudvuXeFWtylYu4MuACDcIlSO0g/Nn5Ez9tAPT/Bo2pOcTE7gZfKNzr83sWXAtPhfc28 drWwByGMWHse3DXertNDAmDXXdco0VKkqgXSvTABuResxGzV9mot+7fXOkWdly4PVpYS vKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gOorbCfkOfD5hZ9Ne/IGI2m869VvMpyg8Fi+6sPnwi8=; b=Angjjw8uxKZb3t6E1n1WZuL4uWU8X6EEXkki+kHcxX8+kDBMkxrIthAW6J/uzmSZOL /M+bcwxmL+gfNqqppcwOnzNQ1tknMMA1LyQAV3sP1zRwDT1GFvBxY5eirNTPbQY5g1FA XY1bRXU1AImfj7chtfKmVTHZhdps1hDgByf3VHdn7F3m5LoftGUs9YF6U4bL8R565rNK jfY+WOLFMnCi4u3KOSzcgIn2vgEV69dPVaC7dd4qZvEwLFjZ7wMbIYD9PDhzYvr6ScpU GrFwo/G+RqP05xf7lKteXCOKufShSiMy4upiTBlO/uJVHKutUrxvnHunHC0BxNnimrpc ZLbQ== X-Gm-Message-State: APjAAAUEmk6s5lusdlJvRm/NcQTAjU01b7v9y1MW81B+qbrgV3iVsq6a iwdhzCGmooC+BUy1I5ehcI8Dtz5rlo4iGQ== X-Google-Smtp-Source: APXvYqx7ATTByWezOb6rtvkEfSN65BlA2JSe7DJoZbU+CNhr2MziYjNcj2wbP/ZRlbiUTdg1kapMYw== X-Received: by 2002:a63:c50f:: with SMTP id f15mr5133443pgd.372.1564413550517; Mon, 29 Jul 2019 08:19:10 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 20:46:50 +0530 Message-Id: <20190729151651.21306-15-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190729151651.21306-1-mehta.aaru20@gmail.com> References: <20190729151651.21306-1-mehta.aaru20@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 Subject: [Qemu-devel] [PATCH v7 14/15] tests/qemu-iotests: enable testing with aio options 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: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, Sergio Lopez , Markus Armbruster , Maxim Levitsky , saket.sinha89@gmail.com, Max Reitz , Stefan Hajnoczi , Paolo Bonzini , Stefan Hajnoczi , Julia Suvorova , Aarushi Mehta 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" Signed-off-by: Aarushi Mehta Reviewed-by: Stefan Hajnoczi --- tests/qemu-iotests/check | 15 ++++++++++++++- tests/qemu-iotests/common.rc | 14 ++++++++++++++ tests/qemu-iotests/iotests.py | 9 ++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index c24874ff4a..1e398923fd 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -132,6 +132,7 @@ sortme=3Dfalse expunge=3Dtrue have_test_arg=3Dfalse cachemode=3Dfalse +aiomode=3Dfalse =20 tmp=3D"${TEST_DIR}"/$$ rm -f $tmp.list $tmp.tmp $tmp.sed @@ -141,6 +142,7 @@ export IMGFMT_GENERIC=3Dtrue export IMGPROTO=3Dfile export IMGOPTS=3D"" export CACHEMODE=3D"writeback" +export AIOMODE=3D"threads" export QEMU_IO_OPTIONS=3D"" export QEMU_IO_OPTIONS_NO_FMT=3D"" export CACHEMODE_IS_DEFAULT=3Dtrue @@ -225,6 +227,11 @@ s/ .*//p CACHEMODE_IS_DEFAULT=3Dfalse cachemode=3Dfalse continue + elif $aiomode + then + AIOMODE=3D"$r" + aiomode=3Dfalse + continue fi =20 xpand=3Dtrue @@ -269,6 +276,7 @@ other options -n show me, do not run tests -o options -o options to pass to qemu-img create/convert -c mode cache mode + -i mode AIO mode -makecheck pretty print output for make check =20 testlist options @@ -433,10 +441,13 @@ testlist options cachemode=3Dtrue xpand=3Dfalse ;; + -i) + aiomode=3Dtrue + xpand=3Dfalse + ;; -T) # deprecated timestamp option xpand=3Dfalse ;; - -v) verbose=3Dtrue xpand=3Dfalse @@ -515,6 +526,8 @@ done =20 # Set qemu-io cache mode with $CACHEMODE we have QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS --cache $CACHEMODE" +# Set qemu-io aio mode with $AIOMODE we have +QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS --aio $AIOMODE" =20 QEMU_IO_OPTIONS_NO_FMT=3D"$QEMU_IO_OPTIONS" if [ "$IMGOPTSSYNTAX" !=3D "true" ]; then diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 5502c3da2f..03f4a1cd7f 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -490,6 +490,20 @@ _default_cache_mode() return fi } +_supported_aio_modes() +{ + for mode; do + if [ "$mode" =3D "$AIOMODE" ]; then + return + fi + done + _notrun "not suitable for aio mode: $AIOMODE" +} +_default_aio_mode() +{ + AIOMODE=3D"$1" + QEMU_IO=3D"$QEMU_IO --aio $1" +} =20 _unsupported_imgopts() { diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ce74177ab1..76f1ab0945 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -58,6 +58,7 @@ imgproto =3D os.environ.get('IMGPROTO', 'file') test_dir =3D os.environ.get('TEST_DIR') output_dir =3D os.environ.get('OUTPUT_DIR', '.') cachemode =3D os.environ.get('CACHEMODE') +aiomode =3D os.environ.get('AIOMODE') qemu_default_machine =3D os.environ.get('QEMU_DEFAULT_MACHINE') =20 socket_scm_helper =3D os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_help= er') @@ -457,6 +458,7 @@ class VM(qtest.QEMUQtestMachine): options.append('file=3D%s' % path) options.append('format=3D%s' % format) options.append('cache=3D%s' % cachemode) + options.append('aio=3D%s' % aiomode) =20 if opts: options.append(opts) @@ -799,6 +801,10 @@ def verify_cache_mode(supported_cache_modes=3D[]): if supported_cache_modes and (cachemode not in supported_cache_modes): notrun('not suitable for this cache mode: %s' % cachemode) =20 +def verify_aio_mode(supported_aio_modes=3D[]): + if supported_aio_modes and (aiomode not in supported_aio_modes): + notrun('not suitable for this aio mode: %s' % aiomode) + def supports_quorum(): return 'quorum' in qemu_img_pipe('--help') =20 @@ -843,7 +849,7 @@ def skip_if_unsupported(required_formats=3D[], read_onl= y=3DFalse): return skip_test_decorator =20 def main(supported_fmts=3D[], supported_oses=3D['linux'], supported_cache_= modes=3D[], - unsupported_fmts=3D[]): + supported_aio_modes=3D[], unsupported_fmts=3D[]): '''Run tests''' =20 global debug @@ -861,6 +867,7 @@ def main(supported_fmts=3D[], supported_oses=3D['linux'= ], supported_cache_modes=3D[], verify_image_format(supported_fmts, unsupported_fmts) verify_platform(supported_oses) verify_cache_mode(supported_cache_modes) + verify_aio_mode(supported_aio_modes) =20 if debug: output =3D sys.stdout --=20 2.21.0