From nobody Thu Dec 18 13:24:56 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642169925; cv=none; d=zohomail.com; s=zohoarc; b=ADI9icimh6dcrEBMKXclE32X6d9WuTyRZvE9aYa+zh0hi13nlGtFtOrfmFNBN2528IaAcl9aQK3xbmEytcbFvic5KGZWxXB6aDJdYKj/iCLsER9W2WIaRP2xIpX/cfBlTO7Jy33aEninPEbRW+SoJyt1jg4mgIpGyZja+EeQVV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642169925; h=Content-Type: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=I4aq1SO/dnyF/nSA0Mkl9gIarZVffuIuzcCCoM6+wKE=; b=Zu0yhvvqjU9Vv6hi5MUlVh+SzpH1uXXbLaPHy9wx73L/l4Ldu7QtgFIJ7QDzRzdJS2KDAM5/a7WAaO53b8bhcA0ch/Y7zhYEa7eW2E00OCKNJOoUzKipO3kovPcT3a3vDk/aoyXvtDmjROdV3IvKi9JMgQU9zkDDclDKj7cSBHs= 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 1642169925603941.9297700812572; Fri, 14 Jan 2022 06:18:45 -0800 (PST) Received: from localhost ([::1]:39140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8NPg-0004oM-7P for importer@patchew.org; Fri, 14 Jan 2022 09:18:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8N0e-0003H2-Iv for qemu-devel@nongnu.org; Fri, 14 Jan 2022 08:52:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27405) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8N0c-0000NL-Tw for qemu-devel@nongnu.org; Fri, 14 Jan 2022 08:52:52 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-422-fQLYUzfuNPmfx0a1WR0rkw-1; Fri, 14 Jan 2022 08:52:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C4881023F4E; Fri, 14 Jan 2022 13:52:48 +0000 (UTC) Received: from merkur.redhat.com (unknown [10.39.194.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BB38105B20E; Fri, 14 Jan 2022 13:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642168370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I4aq1SO/dnyF/nSA0Mkl9gIarZVffuIuzcCCoM6+wKE=; b=CwkMjYIpw/2+XaMAD/Gbyzg7DhF12K+Re59rx8VJBvIHRe7ecoeegrrff7uvDti8ZN+Ecd /sEpL1NZ49RDtkDGXjneSdBtA86hT3qAJS9/7ul36wIS1AWz3YpMxeTbK+CX7QUTDehKb0 p7UrEU5gOa8WhX6yCX5zOLxP89U0loA= X-MC-Unique: fQLYUzfuNPmfx0a1WR0rkw-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 13/16] iotests: Test qemu-img convert of zeroed data cluster Date: Fri, 14 Jan 2022 14:52:23 +0100 Message-Id: <20220114135226.185407-14-kwolf@redhat.com> In-Reply-To: <20220114135226.185407-1-kwolf@redhat.com> References: <20220114135226.185407-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.133.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.595, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642169927349100001 Content-Type: text/plain; charset="utf-8" This demonstrates what happens when the block status changes in sub-min_sparse granularity, but all of the parts are zeroed out. The alignment logic in is_allocated_sectors() prevents that the target image remains fully sparse as expected, but turns it into a data cluster of explicit zeros. Signed-off-by: Kevin Wolf Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20211217164654.1184218-2-vsementsov@virtuozzo.com> Tested-by: Peter Lieven Signed-off-by: Kevin Wolf --- tests/qemu-iotests/122 | 1 + tests/qemu-iotests/122.out | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122 index efb260d822..be0f6b79e5 100755 --- a/tests/qemu-iotests/122 +++ b/tests/qemu-iotests/122 @@ -251,6 +251,7 @@ $QEMU_IO -c "write -P 0 0 64k" "$TEST_IMG" 2>&1 | _filt= er_qemu_io | _filter_test $QEMU_IO -c "write 0 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_test= dir $QEMU_IO -c "write 8k 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_tes= tdir $QEMU_IO -c "write 17k 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filter_te= stdir +$QEMU_IO -c "write -P 0 65k 1k" "$TEST_IMG" 2>&1 | _filter_qemu_io | _filt= er_testdir =20 for min_sparse in 4k 8k; do echo diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out index 8fbdac2b39..69b8e8b803 100644 --- a/tests/qemu-iotests/122.out +++ b/tests/qemu-iotests/122.out @@ -192,6 +192,8 @@ wrote 1024/1024 bytes at offset 8192 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 1024/1024 bytes at offset 17408 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 1024/1024 bytes at offset 66560 +1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 convert -S 4k [{ "start": 0, "length": 4096, "depth": 0, "present": true, "zero": false,= "data": true, "offset": OFFSET}, @@ -199,7 +201,9 @@ convert -S 4k { "start": 8192, "length": 4096, "depth": 0, "present": true, "zero": fals= e, "data": true, "offset": OFFSET}, { "start": 12288, "length": 4096, "depth": 0, "present": false, "zero": tr= ue, "data": false}, { "start": 16384, "length": 4096, "depth": 0, "present": true, "zero": fal= se, "data": true, "offset": OFFSET}, -{ "start": 20480, "length": 67088384, "depth": 0, "present": false, "zero"= : true, "data": false}] +{ "start": 20480, "length": 46080, "depth": 0, "present": false, "zero": t= rue, "data": false}, +{ "start": 66560, "length": 1024, "depth": 0, "present": true, "zero": fal= se, "data": true, "offset": OFFSET}, +{ "start": 67584, "length": 67041280, "depth": 0, "present": false, "zero"= : true, "data": false}] =20 convert -c -S 4k [{ "start": 0, "length": 1024, "depth": 0, "present": true, "zero": false,= "data": true}, @@ -211,7 +215,9 @@ convert -c -S 4k =20 convert -S 8k [{ "start": 0, "length": 24576, "depth": 0, "present": true, "zero": false= , "data": true, "offset": OFFSET}, -{ "start": 24576, "length": 67084288, "depth": 0, "present": false, "zero"= : true, "data": false}] +{ "start": 24576, "length": 41984, "depth": 0, "present": false, "zero": t= rue, "data": false}, +{ "start": 66560, "length": 1024, "depth": 0, "present": true, "zero": fal= se, "data": true, "offset": OFFSET}, +{ "start": 67584, "length": 67041280, "depth": 0, "present": false, "zero"= : true, "data": false}] =20 convert -c -S 8k [{ "start": 0, "length": 1024, "depth": 0, "present": true, "zero": false,= "data": true}, --=20 2.31.1