From nobody Mon Nov 25 11:21:45 2024 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=1715581970; cv=none; d=zohomail.com; s=zohoarc; b=TtXFWpUdHPYfMkbNsPFKORZO/UgUk6czDD393VW9YzdmjNm6EEB9/pl/1OqwcDr/6gIOr/sScO1GY0/7ZHuG8x0BNHHqslVsUJnXAhWo/6wSqINi0Qqcd35NamTPN5KteJCR9TSFZfOpehAoYUm4/5Q3Vzg9qocWAMg+xz5bGek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715581970; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gdfSxwNzgYgkXJ/2oFsiwToopSDkXtcrJyFLx6fnw7Q=; b=l9PNLOrfLfAZ8FJSFt2nugXEZl/U4nnY8PCxW2bhAdhwFFVs4xXBLyjo+7PvGyjeeFrfJwAqxv5Q2JKDWtqk3J9+fIn/kAsxiESRHHZUoV8JM/ELHSALIdFUeJfZYmv32SP0VuN9OWtMJ3PB3hV4EpEhLXMHgmjnHQ9OwhpSSw8= 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 1715581970276782.2231006275268; Sun, 12 May 2024 23:32:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6PEn-0007eO-SA; Mon, 13 May 2024 02:32:41 -0400 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 1s6PEO-00079J-HG; Mon, 13 May 2024 02:32:16 -0400 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 1s6PEJ-0003wW-15; Mon, 13 May 2024 02:32:16 -0400 Received: from [130.117.225.1] (helo=dev005.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1s6PAR-000qpR-2Q; Mon, 13 May 2024 08:31:56 +0200 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=gdfSxwNzgYgkXJ/2oFsiwToopSDkXtcrJyFLx6fnw7Q=; b=oCb3ZlgtVVZ9 WFg5xKlJLIaE/ss9f9VX2m29x802DZzPYK+XPL/TvROO1l2ExLh7c9DltZI0yCM4wYMGhVm/48yNH weVI1ClBN8KDzdeB+SRs/CKMrHokOjQ6f89TBftisSu+sMCFrcUFEEv7lPGZLY7bj5jJHawAnxjAB 6BQBA+tVDDb2rcS0mR2AhO7zWR4L2Sx3pIUfs5eLJ8qjnaCYpNTZq5113uy3xjniis/K+HdscoqoP 6E2iNOEm5uAErD+518kz9+763EEFjrUDnftSvQoZ+EXhIe+lp4UclvetM6BJhwqzYzowts58d0ESF gKqnDo845vWzHU4xRifczg==; From: Andrey Drobyshev To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, hreitz@redhat.com, kwolf@redhat.com, eblake@redhat.com, berto@igalia.com, jean-louis@dupond.be, andrey.drobyshev@virtuozzo.com, den@virtuozzo.com Subject: [PATCH v2 05/11] iotests/common.rc: add disk_usage function Date: Mon, 13 May 2024 09:31:57 +0300 Message-Id: <20240513063203.113911-6-andrey.drobyshev@virtuozzo.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240513063203.113911-1-andrey.drobyshev@virtuozzo.com> References: <20240513063203.113911-1-andrey.drobyshev@virtuozzo.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=130.117.225.111; envelope-from=andrey.drobyshev@virtuozzo.com; helo=relay.virtuozzo.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1715581971547100003 Content-Type: text/plain; charset="utf-8" Move the definition from iotests/250 to common.rc. This is used to detect real disk usage of sparse files. In particular, we want to use it for checking subclusters-based discards. Signed-off-by: Andrey Drobyshev Reviewed-by: Alberto Garcia Reviewed-by: Alexander Ivanov --- tests/qemu-iotests/250 | 5 ----- tests/qemu-iotests/common.rc | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/250 b/tests/qemu-iotests/250 index af48f83aba..c0a0dbc0ff 100755 --- a/tests/qemu-iotests/250 +++ b/tests/qemu-iotests/250 @@ -52,11 +52,6 @@ _unsupported_imgopts data_file # bdrv_co_truncate(bs->file) call in qcow2_co_truncate(), which might succ= eed # anyway. =20 -disk_usage() -{ - du --block-size=3D1 $1 | awk '{print $1}' -} - size=3D2100M =20 _make_test_img -o "cluster_size=3D1M,preallocation=3Dmetadata" $size diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 95c12577dd..237f746af8 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -140,6 +140,12 @@ _optstr_add() fi } =20 +# report real disk usage for sparse files +disk_usage() +{ + du --block-size=3D1 "$1" | awk '{print $1}' +} + # Set the variables to the empty string to turn Valgrind off # for specific processes, e.g. # $ VALGRIND_QEMU_IO=3D ./check -qcow2 -valgrind 015 --=20 2.39.3