From nobody Mon Feb 9 17:25:22 2026 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1657592608; cv=none; d=zohomail.com; s=zohoarc; b=Hodmb93Tb7u5cCbSJacm8pDg/0CpWX5CmBXiZteBMgHWLBG7Cr+zgAN+8O5jR07wvmYs8BIxj2GAdOCy50R5l1pTzfbhrvNzw5jiypOVVp73CE/4+o10rHmDOPPj5L2FoNoAYL0RK2CXZqN8hBUJJ1l4A9MBlRGXrqYjTLACoUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657592608; 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; bh=QDjrm0H7uHOnTUuOuooiPn3aOFoherhF8zUE9XmuL88=; b=FGOWrARF3BtQwBi1DCkk7cymUIqlYHBEcH8kbnMdwEgy19T1vijq986fIfvBppEGkTqkppiUZVeuJJFsx+tniwqBEIbBXezB/xMtaGyxP6FOl6Su8F1ndWWMxouf1GkoXVRI2CQNGX+cqnkJnIpsbuR1gpZ7iRN8MC0h62lqOXE= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657592608672194.45771305023254; Mon, 11 Jul 2022 19:23:28 -0700 (PDT) Received: from localhost ([::1]:56404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oB5Yd-0005KB-JV for importer@patchew.org; Mon, 11 Jul 2022 22:23:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oB5Pk-0000y8-O6; Mon, 11 Jul 2022 22:14:18 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:44988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oB5Pi-0007xZ-0d; Mon, 11 Jul 2022 22:14:16 -0400 Received: by mail-pg1-x529.google.com with SMTP id bf13so6294562pgb.11; Mon, 11 Jul 2022 19:14:11 -0700 (PDT) Received: from roots.. ([106.84.131.214]) by smtp.gmail.com with ESMTPSA id k22-20020aa79736000000b00528f9597fb3sm5430251pfg.197.2022.07.11.19.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 19:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QDjrm0H7uHOnTUuOuooiPn3aOFoherhF8zUE9XmuL88=; b=LtIVi7p94WuIQ52U/gPGAa/TFO96Do0KvQOu0d5mWOpAXq0gZyGY/aGAgwsl4NF4Bg e7z39ceIYc9hDXYjnz9v8IQX37hNIzgswuSb+9YmXtfnVvzxqFKZhnbKcW6X8kaMyIXP jUsiEfZEhB/1HktnX5Cc5AoG94m3+PjvXZireg+GsGzXKGFgnNn91/KyhgxWnSt2oGmL BRfGr+ikOHIXk8mxbjjRqzfo0JWfD0LJK3EmBlsPfZMdA13c6XmGXWCEWnvxIjDnSgNp TKsoEbGCgbgFtySCHSOcxiL2rGMFW4UNxyvS0B6uuV0CflGzmZ73dqKPBXIcOZ1++TIR fgeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QDjrm0H7uHOnTUuOuooiPn3aOFoherhF8zUE9XmuL88=; b=0TbsPVvYz3nT+42gNwi5XGLN4TkmTFX4Lw/5qekBIleOWg3thwyOs3315bQjvD4wls qndCgdrCWi8f9NU5o6sA7JKeqhlvfpcxPb646lmER1Qvntw1a7sLTJaM3CGGeuUW4/il wh2dLUxlkbmTlKu+vm4skDwyWKH1oWDIDpBw06qUO8PUiIGS2vgGWuAlIXnsvuCZ0iMx 8VGPuBZplM0RXuvEKHAR2zosVVF/GhUQygVTFdHOBxJRokhTT5QXlszulxSBYW/vfHWG XZviTvoMPEkhPWPfkzq5/xaYqRBtdIIxlSjkH5WGvBD1N9nLaezSEnOu8fTXzksZJQ0C yycg== X-Gm-Message-State: AJIora9A7c5J7CpgUR3571uMT2ugzXQBr0xZTy2ym0f10NveDs8H9ixu 3RFseMVbtZjGSxBpMAsZxFOvx5L+S0K4y7fL X-Google-Smtp-Source: AGRyM1tpksMFeuWGmUdWJl0St15+/XCB5D+MYNUqTr66K1+3g9SPzqZl8HICOBMAyGaT/7E8CiSbvg== X-Received: by 2002:a63:ea55:0:b0:412:290c:9694 with SMTP id l21-20020a63ea55000000b00412290c9694mr18762569pgk.39.1657592051149; Mon, 11 Jul 2022 19:14:11 -0700 (PDT) From: Sam Li To: qemu-devel@nongnu.org Cc: damien.lemoal@opensource.wdc.com, Markus Armbruster , dmitry.fomichev@wdc.com, Stefan Hajnoczi , Hanna Reitz , qemu-block@nongnu.org, Eric Blake , Kevin Wolf , Fam Zheng , hare@suse.de, Sam Li Subject: [RFC v4 5/9] qemu-iotests: test new zone operations. Date: Tue, 12 Jul 2022 10:13:41 +0800 Message-Id: <20220712021345.8530-6-faithilikerun@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220712021345.8530-1-faithilikerun@gmail.com> References: <20220712021345.8530-1-faithilikerun@gmail.com> 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=2607:f8b0:4864:20::529; envelope-from=faithilikerun@gmail.com; helo=mail-pg1-x529.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1657592609489100001 Content-Type: text/plain; charset="utf-8" We have added new block layer APIs of zoned block devices. Test it with: (1) Create a null_blk device, run each zone operation on it and see whether reporting right zone information. Signed-off-by: Sam Li --- tests/qemu-iotests/tests/zoned.sh | 69 +++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 tests/qemu-iotests/tests/zoned.sh diff --git a/tests/qemu-iotests/tests/zoned.sh b/tests/qemu-iotests/tests/z= oned.sh new file mode 100755 index 0000000000..e14a3a420e --- /dev/null +++ b/tests/qemu-iotests/tests/zoned.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash +# +# Test zone management operations. +# + +seq=3D"$(basename $0)" +echo "QA output created by $seq" +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img + sudo rmmod null_blk +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.qemu + +# This test only runs on Linux hosts with raw image files. +_supported_fmt raw +_supported_proto file +_supported_os Linux + +QEMU_IO=3D"build/qemu-io" +IMG=3D"--image-opts driver=3Dzoned_host_device,filename=3D/dev/nullb0" +QEMU_IO_OPTIONS=3D$QEMU_IO_OPTIONS_NO_FMT + +echo "Testing a null_blk device" +echo "Simple cases: if the operations work" +sudo modprobe null_blk nr_devices=3D1 zoned=3D1 +# hidden issues: +# 1. memory allocation error of "unaligned tcache chunk detected" when the= nr_zone=3D1 in zone report +# 2. qemu-io: after report 10 zones, the program failed at double free err= or and exited. +echo "report the first zone" +sudo $QEMU_IO $IMG -c "zr 0 0 1" +echo "report: the first 10 zones" +sudo $QEMU_IO $IMG -c "zr 0 0 10" + +echo "open the first zone" +sudo $QEMU_IO $IMG -c "zo 0 0x80000" +echo "report after:" +sudo $QEMU_IO $IMG -c "zr 0 0 1" +echo "open the last zone" +sudo $QEMU_IO $IMG -c "zo 0x3e70000000 0x80000" +echo "report after:" +sudo $QEMU_IO $IMG -c "zr 0x3e70000000 0 2" + +echo "close the first zone" +sudo $QEMU_IO $IMG -c "zc 0 0x80000" +echo "report after:" +sudo $QEMU_IO $IMG -c "zr 0 0 1" +echo "close the last zone" +sudo $QEMU_IO $IMG -c "zc 0x3e70000000 0x80000" +echo "report after:" +sudo $QEMU_IO $IMG -c "zr 0x3e70000000 0 2" + + +echo "reset the second zone" +sudo $QEMU_IO $IMG -c "zrs 0x80000 0x80000" +echo "After resetting a zone:" +sudo $QEMU_IO $IMG -c "zr 0x80000 0 5" + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 --=20 2.36.1