From patchwork Mon Feb 12 13:14:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10212767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C990260467 for ; Mon, 12 Feb 2018 13:16:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2015280CF for ; Mon, 12 Feb 2018 13:16:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6D0C28916; Mon, 12 Feb 2018 13:16:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0215B280CF for ; Mon, 12 Feb 2018 13:16:32 +0000 (UTC) Received: from localhost ([::1]:57865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDyB-0004mD-LU for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Feb 2018 08:16:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elDwJ-0003Uo-Gz for qemu-devel@nongnu.org; Mon, 12 Feb 2018 08:14:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elDwF-0008Bj-Dc for qemu-devel@nongnu.org; Mon, 12 Feb 2018 08:14:35 -0500 Received: from mail-ve1eur01on0108.outbound.protection.outlook.com ([104.47.1.108]:37136 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elDwF-0008Aa-3s; Mon, 12 Feb 2018 08:14:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mnikJA2AcljD3FUU5laYfcUWKu+JFIZD5/Cfrq/V3hY=; b=NclsSHenP/2CYs8/XIAEbpXoYjqDaIJmpPRsnWWeq0660QWVJoCf+sa335j11EgN8GbXn5Gcej7/9mlJEBE3dOV2jiNsco9jtkM9yWwGmuu3804hhUy86GD465vTqyL+htQHzTfONTDXCkK9elh0MXo3cgrCUn4kaxl6A6tlSo8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB1997.eurprd08.prod.outlook.com (2603:10a6:800:8a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Mon, 12 Feb 2018 13:14:28 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 12 Feb 2018 16:14:00 +0300 Message-Id: <1518441241-32557-2-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518441241-32557-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1518441241-32557-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1P190CA0018.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::28) To VI1PR0801MB1997.eurprd08.prod.outlook.com (2603:10a6:800:8a::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5dda6fca-aa49-4cae-57d8-08d5721a8c96 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0801MB1997; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1997; 3:0lWFK4OL++r2DlRsy1LsMISasQzF/onkglf80annWmHzbSKo/3eZO4TK6M6peAh75XgXLSpQ3dcmMNZnDStnTWyLcylsBPVObGrIMTw10oUolnn9gUGMbLJLc4COJY8ybO93PJcHojKrt6ePiivoCVy56p5X7umW5g5d7X91NRBvOQEsm9zyv3wxsCCuvmvdIgnWVIXL/ZKdaWC6JNSOiIF906bHupyS+pyYhDkuxGk8ga1/OlfrAPs+8NJ5M16x; 25:oTMYzABpPKp1xktDBOdsCgDsXbWg0bUaN6S2nyPM5a90ir6V3jPXm8M2JQxk7pHkqcdTd08UULFpC/nSvhQHOrIrioJYf/bqKk/iO0diXjHXvKrFmzh7YyixbSlqd+hinJQuv2Pxgc3YegGVJhyD9GBMUBsOv6GhCQ9YeFam2AD61+ivEp1brETyK9YUorbRYcga89OZR99uzIx16eAnksEIjYA2OqNudIf9MezFqLOm0JlCSAzPDRQ9EMzd9oaxfcA+uyPGaO0P6X5AhhNITjSeDyPnYTMJILqIfiLndkINrOCsGRKXJNhl+P4e4tVMYKBJ8VtEnC8b2p9sO2zW2Q==; 31:t25UtqGuBXCOLfjw0FxrnHNdmpGvITria6ufz891mlYoLLcyDzyB0lfPihj+AjYSUbpm4qMLgf4Cw2Qh7/DQAMM9BoLYs33qIekAd1v+xF+sdWNJsVFkv7cokWURNnMx9hGPgX3HsbKYyY5yGil0K2luyv4T+Nn+Kt9ca9xKxQbXKH40nfG2I1pbvDKIUB9ZFDwBSFrshmY0Mkz5J+PifPCNpmnR30/ituGuJEcvL3E= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1997: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1997; 20:I48GvUWVyqVSbaD/xR51r5i5XBfXMq4E+4UDqQu8287z4zzfOfIdi5yaUYlQTuXVbsbaKT6MnJoe9eHUCFJLuv3BBGo55vaB1MRt0QVQ3Q0Vqc37lDJb4nZXSX4x0VBxM18nYwtMUNmuoVKVjIPE227NyOf3Hg3sBheRX4jhsJ9H8qn/HCMHvx5L9JxJT+xJJex+BG0S1L1bodH15RXhTUiwpZnwZjdXO1kQLnSB2PUTzeV3rC638oFkmVIxTnvkQHW7/8n/irg5sTp7CVn9Sx0+m5g/vUZ9pfiZeQvnlTLjtF3FyWGvskOAucXsxo9LimmJZBfqimkfLmlOFaGAg4pO5/PvPcAEzCzXoO0m0Yu66iPHWzBCbKVMHDqjBZBBZOohvH4jQybRbStFyrBZMBqyp8oHR5CpHlEH7cahqgFpaoxKjEin/SDRCm8pAi4CZE/hjp0ii34qqNyGIgcGbHKyD3+hOAbsToxKw0kBbjVbExSTLjKeQHkFh7orW+jP; 4:Dw0Ewtr4aBoTeKc5b9R1mIj7Rdu/7TwpD80nYUd0NmGVf7k0aRbOZkyWbOgCIwRAN8LpXe7K8pmpZZEQogXZ4JBOPBST8+IbwAnGFGK4kLXew94jawcK1SK99ZxThKjrLk+ZuwLw/YLKbBiE+6txRuh+7zwDBehhYIFHF5nMPzzU3G3sJJ8y09vzyli0PFDjrOaG0BRQTxjgCnQLmeFNMK3cyihpkaplL8hJ7E2E+LtkGAm25bpEViiTz6Wjy3UNxuZ/0f4AnhyUIGKJlGPlwA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231101)(944501161)(93006095)(93001095)(6041288)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0801MB1997; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1997; X-Forefront-PRVS: 0581B5AB35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(376002)(39840400004)(396003)(366004)(39380400002)(199004)(189003)(16586007)(69596002)(68736007)(316002)(105586002)(36756003)(50466002)(53416004)(48376002)(106356001)(2351001)(66066001)(47776003)(2361001)(7736002)(8676002)(305945005)(51416003)(81166006)(6506007)(5660300001)(4326008)(2906002)(186003)(6116002)(50226002)(3846002)(2950100002)(6916009)(6666003)(26005)(25786009)(8936002)(107886003)(6486002)(97736004)(76176011)(86362001)(53936002)(52116002)(386003)(6512007)(55236004)(478600001)(81156014)(16526019)(21314002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1997; H:xantnef-ws.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1997; 23:8toQeoTB9pkMcKFr0wG21OskO7W0rhqFH95JEG/?= =?us-ascii?Q?0aROT4CbOLKegdXISBnYxbiYAFjqEIZ9rcYiwjufaUhlKyKvN3miLih6sI9P?= =?us-ascii?Q?FtLcXIaO/dc7QSnwHwR/tsxuYlLnLpheY0gyYtjAQxW/O7bmi4zXiFA09ttu?= =?us-ascii?Q?53n15ropTpQtIbA/aw5yrViukYITd2GqN4qQh+2VMKwMuQ/Aa9HOtML79ZMP?= =?us-ascii?Q?girCFSDkWGtjzbJ8JFMkV1f6FRK+RiGKiFl7w1YTXpREqgRFtAX808tk020e?= =?us-ascii?Q?FkD/JqhhX71MKrYvJVe/olS7jPcBWDiwdr/R5kGUvAJvdIr5sJ8BeAN7vDQo?= =?us-ascii?Q?yAC8nXplpHzFgG7ah9GLOS0cwkxBJNCcfKuy/8u1L1RiKukU+LoOAd1PNteR?= =?us-ascii?Q?1HYJfszjvY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I1PR0801MB1997; 6:okMuBd850Y2gSVUAS9q/g05z3hfCEipPf829enhSHejtwt0dGTNrzK3vmWxC8wn5KXGT7zTKRfkCFyPnxgqfyDtba+lzJS9zOpecm0o+JwFZX7Ayo040piauJon6VK12umFpJrATqBHA/oUAP3aTnk1TNopJK1btD6ps0Fg3qHzLj3kFF27HP9GiaTKXinyBWU4PX1ZpuZqeYZYI/KCInioOtR+fjgV8k3Ka7ccfStPpDXbHAbyeXyiCkazqedKYZT5cFgNg17pe+Re/LffY+AVKe9aq3Hx4p37+4G+g0uQ/mJFkFa4q3/D6GcFvWslCnoQk0cV9RlQLB5S9j17cYv7/JTm6o12VgZfVuGrg4rU=; 5:1aefWrd36VuMnvsnlOjsFLs94BQLUhx3Nr2LNqj/pyX8q7EFD0+WEdsl6kjCSE8Zj2TWze1fNYNBfFYn/K9O9fKQnuwbZmALJudgwQOYl8pUPm87tDqImS1ZAh7OIldYZFx5YlgOgnDDBeV0/xAxtw85MIPS2jgba7uq0AMdUjQ=; 24:t+E1yo+q6LRrmf7WvDetBdBDvh4TdCtzCdRVsx0HRGfyg5adZr5wK/6J7/Rmx74E0Y40cutf8qaaDjoO+6qJvTBkxEHaC5opuX+6kfiTeK8=; 7:SInFc+0OUn+20XCM0F/PahPrpsm6zla2NgV0juaMgO/eI8LWGbjr2Sh53CfdLbvlEGmH1VCva+ma+c3U4bhg0pIRCsBu7L44ongbwtDQY23HpdEwM255h9q+5Q5AqcGifmisxIes0btaQe0o3Din5y/wvIJKk9Y/RTvz9/1EVPGc30Qjy0AA95TBNPaZRAnvVvcXFedyCCE4B11iQp/RUOGQZr5td+0GDoPps3De+NcMwyw6Pwvu/rdpOeg3qEqz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1997; 20:62Bx1dW0ctw9jhvNMjOeNLET7wzS/pAoSIC8fsXZWVasJi8fNziR177Z13gQ4+OXjOoJSyI21bTggjqand58wn4H6o09P0Oq2q+zeTmAWmKdP/q6JGE+EvmMHyR+FX9WwkWu9p9xSfWspz3kQV96MuuiTp7K72wVxNvi7FccMLU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2018 13:14:28.8203 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5dda6fca-aa49-4cae-57d8-08d5721a8c96 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1997 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.1.108 Subject: [Qemu-devel] [PATCH v2 1/2] iotest 033: add misaligned write-zeroes test via truncate 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: kwolf@redhat.com, Anton Nefedov , berto@igalia.com, qemu-block@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, famz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This new test case only makes sense for qcow2 while iotest 033 is generic; however it matches the test purpose perfectly and also 033 contains those do_test() tricks to pass the alignment, which won't look nice being duplicated in other tests or moved to the common code. Signed-off-by: Anton Nefedov --- tests/qemu-iotests/033 | 28 ++++++++++++++++++++++++++++ tests/qemu-iotests/033.out | 13 +++++++++++++ 2 files changed, 41 insertions(+) diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033 index 2cdfd13..5fa3983 100755 --- a/tests/qemu-iotests/033 +++ b/tests/qemu-iotests/033 @@ -64,6 +64,9 @@ do_test() } | $QEMU_IO $IO_EXTRA_ARGS } +echo +echo "=== Test aligned and misaligned write zeroes operations ===" + for write_zero_cmd in "write -z" "aio_write -z"; do for align in 512 4k; do echo @@ -102,7 +105,32 @@ for align in 512 4k; do done done + +# Trigger truncate that would shrink qcow2 L1 table, which is done by +# clearing one entry (8 bytes) with bdrv_co_pwrite_zeroes() + +echo +echo "=== Test misaligned write zeroes via truncate ===" +echo + +CLUSTER_SIZE=$((64 * 1024)) +L2_COVERAGE=$(($CLUSTER_SIZE * $CLUSTER_SIZE / 8)) +_make_test_img $(($L2_COVERAGE * 2)) + +do_test 512 "write -P 1 0 0x200" "$TEST_IMG" | _filter_qemu_io +# next L2 table +do_test 512 "write -P 1 $L2_COVERAGE 0x200" "$TEST_IMG" | _filter_qemu_io + +# only interested in qcow2 here; also other formats might respond with +# "not supported" error message +if [ $IMGFMT = "qcow2" ]; then + do_test 512 "truncate $L2_COVERAGE" "$TEST_IMG" | _filter_qemu_io +fi + +do_test 512 "read -P 1 0 0x200" "$TEST_IMG" | _filter_qemu_io + # success, all done +echo echo "*** done" rm -f $seq.full status=0 diff --git a/tests/qemu-iotests/033.out b/tests/qemu-iotests/033.out index 95929ef..57799cb 100644 --- a/tests/qemu-iotests/033.out +++ b/tests/qemu-iotests/033.out @@ -1,6 +1,8 @@ QA output created by 033 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 +=== Test aligned and misaligned write zeroes operations === + == preparing image == wrote 1024/1024 bytes at offset 512 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -164,4 +166,15 @@ read 512/512 bytes at offset 512 read 3072/3072 bytes at offset 1024 3 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=== Test misaligned write zeroes via truncate === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 +wrote 512/512 bytes at offset 0 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 512/512 bytes at offset 536870912 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 512/512 bytes at offset 0 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + *** done