From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643731958002772.0703401343103; Tue, 1 Feb 2022 08:12:38 -0800 (PST) Received: from localhost ([::1]:40022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvlk-0004f5-SJ for importer@patchew.org; Tue, 01 Feb 2022 11:12:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSH-00037S-DW for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28123) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSE-0004CG-DA for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:24 -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-411-XnwRaNRAMtqBBMy2TSqy8A-1; Tue, 01 Feb 2022 09:43:02 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E39D71091DB3; Tue, 1 Feb 2022 14:43:00 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5198970D3E; Tue, 1 Feb 2022 14:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726886; 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=ekORPyJkJdtO8SE42j7QM9SzVpdPjYC/4pjJuwAHo4Y=; b=PoM9KYTyYOJmI7KUGFXTI6D9yXYn4xT+MUtPUN1xbaoua2jdkv1mJgNyUbkmxJ5vw9F2pd qLRMQSPwft33ty01bsA3/Q7wbkuOWcQHzLfRsaLUUtoih7jazH86uNTgABJW+JWIwMHqaP rFkW51w+r8Qaatkx5SsOAgJZ3AA6mCA= X-MC-Unique: XnwRaNRAMtqBBMy2TSqy8A-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 01/24] tests/qemu-iotests: Fix 051 for binaries without 'lsi53c895a' Date: Tue, 1 Feb 2022 15:42:10 +0100 Message-Id: <20220201144233.617021-2-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643731960257100001 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The lsi53c895a SCSI adaptor might not be enabled in each and every x86 QEMU binary, e.g. it's disabled in the RHEL/CentOS build. Thus let's add a check to the 051 test so that it does not fail if this device is not available. Signed-off-by: Thomas Huth Message-Id: <20211206143404.247032-1-thuth@redhat.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/051 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index 1d2fa93a11..e9042a6214 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -45,6 +45,10 @@ _supported_proto file _unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file _require_drivers nbd =20 +if [ "$QEMU_DEFAULT_MACHINE" =3D "pc" ]; then + _require_devices lsi53c895a +fi + do_run_qemu() { echo Testing: "$@" --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643734758799849.0046219214772; Tue, 1 Feb 2022 08:59:18 -0800 (PST) Received: from localhost ([::1]:51460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEwUw-0001fV-4R for importer@patchew.org; Tue, 01 Feb 2022 11:59:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSJ-00039f-Fv for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:48245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSE-0004DJ-IT for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:26 -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-303-iFzkzsESNMy43rY5XJcoDQ-1; Tue, 01 Feb 2022 09:43:10 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 298481853022; Tue, 1 Feb 2022 14:43:09 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C118B75521; Tue, 1 Feb 2022 14:43:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726895; 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=s2wzOihZP5C3rIIKL2dKDFa2nOpbebIXm0sZZf5BWX0=; b=GtwA5jnyVmjYKQuZzW37Lx8EoLKr+PJ3bEYXoxikMmmDdEVomBzlso8JOH6jVJWSNDmbXJ Avn9txIK+aOOXadpYWszuWeTQk66zaf64UHmTz4kY+YaADuSl3Kv8lI/tMieuwJcyUdbuH CppLVXCwk/EWjfUIKoCkr+1lg1Vgq90= X-MC-Unique: iFzkzsESNMy43rY5XJcoDQ-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 02/24] iotests/MRCE: Write data to source Date: Tue, 1 Feb 2022 15:42:11 +0100 Message-Id: <20220201144233.617021-3-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643734761788100001 Content-Type: text/plain; charset="utf-8" This test assumes that mirror flushes the source when entering the READY state, and that the format level will pass that flush on to the protocol level (where we intercept it with blkdebug). However, apparently that does not happen when using a VMDK image with zeroed_grain=3Don, which actually is the default set by testenv.py. Right now, Python tests ignore IMGOPTS, though, so this has no effect; but Vladimir has a series that will change this, so we need to fix this test before that series lands. We can fix it by writing data to the source before we start the mirror job; apparently that makes the (VMDK) format layer change its mind and pass on the pre-READY flush to the protocol level, so the test passes again. (I presume, without any data written, mirror just does a 64M zero write on the target, which VMDK with zeroed_grain=3Don basically just ignores.) Without this, we do not get a flush, and so blkdebug only sees a single flush at the end of the job instead of two, and therefore does not inject an error, which makes the block job complete instead of raising an error. Signed-off-by: Hanna Reitz Message-Id: <20211223165308.103793-1-hreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/mirror-ready-cancel-error | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/tests/mirror-ready-cancel-error b/tests/qem= u-iotests/tests/mirror-ready-cancel-error index f2dc88881f..770ffca379 100755 --- a/tests/qemu-iotests/tests/mirror-ready-cancel-error +++ b/tests/qemu-iotests/tests/mirror-ready-cancel-error @@ -36,6 +36,11 @@ class TestMirrorReadyCancelError(iotests.QMPTestCase): assert iotests.qemu_img_create('-f', iotests.imgfmt, target, str(image_size)) =3D=3D 0 =20 + # Ensure that mirror will copy something before READY so the + # target format layer will forward the pre-READY flush to its + # file child + assert iotests.qemu_io_silent('-c', 'write -P 1 0 64k', source) = =3D=3D 0 + self.vm =3D iotests.VM() self.vm.launch() =20 @@ -97,7 +102,7 @@ class TestMirrorReadyCancelError(iotests.QMPTestCase): # Write something so will not leave the job immediately, but # flush first (which will fail, thanks to blkdebug) res =3D self.vm.qmp('human-monitor-command', - command_line=3D'qemu-io mirror-top "write 0 64k"= ') + command_line=3D'qemu-io mirror-top "write -P 2 0= 64k"') self.assert_qmp(res, 'return', '') =20 # Drain status change events --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730474850419.6780972476631; Tue, 1 Feb 2022 07:47:54 -0800 (PST) Received: from localhost ([::1]:50890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvNp-00060y-UI for importer@patchew.org; Tue, 01 Feb 2022 10:47:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQh-0002c7-4f for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:54796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQX-0002xS-0l for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:46:40 -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-377-DK0wL0dNPNSihl_ct9YnYA-1; Tue, 01 Feb 2022 09:43:18 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2E326408E; Tue, 1 Feb 2022 14:43:16 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06A067B9E1; Tue, 1 Feb 2022 14:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726599; 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=/HDA6Sm4559s8h86JTuF5LdO6hZSpNSfF193DVVvakg=; b=YPTL/FkeBhGZfrlIf6stuTnbiTRn3QkgSYmCFFZ1nK2AmK/rISoKu111LQVV8IGkTdqD0+ jgpWp1+2u8ZiIR/DKoynhUrZpGfCkjcZKdMRUak6CvcG5sDvLPCAoTxe4/7/JdXYKtGsZ+ 8y9hS+HG6zngZBw3AMKmpTq9KkrdAlk= X-MC-Unique: DK0wL0dNPNSihl_ct9YnYA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 03/24] iotests.py: img_info_log(): rename imgopts argument Date: Tue, 1 Feb 2022 15:42:12 +0100 Message-Id: <20220201144233.617021-4-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730477673100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We are going to support IMGOPTS environment variable like in bash tests. Corresponding global variable in iotests.py should be called imgopts. So to not interfere with function argument, rename it in advance. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-2-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/210 | 8 ++++---- tests/qemu-iotests/iotests.py | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/210 b/tests/qemu-iotests/210 index a4dcc5fe59..10b0a0b87c 100755 --- a/tests/qemu-iotests/210 +++ b/tests/qemu-iotests/210 @@ -62,7 +62,7 @@ with iotests.FilePath('t.luks') as disk_path, \ 'driver=3Dluks,file.driver=3Dfile,file.filename=3D%s,key-secret=3D= keysec0' % (disk_path), filter_path=3Ddisk_path, extra_args=3D['--object', 'secret,id=3Dkeysec0,data=3Dfoo'], - imgopts=3DTrue) + use_image_opts=3DTrue) =20 # # Successful image creation (with non-default options) @@ -96,7 +96,7 @@ with iotests.FilePath('t.luks') as disk_path, \ 'driver=3Dluks,file.driver=3Dfile,file.filename=3D%s,key-secret=3D= keysec0' % (disk_path), filter_path=3Ddisk_path, extra_args=3D['--object', 'secret,id=3Dkeysec0,data=3Dfoo'], - imgopts=3DTrue) + use_image_opts=3DTrue) =20 # # Invalid BlockdevRef @@ -132,7 +132,7 @@ with iotests.FilePath('t.luks') as disk_path, \ 'driver=3Dluks,file.driver=3Dfile,file.filename=3D%s,key-secret=3D= keysec0' % (disk_path), filter_path=3Ddisk_path, extra_args=3D['--object', 'secret,id=3Dkeysec0,data=3Dfoo'], - imgopts=3DTrue) + use_image_opts=3DTrue) =20 # # Invalid sizes @@ -176,4 +176,4 @@ with iotests.FilePath('t.luks') as disk_path, \ 'driver=3Dluks,file.driver=3Dfile,file.filename=3D%s,key-secret=3D= keysec0' % (disk_path), filter_path=3Ddisk_path, extra_args=3D['--object', 'secret,id=3Dkeysec0,data=3Dfoo'], - imgopts=3DTrue) + use_image_opts=3DTrue) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 1e2f2391d1..30a8837ea2 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -227,9 +227,10 @@ def qemu_img_log(*args): log(result, filters=3D[filter_testfiles]) return result =20 -def img_info_log(filename, filter_path=3DNone, imgopts=3DFalse, extra_args= =3D()): +def img_info_log(filename, filter_path=3DNone, use_image_opts=3DFalse, + extra_args=3D()): args =3D ['info'] - if imgopts: + if use_image_opts: args.append('--image-opts') else: args +=3D ['-f', imgfmt] --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643731863865472.10630243634705; Tue, 1 Feb 2022 08:11:03 -0800 (PST) Received: from localhost ([::1]:34948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvkE-00018k-V4 for importer@patchew.org; Tue, 01 Feb 2022 11:11:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSR-0003BN-CY for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSI-0004FV-S7 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:33 -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-608-n7e55KD0ObCaKp-GLwzJgA-1; Tue, 01 Feb 2022 09:43:20 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28F028143F2; Tue, 1 Feb 2022 14:43:19 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1C847DE23; Tue, 1 Feb 2022 14:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726904; 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=JSh4zOXvrhCyumhwKxB2mA8+eJshbq5iDJRQTAIVKKw=; b=VNGjmyuCxd93qj0TqnsDCmUce04UX4nv4DzyNb5yNUw/jbTl0texdAIf5p3Fqul++ekGUX og9JPZw1xdECs5MXuqt7xUlJdBiAOc9fLDMJD0e2LfNOIeNGB1RHUsT+WxLSQZo0aDzdHn wdGaBilgbDQRH+h2oeoZGoP6M+FqYJk= X-MC-Unique: n7e55KD0ObCaKp-GLwzJgA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 04/24] iotests.py: implement unsupported_imgopts Date: Tue, 1 Feb 2022 15:42:13 +0100 Message-Id: <20220201144233.617021-5-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643731866711100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We are going to support some addition IMGOPTS in python iotests like in bash iotests. Similarly to bash iotests, we want a way to skip some tests which can't work with specific IMGOPTS. Globally for python iotests we will not support things like 'data_file=3D$TEST_IMG.ext_data_file' in IMGOPTS, so, forbid this globally in iotests.py. Suggested-by: Hanna Reitz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-3-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 30a8837ea2..2fa5dcba76 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -1226,6 +1226,17 @@ def _verify_virtio_scsi_pci_or_ccw() -> None: notrun('Missing virtio-scsi-pci or virtio-scsi-ccw in QEMU binary') =20 =20 +def _verify_imgopts(unsupported: Sequence[str] =3D ()) -> None: + imgopts =3D os.environ.get('IMGOPTS') + # One of usage examples for IMGOPTS is "data_file=3D$TEST_IMG.ext_data= _file" + # but it supported only for bash tests. We don't have a concept of glo= bal + # TEST_IMG in iotests.py, not saying about somehow parsing $variables. + # So, for simplicity let's just not support any IMGOPTS with '$' insid= e. + unsup =3D list(unsupported) + ['$'] + if imgopts and any(x in imgopts for x in unsup): + notrun(f'not suitable for this imgopts: {imgopts}') + + def supports_quorum(): return 'quorum' in qemu_img_pipe('--help') =20 @@ -1402,7 +1413,8 @@ def execute_setup_common(supported_fmts: Sequence[str= ] =3D (), unsupported_fmts: Sequence[str] =3D (), supported_protocols: Sequence[str] =3D (), unsupported_protocols: Sequence[str] =3D (), - required_fmts: Sequence[str] =3D ()) -> bool: + required_fmts: Sequence[str] =3D (), + unsupported_imgopts: Sequence[str] =3D ()) -> boo= l: """ Perform necessary setup for either script-style or unittest-style test= s. =20 @@ -1422,6 +1434,7 @@ def execute_setup_common(supported_fmts: Sequence[str= ] =3D (), _verify_aio_mode(supported_aio_modes) _verify_formats(required_fmts) _verify_virtio_blk() + _verify_imgopts(unsupported_imgopts) =20 return debug =20 --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643732011689789.3627032341324; Tue, 1 Feb 2022 08:13:31 -0800 (PST) Received: from localhost ([::1]:43286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvmc-0006xt-TJ for importer@patchew.org; Tue, 01 Feb 2022 11:13:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSS-0003Cs-Pj for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuSI-0004FR-U6 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:48:35 -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-587-SUurSRnwOYSEGv-qUDuamA-1; Tue, 01 Feb 2022 09:43:22 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 654DA1091DBB; Tue, 1 Feb 2022 14:43:21 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4FC270D2B; Tue, 1 Feb 2022 14:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726904; 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=9dqg045Vw5indBfvLFwqrBwPG/2Oqs7WvibUnHBFMXI=; b=J5gvsoZl5k7oz6tpR2gnf+8tYb4ENMVt4Xk8tqwBwv581KS0zR+TMolSczlnyw1YQ1NB6X rr4o+4XCWE1D4Z44QquyX5SXAUS/RLP7eAgIGonf+YKM580pOva8pn24vYJt7Up8G/QeEZ NDR8/vA5sto4tN0xh0m1f1ykqw/+0F0= X-MC-Unique: SUurSRnwOYSEGv-qUDuamA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 05/24] iotests: specify some unsupported_imgopts for python iotests Date: Tue, 1 Feb 2022 15:42:14 +0100 Message-Id: <20220201144233.617021-6-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643732014304100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We are going to support IMGOPTS for python iotests. Still some iotests will not work with common IMGOPTS used with bash iotests like specifying refcount_bits and compat qcow2 options. So we should define corresponding unsupported_imgopts for now. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20211223160144.1097696-4-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/044 | 3 ++- tests/qemu-iotests/065 | 3 ++- tests/qemu-iotests/163 | 3 ++- tests/qemu-iotests/165 | 3 ++- tests/qemu-iotests/196 | 3 ++- tests/qemu-iotests/242 | 3 ++- tests/qemu-iotests/246 | 3 ++- tests/qemu-iotests/254 | 3 ++- tests/qemu-iotests/260 | 3 ++- tests/qemu-iotests/274 | 3 ++- tests/qemu-iotests/281 | 3 ++- tests/qemu-iotests/303 | 3 ++- tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 3 ++- tests/qemu-iotests/tests/migrate-bitmaps-test | 3 ++- tests/qemu-iotests/tests/remove-bitmap-from-backing | 3 ++- 15 files changed, 30 insertions(+), 15 deletions(-) diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044 index 64b18eb7c8..d696e6442a 100755 --- a/tests/qemu-iotests/044 +++ b/tests/qemu-iotests/044 @@ -117,4 +117,5 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): =20 if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2'], - supported_protocols=3D['file']) + supported_protocols=3D['file'], + unsupported_imgopts=3D['refcount_bits']) diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index 3c2ca27627..dc7716275f 100755 --- a/tests/qemu-iotests/065 +++ b/tests/qemu-iotests/065 @@ -139,4 +139,5 @@ TestQMP =3D None =20 if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2'], - supported_protocols=3D['file']) + supported_protocols=3D['file'], + unsupported_imgopts=3D['refcount_bits']) diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163 index dedce8ef43..b8bfc95358 100755 --- a/tests/qemu-iotests/163 +++ b/tests/qemu-iotests/163 @@ -169,4 +169,5 @@ ShrinkBaseClass =3D None =20 if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['raw', 'qcow2'], - supported_protocols=3D['file']) + supported_protocols=3D['file'], + unsupported_imgopts=3D['compat']) diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165 index ce499946b8..e3ef28e2ee 100755 --- a/tests/qemu-iotests/165 +++ b/tests/qemu-iotests/165 @@ -157,4 +157,5 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): =20 if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2'], - supported_protocols=3D['file']) + supported_protocols=3D['file'], + unsupported_imgopts=3D['compat']) diff --git a/tests/qemu-iotests/196 b/tests/qemu-iotests/196 index 2451515094..76509a5ad1 100755 --- a/tests/qemu-iotests/196 +++ b/tests/qemu-iotests/196 @@ -65,4 +65,5 @@ class TestInvalidateAutoclear(iotests.QMPTestCase): =20 if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2'], - supported_protocols=3D['file']) + supported_protocols=3D['file'], + unsupported_imgopts=3D['compat']) diff --git a/tests/qemu-iotests/242 b/tests/qemu-iotests/242 index a9b27668c2..96a30152b0 100755 --- a/tests/qemu-iotests/242 +++ b/tests/qemu-iotests/242 @@ -26,7 +26,8 @@ from iotests import qemu_img_create, qemu_io, qemu_img_pi= pe, \ file_path, img_info_log, log, filter_qemu_io =20 iotests.script_initialize(supported_fmts=3D['qcow2'], - supported_protocols=3D['file']) + supported_protocols=3D['file'], + unsupported_imgopts=3D['refcount_bits', 'compat'= ]) =20 disk =3D file_path('disk') chunk =3D 256 * 1024 diff --git a/tests/qemu-iotests/246 b/tests/qemu-iotests/246 index 5932a0e8a9..b009a78397 100755 --- a/tests/qemu-iotests/246 +++ b/tests/qemu-iotests/246 @@ -23,7 +23,8 @@ import iotests from iotests import log =20 -iotests.script_initialize(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + unsupported_imgopts=3D['compat']) size =3D 64 * 1024 * 1024 * 1024 gran_small =3D 32 * 1024 gran_large =3D 128 * 1024 diff --git a/tests/qemu-iotests/254 b/tests/qemu-iotests/254 index 108bf5f894..7ea098818c 100755 --- a/tests/qemu-iotests/254 +++ b/tests/qemu-iotests/254 @@ -22,7 +22,8 @@ import iotests from iotests import qemu_img_create, file_path, log =20 -iotests.script_initialize(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + unsupported_imgopts=3D['compat']) =20 disk, top =3D file_path('disk', 'top') size =3D 1024 * 1024 diff --git a/tests/qemu-iotests/260 b/tests/qemu-iotests/260 index 2ec64a9b99..c2133f9980 100755 --- a/tests/qemu-iotests/260 +++ b/tests/qemu-iotests/260 @@ -23,7 +23,8 @@ import iotests from iotests import qemu_img_create, file_path, log, filter_qmp_event =20 iotests.script_initialize( - supported_fmts=3D['qcow2'] + supported_fmts=3D['qcow2'], + unsupported_imgopts=3D['compat'] ) =20 base, top =3D file_path('base', 'top') diff --git a/tests/qemu-iotests/274 b/tests/qemu-iotests/274 index caab008e07..080a90f10f 100755 --- a/tests/qemu-iotests/274 +++ b/tests/qemu-iotests/274 @@ -23,7 +23,8 @@ import iotests =20 iotests.script_initialize(supported_fmts=3D['qcow2'], - supported_platforms=3D['linux']) + supported_platforms=3D['linux'], + unsupported_imgopts=3D['refcount_bits', 'compat'= ]) =20 size_short =3D 1 * 1024 * 1024 size_long =3D 2 * 1024 * 1024 diff --git a/tests/qemu-iotests/281 b/tests/qemu-iotests/281 index 956698083f..318e333939 100755 --- a/tests/qemu-iotests/281 +++ b/tests/qemu-iotests/281 @@ -245,4 +245,5 @@ class TestBlockdevBackupAbort(iotests.QMPTestCase): =20 if __name__ =3D=3D '__main__': iotests.main(supported_fmts=3D['qcow2'], - supported_protocols=3D['file']) + supported_protocols=3D['file'], + unsupported_imgopts=3D['compat']) diff --git a/tests/qemu-iotests/303 b/tests/qemu-iotests/303 index 425544c064..475cb5428d 100755 --- a/tests/qemu-iotests/303 +++ b/tests/qemu-iotests/303 @@ -23,7 +23,8 @@ import iotests import subprocess from iotests import qemu_img_create, qemu_io, file_path, log, filter_qemu_= io =20 -iotests.script_initialize(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + unsupported_imgopts=3D['refcount_bits', 'compat'= ]) =20 disk =3D file_path('disk') chunk =3D 1024 * 1024 diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test b/tests= /qemu-iotests/tests/migrate-bitmaps-postcopy-test index 00ebb5c251..fc9c4b4ef4 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test @@ -272,4 +272,5 @@ class TestDirtyBitmapPostcopyMigration(iotests.QMPTestC= ase): =20 =20 if __name__ =3D=3D '__main__': - iotests.main(supported_fmts=3D['qcow2']) + iotests.main(supported_fmts=3D['qcow2'], + unsupported_imgopts=3D['compat']) diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-test b/tests/qemu-iot= ests/tests/migrate-bitmaps-test index c23df3d75c..59f3357580 100755 --- a/tests/qemu-iotests/tests/migrate-bitmaps-test +++ b/tests/qemu-iotests/tests/migrate-bitmaps-test @@ -307,7 +307,8 @@ def main() -> None: =20 iotests.main( supported_fmts=3D['qcow2'], - supported_protocols=3D['file'] + supported_protocols=3D['file'], + unsupported_imgopts=3D['compat'] ) =20 =20 diff --git a/tests/qemu-iotests/tests/remove-bitmap-from-backing b/tests/qe= mu-iotests/tests/remove-bitmap-from-backing index 8d48fc0f3c..3c397b08ea 100755 --- a/tests/qemu-iotests/tests/remove-bitmap-from-backing +++ b/tests/qemu-iotests/tests/remove-bitmap-from-backing @@ -21,7 +21,8 @@ import iotests from iotests import log, qemu_img_create, qemu_img, qemu_img_pipe =20 -iotests.script_initialize(supported_fmts=3D['qcow2']) +iotests.script_initialize(supported_fmts=3D['qcow2'], + unsupported_imgopts=3D['compat']) =20 top, base =3D iotests.file_path('top', 'base') size =3D '1M' --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730876095699.5149375038419; Tue, 1 Feb 2022 07:54:36 -0800 (PST) Received: from localhost ([::1]:35020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvUJ-0006Xy-1K for importer@patchew.org; Tue, 01 Feb 2022 10:54:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQf-0002c2-1R for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQW-0002yJ-SD for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:46:40 -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-281-ieowD49gPdePAHlZepOR0Q-1; Tue, 01 Feb 2022 09:43:24 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78D1C8519E9; Tue, 1 Feb 2022 14:43:23 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B14F7B9E1; Tue, 1 Feb 2022 14:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726607; 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=8Kss8h+9VrUutorL5C6yWFFX32sptd0KaVTKo+1NjYM=; b=cpd3qKiGmf1kXFZoquGtvmqttavV42gDS3L6+rD/SXlEM8X7ne8wljYOl4NUsZxdexrjvk 9f1QxDj6aohMmah7OLaU40jBzLin+/6vconvkecOoOCkowIboKyktUVQxXcsLK8Kpd+RqG aPK//+NaRhCXNauijeGIV3/QO9KmOkM= X-MC-Unique: ieowD49gPdePAHlZepOR0Q-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 06/24] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd' Date: Tue, 1 Feb 2022 15:42:15 +0100 Message-Id: <20220201144233.617021-7-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730878277100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Adding support of IMGOPTS (like in bash tests) allows user to pass a lot of different options. Still, some may require additional logic. Now we want compression_type option, so add some smart logic around it: ignore compression_type=3Dzstd in IMGOPTS, if test want qcow2 in compatibility mode. As well, ignore compression_type for non-qcow2 formats. Note that we may instead add support only to qemu_img_create(), but that works bad: 1. We'll have to update a lot of tests to use qemu_img_create instead of qemu_img('create'). (still, we may want do it anyway, but no reason to create a dependancy between task of supporting IMGOPTS and updating a lot of tests) 2. Some tests use qemu_img_pipe('create', ..) - even more work on updating 3. Even if we update all tests to go through qemu_img_create, we'll need a way to avoid creating new tests using qemu_img*('create') - add assertions.. That doesn't seem good. So, let's add support of IMGOPTS to most generic qemu_img_pipe_and_status(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-5-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 2fa5dcba76..740f8be36b 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # =20 +import argparse import atexit import bz2 from collections import OrderedDict @@ -161,11 +162,35 @@ def qemu_tool_pipe_and_status(tool: str, args: Sequen= ce[str], {-subp.returncode}: {cmd}\n') return (output, subp.returncode) =20 +def qemu_img_create_prepare_args(args: List[str]) -> List[str]: + if not args or args[0] !=3D 'create': + return list(args) + args =3D args[1:] + + p =3D argparse.ArgumentParser(allow_abbrev=3DFalse) + p.add_argument('-f') + parsed, remaining =3D p.parse_known_args(args) + + result =3D ['create'] + if parsed.f is not None: + result +=3D ['-f', parsed.f] + + # IMGOPTS most probably contain options specific for the selected form= at, + # like extended_l2 or compression_type for qcow2. Test may want to cre= ate + # additional images in other formats that doesn't support these option= s. + # So, use IMGOPTS only for images created in imgfmt format. + if parsed.f =3D=3D imgfmt and 'IMGOPTS' in os.environ: + result +=3D ['-o', os.environ['IMGOPTS']] + + result +=3D remaining + + return result + def qemu_img_pipe_and_status(*args: str) -> Tuple[str, int]: """ Run qemu-img and return both its output and its exit code """ - full_args =3D qemu_img_args + list(args) + full_args =3D qemu_img_args + qemu_img_create_prepare_args(list(args)) return qemu_tool_pipe_and_status('qemu-img', full_args) =20 def qemu_img(*args: str) -> int: --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643731060421894.8248651442714; Tue, 1 Feb 2022 07:57:40 -0800 (PST) Received: from localhost ([::1]:41758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvXH-0003AB-Lx for importer@patchew.org; Tue, 01 Feb 2022 10:57:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRW-0002n1-KR for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRL-0002yU-2a for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:36 -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-617-Pn1ELE20NC2rQ1gn31mqCA-1; Tue, 01 Feb 2022 09:43:27 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D7EAD64093; Tue, 1 Feb 2022 14:43:25 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7804D7DE23; Tue, 1 Feb 2022 14:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726610; 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=RwBYhDeeo8LEFYMA9aaBm+uVrBLQopeflTnpzju7Qn8=; b=CllokThzkmyH2krO2HxgnALeK/+pxM/DOGnOJ8qInWozt8tLjenPItfkH0xCVvYulCRbwD u6gDstQHZBLi36u/CFM6vNjLLG6C+lasn2obwMDZmA8fqbCa/BIDxPqaHWYebjJQZkDsQm EMBXnympctSQo6YhN04yQrJPuUCJmnI= X-MC-Unique: Pn1ELE20NC2rQ1gn31mqCA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 07/24] iotests: drop qemu_img_verbose() helper Date: Tue, 1 Feb 2022 15:42:16 +0100 Message-Id: <20220201144233.617021-8-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643731061935100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy qemu_img_verbose() has a drawback of not going through generic qemu_img_pipe_and_status(). qemu_img_verbose() is not very popular, so update the only two users to qemu_img_log() and drop qemu_img_verbose() at all. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-6-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/044 | 5 +++-- tests/qemu-iotests/044.out | 1 + tests/qemu-iotests/209 | 7 ++++--- tests/qemu-iotests/209.out | 2 ++ tests/qemu-iotests/iotests.py | 8 -------- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044 index d696e6442a..a5ee9a7ded 100755 --- a/tests/qemu-iotests/044 +++ b/tests/qemu-iotests/044 @@ -24,7 +24,7 @@ import os import qcow2 from qcow2 import QcowHeader import iotests -from iotests import qemu_img, qemu_img_verbose, qemu_io +from iotests import qemu_img, qemu_img_log, qemu_io import struct import subprocess import sys @@ -112,10 +112,11 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): =20 def test_grow_refcount_table(self): qemu_io('-c', 'write 3800M 1M', test_img) - qemu_img_verbose('check' , test_img) + qemu_img_log('check' , test_img) pass =20 if __name__ =3D=3D '__main__': + iotests.activate_logging() iotests.main(supported_fmts=3D['qcow2'], supported_protocols=3D['file'], unsupported_imgopts=3D['refcount_bits']) diff --git a/tests/qemu-iotests/044.out b/tests/qemu-iotests/044.out index 703cf3dee1..ff663b17d7 100644 --- a/tests/qemu-iotests/044.out +++ b/tests/qemu-iotests/044.out @@ -1,6 +1,7 @@ No errors were found on the image. 7292415/33554432 =3D 21.73% allocated, 0.00% fragmented, 0.00% compressed = clusters Image end offset: 4296217088 + . ---------------------------------------------------------------------- Ran 1 tests diff --git a/tests/qemu-iotests/209 b/tests/qemu-iotests/209 index ff7efea11b..f6ad08ec42 100755 --- a/tests/qemu-iotests/209 +++ b/tests/qemu-iotests/209 @@ -20,8 +20,8 @@ # =20 import iotests -from iotests import qemu_img_create, qemu_io, qemu_img_verbose, qemu_nbd, \ - file_path +from iotests import qemu_img_create, qemu_io, qemu_img_log, qemu_nbd, \ + file_path, log =20 iotests.script_initialize(supported_fmts=3D['qcow2']) =20 @@ -33,4 +33,5 @@ qemu_img_create('-f', iotests.imgfmt, disk, '1M') qemu_io('-f', iotests.imgfmt, '-c', 'write 0 512K', disk) =20 qemu_nbd('-k', nbd_sock, '-x', 'exp', '-f', iotests.imgfmt, disk) -qemu_img_verbose('map', '-f', 'raw', '--output=3Djson', nbd_uri) +qemu_img_log('map', '-f', 'raw', '--output=3Djson', nbd_uri) +log('done.') # avoid new line at the end of output file diff --git a/tests/qemu-iotests/209.out b/tests/qemu-iotests/209.out index f27be3fa7b..515906ac7a 100644 --- a/tests/qemu-iotests/209.out +++ b/tests/qemu-iotests/209.out @@ -1,2 +1,4 @@ [{ "start": 0, "length": 524288, "depth": 0, "present": true, "zero": fals= e, "data": true, "offset": 0}, { "start": 524288, "length": 524288, "depth": 0, "present": true, "zero": = true, "data": false, "offset": 524288}] + +done. diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 740f8be36b..cc4bbbcf7b 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -235,14 +235,6 @@ def qemu_img_measure(*args): def qemu_img_check(*args): return json.loads(qemu_img_pipe("check", "--output", "json", *args)) =20 -def qemu_img_verbose(*args): - '''Run qemu-img without suppressing its output and return the exit cod= e''' - exitcode =3D subprocess.call(qemu_img_args + list(args)) - if exitcode < 0: - sys.stderr.write('qemu-img received signal %i: %s\n' - % (-exitcode, ' '.join(qemu_img_args + list(args)= ))) - return exitcode - def qemu_img_pipe(*args: str) -> str: '''Run qemu-img and return its output''' return qemu_img_pipe_and_status(*args)[0] --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164373379668787.38764043683227; Tue, 1 Feb 2022 08:43:16 -0800 (PST) Received: from localhost ([::1]:51840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEwFP-0007OR-KJ for importer@patchew.org; Tue, 01 Feb 2022 11:43:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRg-0002ok-76 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRL-0002yp-5T for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:39 -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-657-i5P3Pye4Ncu60BGOON4Jpg-1; Tue, 01 Feb 2022 09:43:29 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFC951018725; Tue, 1 Feb 2022 14:43:27 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 952A85DBB7; Tue, 1 Feb 2022 14:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726613; 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=fobN2Vn9sIHwol0up3FOToSfSuyL9Kuhf30VLmu3x4k=; b=WeBEHNa7DVethIDabAW7tKwnK5YNAZUi3PfDCzN8JxbVgpm+3pPXbwDbbbdwPKd5Vwz5Rf 9SL2Ny+mu8S6v944/zXP17lat4KZ9eAOYfmZMpY1wSldr6rkuPGKhURE7qrUtBEW0Q68eY e+mynxWGHExVFVcXlZF5r5qQfXxcYxc= X-MC-Unique: i5P3Pye4Ncu60BGOON4Jpg-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 08/24] iotests.py: rewrite default luks support in qemu_img Date: Tue, 1 Feb 2022 15:42:17 +0100 Message-Id: <20220201144233.617021-9-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643733799474100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Move the logic to more generic qemu_img_pipe_and_status(). Also behave better when we have several -o options. And reuse argument parser of course. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-7-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 36 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index cc4bbbcf7b..c382c527c8 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -168,9 +168,13 @@ def qemu_img_create_prepare_args(args: List[str]) -> L= ist[str]: args =3D args[1:] =20 p =3D argparse.ArgumentParser(allow_abbrev=3DFalse) + # -o option may be specified several times + p.add_argument('-o', action=3D'append', default=3D[]) p.add_argument('-f') parsed, remaining =3D p.parse_known_args(args) =20 + opts_list =3D parsed.o + result =3D ['create'] if parsed.f is not None: result +=3D ['-f', parsed.f] @@ -179,8 +183,18 @@ def qemu_img_create_prepare_args(args: List[str]) -> L= ist[str]: # like extended_l2 or compression_type for qcow2. Test may want to cre= ate # additional images in other formats that doesn't support these option= s. # So, use IMGOPTS only for images created in imgfmt format. - if parsed.f =3D=3D imgfmt and 'IMGOPTS' in os.environ: - result +=3D ['-o', os.environ['IMGOPTS']] + imgopts =3D os.environ.get('IMGOPTS') + if imgopts and parsed.f =3D=3D imgfmt: + opts_list.insert(0, imgopts) + + # default luks support + if parsed.f =3D=3D 'luks' and \ + all('key-secret' not in opts for opts in opts_list): + result +=3D ['--object', luks_default_secret_object] + opts_list.append(luks_default_key_secret_opt) + + for opts in opts_list: + result +=3D ['-o', opts] =20 result +=3D remaining =20 @@ -211,23 +225,7 @@ def ordered_qmp(qmsg, conv_keys=3DTrue): return qmsg =20 def qemu_img_create(*args): - args =3D list(args) - - # default luks support - if '-f' in args and args[args.index('-f') + 1] =3D=3D 'luks': - if '-o' in args: - i =3D args.index('-o') - if 'key-secret' not in args[i + 1]: - args[i + 1].append(luks_default_key_secret_opt) - args.insert(i + 2, '--object') - args.insert(i + 3, luks_default_secret_object) - else: - args =3D ['-o', luks_default_key_secret_opt, - '--object', luks_default_secret_object] + args - - args.insert(0, 'create') - - return qemu_img(*args) + return qemu_img('create', *args) =20 def qemu_img_measure(*args): return json.loads(qemu_img_pipe("measure", "--output", "json", *args)) --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730892088795.2624946848655; Tue, 1 Feb 2022 07:54:52 -0800 (PST) Received: from localhost ([::1]:35542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvUY-0006x8-Kd for importer@patchew.org; Tue, 01 Feb 2022 10:54:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRT-0002mT-QK for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRL-0002yt-2k for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:34 -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-36-FmWukL_YO7aRk-9oCshDiQ-1; Tue, 01 Feb 2022 09:43:31 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 199728143EF; Tue, 1 Feb 2022 14:43:30 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0FEF5DBB7; Tue, 1 Feb 2022 14:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726614; 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=cpwFl2BpzW5RU4PAwdLfMO7hoh6mbky1cqV6z/gvrHk=; b=QFlQTTczw2E0WA1AljlqXMewsYHKkbntxqI1bQ51l0+297v85ytmt3Ylm3xs0sdELhK3yq UGrD9wpcVTkw5nW8bl/NWzphXVHSEHCddF57LhUONyqSu1PZMY/xCGQN9zN0h85lKahfc1 C1y0jbRcDW1ViEzEvtwC8krqORkj02o= X-MC-Unique: FmWukL_YO7aRk-9oCshDiQ-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 09/24] iotest 303: explicit compression type Date: Tue, 1 Feb 2022 15:42:18 +0100 Message-Id: <20220201144233.617021-10-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730919434100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy The test prints qcow2 header fields which depends on chosen compression type. So, let's be explicit in what compression type we want and independent of IMGOPTS. Test both existing compression types. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-8-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/303 | 25 ++++++++++++++++--------- tests/qemu-iotests/303.out | 30 +++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/303 b/tests/qemu-iotests/303 index 475cb5428d..16c2e10827 100755 --- a/tests/qemu-iotests/303 +++ b/tests/qemu-iotests/303 @@ -54,12 +54,19 @@ def add_bitmap(num, begin, end, disabled): log('') =20 =20 -qemu_img_create('-f', iotests.imgfmt, disk, '10M') - -add_bitmap(1, 0, 6, False) -add_bitmap(2, 6, 8, True) -dump =3D ['./qcow2.py', disk, 'dump-header'] -subprocess.run(dump) -# Dump the metadata in JSON format -dump.append('-j') -subprocess.run(dump) +def test(compression_type: str, json_output: bool) -> None: + qemu_img_create('-f', iotests.imgfmt, + '-o', f'compression_type=3D{compression_type}', + disk, '10M') + add_bitmap(1, 0, 6, False) + add_bitmap(2, 6, 8, True) + + cmd =3D ['./qcow2.py', disk, 'dump-header'] + if json_output: + cmd.append('-j') + + subprocess.run(cmd) + + +test('zlib', False) +test('zstd', True) diff --git a/tests/qemu-iotests/303.out b/tests/qemu-iotests/303.out index 7c16998587..b3c70827b7 100644 --- a/tests/qemu-iotests/303.out +++ b/tests/qemu-iotests/303.out @@ -80,6 +80,34 @@ extra_data_size 0 Bitmap table type size offset 0 all-zeroes 0 0 =20 +Add bitmap 1 +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 2097152 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 3145728 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 4194304 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 5242880 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + + +Add bitmap 2 +wrote 1048576/1048576 bytes at offset 6291456 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +wrote 1048576/1048576 bytes at offset 7340032 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + + { "magic": 1363560955, "version": 3, @@ -94,7 +122,7 @@ Bitmap table type size offset "refcount_table_clusters": 1, "nb_snapshots": 0, "snapshot_offset": 0, - "incompatible_features": 0, + "incompatible_features": 8, "compatible_features": 0, "autoclear_features": 1, "refcount_order": 4, --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643729925438829.5712664452021; Tue, 1 Feb 2022 07:38:45 -0800 (PST) Received: from localhost ([::1]:33274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvEy-00025U-B0 for importer@patchew.org; Tue, 01 Feb 2022 10:38:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQT-0002aJ-VU for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:46:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuP9-0002zW-NH for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:45:39 -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-482-xcC7Lm6aMOO4kODi0bHBeg-1; Tue, 01 Feb 2022 09:43:33 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CC141018720; Tue, 1 Feb 2022 14:43:32 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C31205DBB7; Tue, 1 Feb 2022 14:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726621; 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=BxTg8+Zl5VwK6DHgyv6b9D4ZtUAc9Q6t6tamv9d5U68=; b=StUUlqrKnLeau37LwL3YpqBR+hwyJnMw37u+MhVZCdNZ47SyoVBSHsEhIp84OHFRed3m2z IB771oMznluT5WGdDzY0Db3heto7dyH3HQue2k9ZwxGF9+ssMEYL3lbA1LnqOSh7sutUyG sTUvc10MHKBwc234rTYVzvrM+tYpRaA= X-MC-Unique: xcC7Lm6aMOO4kODi0bHBeg-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 10/24] iotest 065: explicit compression type Date: Tue, 1 Feb 2022 15:42:19 +0100 Message-Id: <20220201144233.617021-11-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643729927725100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy The test checks different options. It of course fails if set IMGOPTS=3D'compression_type=3Dzstd'. So, let's be explicit in what compression type we want and independent of IMGOPTS. Test both existing compression types. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-9-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/065 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index dc7716275f..f7c1b68dad 100755 --- a/tests/qemu-iotests/065 +++ b/tests/qemu-iotests/065 @@ -88,7 +88,7 @@ class TestQMP(TestImageInfoSpecific): =20 class TestQCow2(TestQemuImgInfo): '''Testing a qcow2 version 2 image''' - img_options =3D 'compat=3D0.10' + img_options =3D 'compat=3D0.10,compression_type=3Dzlib' json_compare =3D { 'compat': '0.10', 'refcount-bits': 16, 'compression-type': 'zlib' } human_compare =3D [ 'compat: 0.10', 'compression type: zlib', @@ -96,17 +96,17 @@ class TestQCow2(TestQemuImgInfo): =20 class TestQCow3NotLazy(TestQemuImgInfo): '''Testing a qcow2 version 3 image with lazy refcounts disabled''' - img_options =3D 'compat=3D1.1,lazy_refcounts=3Doff' + img_options =3D 'compat=3D1.1,lazy_refcounts=3Doff,compression_type=3D= zstd' json_compare =3D { 'compat': '1.1', 'lazy-refcounts': False, 'refcount-bits': 16, 'corrupt': False, - 'compression-type': 'zlib', 'extended-l2': False } - human_compare =3D [ 'compat: 1.1', 'compression type: zlib', + 'compression-type': 'zstd', 'extended-l2': False } + human_compare =3D [ 'compat: 1.1', 'compression type: zstd', 'lazy refcounts: false', 'refcount bits: 16', 'corrupt: false', 'extended l2: false' ] =20 class TestQCow3Lazy(TestQemuImgInfo): '''Testing a qcow2 version 3 image with lazy refcounts enabled''' - img_options =3D 'compat=3D1.1,lazy_refcounts=3Don' + img_options =3D 'compat=3D1.1,lazy_refcounts=3Don,compression_type=3Dz= lib' json_compare =3D { 'compat': '1.1', 'lazy-refcounts': True, 'refcount-bits': 16, 'corrupt': False, 'compression-type': 'zlib', 'extended-l2': False } @@ -117,7 +117,7 @@ class TestQCow3Lazy(TestQemuImgInfo): class TestQCow3NotLazyQMP(TestQMP): '''Testing a qcow2 version 3 image with lazy refcounts disabled, openi= ng with lazy refcounts enabled''' - img_options =3D 'compat=3D1.1,lazy_refcounts=3Doff' + img_options =3D 'compat=3D1.1,lazy_refcounts=3Doff,compression_type=3D= zlib' qemu_options =3D 'lazy-refcounts=3Don' compare =3D { 'compat': '1.1', 'lazy-refcounts': False, 'refcount-bits': 16, 'corrupt': False, @@ -127,11 +127,11 @@ class TestQCow3NotLazyQMP(TestQMP): class TestQCow3LazyQMP(TestQMP): '''Testing a qcow2 version 3 image with lazy refcounts enabled, opening with lazy refcounts disabled''' - img_options =3D 'compat=3D1.1,lazy_refcounts=3Don' + img_options =3D 'compat=3D1.1,lazy_refcounts=3Don,compression_type=3Dz= std' qemu_options =3D 'lazy-refcounts=3Doff' compare =3D { 'compat': '1.1', 'lazy-refcounts': True, 'refcount-bits': 16, 'corrupt': False, - 'compression-type': 'zlib', 'extended-l2': False } + 'compression-type': 'zstd', 'extended-l2': False } =20 TestImageInfoSpecific =3D None TestQemuImgInfo =3D None --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730733802141.77171439612437; Tue, 1 Feb 2022 07:52:13 -0800 (PST) Received: from localhost ([::1]:59130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvS0-0003Un-Oz for importer@patchew.org; Tue, 01 Feb 2022 10:52:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQe-0002c1-RF for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51546) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQT-0002z6-Si for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:46:38 -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-542-9xxCxw5XPYivCqdtwXIv9A-1; Tue, 01 Feb 2022 09:43:35 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9AD746409E; Tue, 1 Feb 2022 14:43:34 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E2F047B9DA; Tue, 1 Feb 2022 14:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726619; 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=854rwWUreTRnIeKG4zqgS+c5n6snTNOkmYZ84f2nvRc=; b=C6ekw7RGlXwHZdNcmcr56jHduGaMKGBo7n+rgedPtqp6Ht+0bA6BqlxZWU+UXNR0rxjnHs d0PY8wso/CyH8OFzoZbbnTeKGlzXK+Hk/t2jNeJJC1tfrOHukmthNQaN3Zbag4YX8X7Nqc BiDHcX/NE3w158tENui3fT2HyBWj9Xk= X-MC-Unique: 9xxCxw5XPYivCqdtwXIv9A-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 11/24] iotests.py: filter out successful output of qemu-img create Date: Tue, 1 Feb 2022 15:42:20 +0100 Message-Id: <20220201144233.617021-12-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730736901100003 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy The only "feature" of this "Formatting ..." line is that we have to update it every time we add new option. Let's drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-10-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/149.out | 21 --------------------- tests/qemu-iotests/237.out | 3 --- tests/qemu-iotests/255.out | 4 ---- tests/qemu-iotests/274.out | 29 ----------------------------- tests/qemu-iotests/280.out | 1 - tests/qemu-iotests/296.out | 10 +++------- tests/qemu-iotests/iotests.py | 10 ++++++++-- 7 files changed, 11 insertions(+), 67 deletions(-) diff --git a/tests/qemu-iotests/149.out b/tests/qemu-iotests/149.out index 6877ab6c4a..ab879596ce 100644 --- a/tests/qemu-iotests/149.out +++ b/tests/qemu-iotests/149.out @@ -61,7 +61,6 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-aes-256-xts-pla= in64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-plain64-sha1.img', fmt=3Dluks size= =3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dxts i= vgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha1.img = qiotest-145-aes-256-xts-plain64-sha1 @@ -181,7 +180,6 @@ unlink TEST_DIR/luks-twofish-256-xts-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img twofish-256= -xts-plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Dtwofish-256,ciph= er-mode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-twofish-256= -xts-plain64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-twofish-256-xts-plain64-sha1.img', fmt=3Dluks si= ze=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Dtwofish-256 cipher-mode= =3Dxts ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-twofish-256-xts-plain64-sha1.= img qiotest-145-twofish-256-xts-plain64-sha1 @@ -301,7 +299,6 @@ unlink TEST_DIR/luks-serpent-256-xts-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img serpent-256= -xts-plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Dserpent-256,ciph= er-mode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-serpent-256= -xts-plain64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-serpent-256-xts-plain64-sha1.img', fmt=3Dluks si= ze=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Dserpent-256 cipher-mode= =3Dxts ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-serpent-256-xts-plain64-sha1.= img qiotest-145-serpent-256-xts-plain64-sha1 @@ -421,7 +418,6 @@ unlink TEST_DIR/luks-cast5-128-cbc-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img cast5-128-c= bc-plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Dcast5-128,cipher= -mode=3Dcbc,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-cast5-128-cbc= -plain64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-cast5-128-cbc-plain64-sha1.img', fmt=3Dluks size= =3D4398046511104 key-secret=3Dsec0 cipher-alg=3Dcast5-128 cipher-mode=3Dcbc= ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-cast5-128-cbc-plain64-sha1.im= g qiotest-145-cast5-128-cbc-plain64-sha1 @@ -542,7 +538,6 @@ unlink TEST_DIR/luks-aes-256-cbc-plain-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-cbc= -plain-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dcbc,ivgen-alg=3Dplain,hash-alg=3Dsha1 TEST_DIR/luks-aes-256-cbc-plain= -sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-cbc-plain-sha1.img', fmt=3Dluks size=3D4= 398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dcbc ivgen= -alg=3Dplain hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-plain-sha1.img qi= otest-145-aes-256-cbc-plain-sha1 @@ -662,7 +657,6 @@ unlink TEST_DIR/luks-aes-256-cbc-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-cbc= -plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dcbc,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-aes-256-cbc-pla= in64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-cbc-plain64-sha1.img', fmt=3Dluks size= =3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dcbc i= vgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-plain64-sha1.img = qiotest-145-aes-256-cbc-plain64-sha1 @@ -782,7 +776,6 @@ unlink TEST_DIR/luks-aes-256-cbc-essiv-sha256-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-cbc= -essiv-sha256-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dcbc,ivgen-alg=3Dessiv,hash-alg=3Dsha1,ivgen-hash-alg=3Dsha256 TEST_DI= R/luks-aes-256-cbc-essiv-sha256-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-cbc-essiv-sha256-sha1.img', fmt=3Dluks s= ize=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dcb= c ivgen-alg=3Dessiv ivgen-hash-alg=3Dsha256 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-essiv-sha256-sha1= .img qiotest-145-aes-256-cbc-essiv-sha256-sha1 @@ -902,7 +895,6 @@ unlink TEST_DIR/luks-aes-256-xts-essiv-sha256-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -essiv-sha256-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dessiv,hash-alg=3Dsha1,ivgen-hash-alg=3Dsha256 TEST_DI= R/luks-aes-256-xts-essiv-sha256-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-essiv-sha256-sha1.img', fmt=3Dluks s= ize=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dxt= s ivgen-alg=3Dessiv ivgen-hash-alg=3Dsha256 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-essiv-sha256-sha1= .img qiotest-145-aes-256-xts-essiv-sha256-sha1 @@ -1022,7 +1014,6 @@ unlink TEST_DIR/luks-aes-128-xts-plain64-sha256-sha1.= img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-128-xts= -plain64-sha256-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-128,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-aes-128-xts-pla= in64-sha256-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-128-xts-plain64-sha256-sha1.img', fmt=3Dluks= size=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-128 cipher-mode=3D= xts ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-128-xts-plain64-sha256-sh= a1.img qiotest-145-aes-128-xts-plain64-sha256-sha1 @@ -1142,7 +1133,6 @@ unlink TEST_DIR/luks-aes-192-xts-plain64-sha256-sha1.= img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-192-xts= -plain64-sha256-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-192,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-aes-192-xts-pla= in64-sha256-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-192-xts-plain64-sha256-sha1.img', fmt=3Dluks= size=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-192 cipher-mode=3D= xts ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-192-xts-plain64-sha256-sh= a1.img qiotest-145-aes-192-xts-plain64-sha256-sha1 @@ -1262,7 +1252,6 @@ unlink TEST_DIR/luks-twofish-128-xts-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img twofish-128= -xts-plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Dtwofish-128,ciph= er-mode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-twofish-128= -xts-plain64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-twofish-128-xts-plain64-sha1.img', fmt=3Dluks si= ze=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Dtwofish-128 cipher-mode= =3Dxts ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-twofish-128-xts-plain64-sha1.= img qiotest-145-twofish-128-xts-plain64-sha1 @@ -1383,7 +1372,6 @@ unlink TEST_DIR/luks-serpent-128-xts-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img serpent-128= -xts-plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Dserpent-128,ciph= er-mode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-serpent-128= -xts-plain64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-serpent-128-xts-plain64-sha1.img', fmt=3Dluks si= ze=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Dserpent-128 cipher-mode= =3Dxts ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-serpent-128-xts-plain64-sha1.= img qiotest-145-serpent-128-xts-plain64-sha1 @@ -1503,7 +1491,6 @@ unlink TEST_DIR/luks-serpent-192-xts-plain64-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img serpent-192= -xts-plain64-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Dserpent-192,ciph= er-mode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha1 TEST_DIR/luks-serpent-192= -xts-plain64-sha1.img 4194304M -Formatting 'TEST_DIR/luks-serpent-192-xts-plain64-sha1.img', fmt=3Dluks si= ze=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Dserpent-192 cipher-mode= =3Dxts ivgen-alg=3Dplain64 hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-serpent-192-xts-plain64-sha1.= img qiotest-145-serpent-192-xts-plain64-sha1 @@ -1625,7 +1612,6 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha224.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -plain64-sha224 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha224 TEST_DIR/luks-aes-256-xts-p= lain64-sha224.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-plain64-sha224.img', fmt=3Dluks size= =3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dxts i= vgen-alg=3Dplain64 hash-alg=3Dsha224 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha224.im= g qiotest-145-aes-256-xts-plain64-sha224 @@ -1745,7 +1731,6 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha256.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -plain64-sha256 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha256 TEST_DIR/luks-aes-256-xts-p= lain64-sha256.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-plain64-sha256.img', fmt=3Dluks size= =3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dxts i= vgen-alg=3Dplain64 hash-alg=3Dsha256 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha256.im= g qiotest-145-aes-256-xts-plain64-sha256 @@ -1865,7 +1850,6 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha384.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -plain64-sha384 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha384 TEST_DIR/luks-aes-256-xts-p= lain64-sha384.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-plain64-sha384.img', fmt=3Dluks size= =3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dxts i= vgen-alg=3Dplain64 hash-alg=3Dsha384 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha384.im= g qiotest-145-aes-256-xts-plain64-sha384 @@ -1985,7 +1969,6 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha512.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -plain64-sha512 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dsha512 TEST_DIR/luks-aes-256-xts-p= lain64-sha512.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-plain64-sha512.img', fmt=3Dluks size= =3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dxts i= vgen-alg=3Dplain64 hash-alg=3Dsha512 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha512.im= g qiotest-145-aes-256-xts-plain64-sha512 @@ -2105,7 +2088,6 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-ripemd160.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -plain64-ripemd160 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dplain64,hash-alg=3Dripemd160 TEST_DIR/luks-aes-256-xt= s-plain64-ripemd160.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-plain64-ripemd160.img', fmt=3Dluks s= ize=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dxt= s ivgen-alg=3Dplain64 hash-alg=3Dripemd160 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-ripemd160= .img qiotest-145-aes-256-xts-plain64-ripemd160 @@ -2299,7 +2281,6 @@ unlink TEST_DIR/luks-aes-256-xts-plain-sha1-pwallslot= s.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-xts= -plain-sha1-pwallslots =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3Dc2xvdDE=3D,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dxts,ivgen-alg=3Dplain,hash-alg=3Dsha1 TEST_DIR/luks-aes-256-xts-plain= -sha1-pwallslots.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-xts-plain-sha1-pwallslots.img', fmt=3Dlu= ks size=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode= =3Dxts ivgen-alg=3Dplain hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain-sha1-pwalls= lots.img qiotest-145-aes-256-xts-plain-sha1-pwallslots @@ -2419,7 +2400,6 @@ unlink TEST_DIR/luks-aes-256-cbc-essiv-auto-sha1.img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-cbc= -essiv-auto-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dcbc,ivgen-alg=3Dessiv,hash-alg=3Dsha1 TEST_DIR/luks-aes-256-cbc-essiv= -auto-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-cbc-essiv-auto-sha1.img', fmt=3Dluks siz= e=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3Dcbc = ivgen-alg=3Dessiv hash-alg=3Dsha1 iter-time=3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-essiv-auto-sha1.i= mg qiotest-145-aes-256-cbc-essiv-auto-sha1 @@ -2539,7 +2519,6 @@ unlink TEST_DIR/luks-aes-256-cbc-plain64-sha256-sha1.= img # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D qemu-img aes-256-cbc= -plain64-sha256-sha1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Create image qemu-img create -f luks --object secret,id=3Dsec0,data=3DMTIzNDU2,format= =3Dbase64 -o key-secret=3Dsec0,iter-time=3D10,cipher-alg=3Daes-256,cipher-m= ode=3Dcbc,ivgen-alg=3Dplain64,hash-alg=3Dsha1,ivgen-hash-alg=3Dsha256 TEST_= DIR/luks-aes-256-cbc-plain64-sha256-sha1.img 4194304M -Formatting 'TEST_DIR/luks-aes-256-cbc-plain64-sha256-sha1.img', fmt=3Dluks= size=3D4398046511104 key-secret=3Dsec0 cipher-alg=3Daes-256 cipher-mode=3D= cbc ivgen-alg=3Dplain64 ivgen-hash-alg=3Dsha256 hash-alg=3Dsha1 iter-time= =3D10 =20 # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-plain64-sha256-sh= a1.img qiotest-145-aes-256-cbc-plain64-sha256-sha1 diff --git a/tests/qemu-iotests/237.out b/tests/qemu-iotests/237.out index 2f09ff5512..aeb9724492 100644 --- a/tests/qemu-iotests/237.out +++ b/tests/qemu-iotests/237.out @@ -129,11 +129,8 @@ Job failed: Cannot find device=3D'this doesn't exist' = nor node-name=3D'this doesn't =20 =3D=3D=3D Other subformats =3D=3D=3D =20 -Formatting 'TEST_DIR/PID-t.vmdk.1', fmt=3Dvmdk size=3D0 compat6=3Doff hwve= rsion=3Dundefined =20 -Formatting 'TEST_DIR/PID-t.vmdk.2', fmt=3Dvmdk size=3D0 compat6=3Doff hwve= rsion=3Dundefined =20 -Formatting 'TEST_DIR/PID-t.vmdk.3', fmt=3Dvmdk size=3D0 compat6=3Doff hwve= rsion=3Dundefined =20 =3D=3D Missing extent =3D=3D =20 diff --git a/tests/qemu-iotests/255.out b/tests/qemu-iotests/255.out index 33b7f22de3..11a05a5213 100644 --- a/tests/qemu-iotests/255.out +++ b/tests/qemu-iotests/255.out @@ -3,9 +3,7 @@ Finishing a commit job with background reads =20 =3D=3D=3D Create backing chain and start VM =3D=3D=3D =20 -Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=3Dqcow2 cluster_size=3D65536 ex= tended_l2=3Doff compression_type=3Dzlib size=3D134217728 lazy_refcounts=3Do= ff refcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-t.qcow2', fmt=3Dqcow2 cluster_size=3D65536 extend= ed_l2=3Doff compression_type=3Dzlib size=3D134217728 lazy_refcounts=3Doff r= efcount_bits=3D16 =20 =3D=3D=3D Start background read requests =3D=3D=3D =20 @@ -23,9 +21,7 @@ Closing the VM while a job is being cancelled =20 =3D=3D=3D Create images and start VM =3D=3D=3D =20 -Formatting 'TEST_DIR/PID-src.qcow2', fmt=3Dqcow2 cluster_size=3D65536 exte= nded_l2=3Doff compression_type=3Dzlib size=3D134217728 lazy_refcounts=3Doff= refcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-dst.qcow2', fmt=3Dqcow2 cluster_size=3D65536 exte= nded_l2=3Doff compression_type=3Dzlib size=3D134217728 lazy_refcounts=3Doff= refcount_bits=3D16 =20 wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/274.out b/tests/qemu-iotests/274.out index 16a95a4850..1d2928e14d 100644 --- a/tests/qemu-iotests/274.out +++ b/tests/qemu-iotests/274.out @@ -1,9 +1,6 @@ =3D=3D Commit tests =3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D2097152 lazy_refcounts=3Doff refcou= nt_bits=3D16 =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D1048576 backing_file=3DTEST_DIR/PID-= base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D2097152 backing_file=3DTEST_DIR/PID-= mid backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -66,11 +63,8 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing HMP commit (top -> mid) =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D2097152 lazy_refcounts=3Doff refcou= nt_bits=3D16 =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D1048576 backing_file=3DTEST_DIR/PID-= base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D2097152 backing_file=3DTEST_DIR/PID-= mid backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -98,11 +92,8 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing QMP active commit (top -> mid) =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D2097152 lazy_refcounts=3Doff refcou= nt_bits=3D16 =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D1048576 backing_file=3DTEST_DIR/PID-= base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D2097152 backing_file=3DTEST_DIR/PID-= mid backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -136,11 +127,8 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing qemu-img commit (top -> base) =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D2097152 lazy_refcounts=3Doff refcou= nt_bits=3D16 =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D1048576 backing_file=3DTEST_DIR/PID-= base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D2097152 backing_file=3DTEST_DIR/PID-= mid backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -166,11 +154,8 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing QMP active commit (top -> base) =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D2097152 lazy_refcounts=3Doff refcou= nt_bits=3D16 =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D1048576 backing_file=3DTEST_DIR/PID-= base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D2097152 backing_file=3DTEST_DIR/PID-= mid backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -205,9 +190,7 @@ read 1048576/1048576 bytes at offset 1048576 =20 =3D=3D Resize tests =3D=3D =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D6442450944 lazy_refcounts=3Doff ref= count_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D1073741824 backing_file=3DTEST_DIR/P= ID-base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 65536/65536 bytes at offset 5368709120 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -224,9 +207,7 @@ read 65536/65536 bytes at offset 5368709120 { "start": 1073741824, "length": 7516192768, "depth": 0, "present": true, = "zero": true, "data": false}] =20 =3D=3D=3D preallocation=3Dmetadata =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D34359738368 lazy_refcounts=3Doff re= fcount_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D32212254720 backing_file=3DTEST_DIR/= PID-base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 65536/65536 bytes at offset 33285996544 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -248,9 +229,7 @@ read 65536/65536 bytes at offset 33285996544 { "start": 34896609280, "length": 536870912, "depth": 0, "present": true, = "zero": true, "data": false, "offset": 2685075456}] =20 =3D=3D=3D preallocation=3Dfalloc =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D10485760 lazy_refcounts=3Doff refco= unt_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D5242880 backing_file=3DTEST_DIR/PID-= base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 65536/65536 bytes at offset 9437184 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -267,9 +246,7 @@ read 65536/65536 bytes at offset 9437184 { "start": 5242880, "length": 10485760, "depth": 0, "present": true, "zero= ": false, "data": true, "offset": 327680}] =20 =3D=3D=3D preallocation=3Dfull =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D16777216 lazy_refcounts=3Doff refco= unt_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D8388608 backing_file=3DTEST_DIR/PID-= base backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 65536/65536 bytes at offset 11534336 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -286,9 +263,7 @@ read 65536/65536 bytes at offset 11534336 { "start": 8388608, "length": 4194304, "depth": 0, "present": true, "zero"= : false, "data": true, "offset": 327680}] =20 =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D393216 lazy_refcounts=3Doff refcoun= t_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D259072 backing_file=3DTEST_DIR/PID-b= ase backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 65536/65536 bytes at offset 259072 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -306,9 +281,7 @@ read 65536/65536 bytes at offset 259072 { "start": 262144, "length": 262144, "depth": 0, "present": true, "zero": = true, "data": false}] =20 =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D409600 lazy_refcounts=3Doff refcoun= t_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D262144 backing_file=3DTEST_DIR/PID-b= ase backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 65536/65536 bytes at offset 344064 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -325,9 +298,7 @@ read 65536/65536 bytes at offset 344064 { "start": 262144, "length": 262144, "depth": 0, "present": true, "zero": = true, "data": false}] =20 =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D524288 lazy_refcounts=3Doff refcoun= t_bits=3D16 =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 cluster_size=3D65536 extended_l= 2=3Doff compression_type=3Dzlib size=3D262144 backing_file=3DTEST_DIR/PID-b= ase backing_fmt=3Dqcow2 lazy_refcounts=3Doff refcount_bits=3D16 =20 wrote 65536/65536 bytes at offset 446464 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/280.out b/tests/qemu-iotests/280.out index 09a0f1a7cb..e39164c579 100644 --- a/tests/qemu-iotests/280.out +++ b/tests/qemu-iotests/280.out @@ -1,4 +1,3 @@ -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 cluster_size=3D65536 extended_= l2=3Doff compression_type=3Dzlib size=3D67108864 lazy_refcounts=3Doff refco= unt_bits=3D16 =20 =3D=3D=3D Launch VM =3D=3D=3D Enabling migration QMP events on VM... diff --git a/tests/qemu-iotests/296.out b/tests/qemu-iotests/296.out index 6c69735604..42205cc981 100644 --- a/tests/qemu-iotests/296.out +++ b/tests/qemu-iotests/296.out @@ -1,4 +1,3 @@ -Formatting 'TEST_DIR/test.img', fmt=3Dluks size=3D1048576 key-secret=3Dkey= sec0 iter-time=3D10 =20 {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} @@ -13,8 +12,7 @@ Job failed: Failed to get shared "consistent read" lock qemu-img: Failed to get shared "consistent read" lock Is another process using the image [TEST_DIR/test.img]? =20 -.Formatting 'TEST_DIR/test.img', fmt=3Dluks size=3D1048576 key-secret=3Dke= ysec0 iter-time=3D10 - +. Job failed: Block node is read-only {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} @@ -26,12 +24,10 @@ Job failed: Failed to get shared "consistent read" lock {"return": {}} {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} -.Formatting 'TEST_DIR/test.img', fmt=3Dluks size=3D1048576 key-secret=3Dke= ysec0 iter-time=3D10 - +. {"return": {}} {"error": {"class": "GenericError", "desc": "Failed to get \"write\" lock"= }} -.Formatting 'TEST_DIR/test.img', fmt=3Dluks size=3D1048576 key-secret=3Dke= ysec0 iter-time=3D10 - +. {"return": {}} {"return": {}} . diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index c382c527c8..65780c6098 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -150,7 +150,9 @@ def qemu_tool_popen(args: Sequence[str], =20 =20 def qemu_tool_pipe_and_status(tool: str, args: Sequence[str], - connect_stderr: bool =3D True) -> Tuple[str,= int]: + connect_stderr: bool =3D True, + drop_successful_output: bool =3D False) \ + -> Tuple[str, int]: """ Run a tool and return both its output and its exit code """ @@ -160,6 +162,8 @@ def qemu_tool_pipe_and_status(tool: str, args: Sequence= [str], cmd =3D ' '.join(args) sys.stderr.write(f'{tool} received signal \ {-subp.returncode}: {cmd}\n') + if drop_successful_output and subp.returncode =3D=3D 0: + output =3D '' return (output, subp.returncode) =20 def qemu_img_create_prepare_args(args: List[str]) -> List[str]: @@ -204,8 +208,10 @@ def qemu_img_pipe_and_status(*args: str) -> Tuple[str,= int]: """ Run qemu-img and return both its output and its exit code """ + is_create =3D bool(args and args[0] =3D=3D 'create') full_args =3D qemu_img_args + qemu_img_create_prepare_args(list(args)) - return qemu_tool_pipe_and_status('qemu-img', full_args) + return qemu_tool_pipe_and_status('qemu-img', full_args, + drop_successful_output=3Dis_create) =20 def qemu_img(*args: str) -> int: '''Run qemu-img and return the exit code''' --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643731102937821.5842143270471; Tue, 1 Feb 2022 07:58:22 -0800 (PST) Received: from localhost ([::1]:45478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvXy-0005l4-9A for importer@patchew.org; Tue, 01 Feb 2022 10:58:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuR5-0002g2-6V for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQz-0002z9-Q0 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:08 -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-311-CGe8m3SoMUqc84eEDxmvGA-1; Tue, 01 Feb 2022 09:43:37 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B4F538143E5; Tue, 1 Feb 2022 14:43:36 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 580FE7DE23; Tue, 1 Feb 2022 14:43:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726619; 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=y1Sr6Q+drHIUg8sjpecirbU02ibC7yPeZoah9O3blFA=; b=ha3NhwhVnP2fFBs9drRrLEG5v1KLsFNqhwlYv6V7fmGwo8KrBeLpuLRRz1bcEDKnu7y8rp U5QCzAmoZyWNEFlkVJdewthIsjHxUCM2nsXTAbVpkAvi4eemqyUh4pFvyjfjH2y42cV2VW uGw8iR4SD9y4oiPlwXp4Ec1rQkZR3Fo= X-MC-Unique: CGe8m3SoMUqc84eEDxmvGA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 12/24] iotests.py: filter compression type out Date: Tue, 1 Feb 2022 15:42:21 +0100 Message-Id: <20220201144233.617021-13-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643731104873100003 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We want iotests pass with both the default zlib compression and with IMGOPTS=3D'compression_type=3Dzstd'. Actually the only test that is interested in real compression type in test output is 287 (test for qcow2 compression type) and it's in bash. So for now we can safely filter out compression type in all qcow2 tests. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-11-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/206.out | 10 +++++----- tests/qemu-iotests/242.out | 10 +++++----- tests/qemu-iotests/274.out | 10 +++++----- tests/qemu-iotests/iotests.py | 2 ++ 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out index 80cd274223..7e95694777 100644 --- a/tests/qemu-iotests/206.out +++ b/tests/qemu-iotests/206.out @@ -18,7 +18,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -42,7 +42,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -66,7 +66,7 @@ virtual size: 32 MiB (33554432 bytes) cluster_size: 2097152 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: true refcount bits: 1 corrupt: false @@ -92,7 +92,7 @@ backing file: TEST_IMG.base backing file format: IMGFMT Format specific information: compat: 0.10 - compression type: zlib + compression type: COMPRESSION_TYPE refcount bits: 16 =20 =3D=3D=3D Successful image creation (encrypted) =3D=3D=3D @@ -109,7 +109,7 @@ encrypted: yes cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 encrypt: diff --git a/tests/qemu-iotests/242.out b/tests/qemu-iotests/242.out index 3759c99284..ce231424a7 100644 --- a/tests/qemu-iotests/242.out +++ b/tests/qemu-iotests/242.out @@ -12,7 +12,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -34,7 +34,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false bitmaps: [0]: @@ -68,7 +68,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false bitmaps: [0]: @@ -110,7 +110,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false bitmaps: [0]: @@ -161,7 +161,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false bitmaps: [0]: diff --git a/tests/qemu-iotests/274.out b/tests/qemu-iotests/274.out index 1d2928e14d..1ce40d839a 100644 --- a/tests/qemu-iotests/274.out +++ b/tests/qemu-iotests/274.out @@ -50,7 +50,7 @@ backing file: TEST_DIR/PID-base backing file format: IMGFMT Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -79,7 +79,7 @@ backing file: TEST_DIR/PID-base backing file format: IMGFMT Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -114,7 +114,7 @@ backing file: TEST_DIR/PID-base backing file format: IMGFMT Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -141,7 +141,7 @@ virtual size: 2 MiB (2097152 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -176,7 +176,7 @@ backing file: TEST_DIR/PID-base backing file format: IMGFMT Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 65780c6098..8cdb381f2a 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -497,6 +497,8 @@ def filter_img_info(output, filename): 'uuid: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', line) line =3D re.sub('cid: [0-9]+', 'cid: XXXXXXXXXX', line) + line =3D re.sub('(compression type: )(zlib|zstd)', r'\1COMPRESSION= _TYPE', + line) lines.append(line) return '\n'.join(lines) =20 --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643731316611500.46994151885474; Tue, 1 Feb 2022 08:01:56 -0800 (PST) Received: from localhost ([::1]:49918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvbP-0000Hp-JI for importer@patchew.org; Tue, 01 Feb 2022 11:01:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRW-0002n0-K8 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:48752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRL-00030f-3r for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:36 -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-99-Wm6Y0iN1NHmgNh9fVXHfFA-1; Tue, 01 Feb 2022 09:43:47 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 471D764093; Tue, 1 Feb 2022 14:43:46 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B91C74E89; Tue, 1 Feb 2022 14:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726630; 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=JeCkWUDsPMReqX8PROPWTVA1UQcsZbz/ulfWY0PXodM=; b=Sq18lulGCcNGs9UJy/QNIER0XxqPDrvSyldPORC5VtBwZlgtpyV5Z3ZpIzqFq+mAnmyJiG mKFt/0so3IccZUxUn9KFgBH0MV9uXSh96MLrbma9vPcG/167+bDXgsOl8+LPzacd8yzEX4 jihGwQ+GT0XMMRb2rIcTvFLuzvGIG1k= X-MC-Unique: Wm6Y0iN1NHmgNh9fVXHfFA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 13/24] iotest 302: use img_info_log() helper Date: Tue, 1 Feb 2022 15:42:22 +0100 Message-Id: <20220201144233.617021-14-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643731319369100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Instead of qemu_img_log("info", ..) use generic helper img_info_log(). img_info_log() has smarter logic. For example it use filter_img_info() to filter output, which in turns filter a compression type. So it will help us in future when we implement a possibility to use zstd compression by default (with help of some runtime config file or maybe build option). For now to test you should recompile qemu with a small addition into block/qcow2.c before "if (qcow2_opts->has_compression_type": if (!qcow2_opts->has_compression_type && version >=3D 3) { qcow2_opts->has_compression_type =3D true; qcow2_opts->compression_type =3D QCOW2_COMPRESSION_TYPE_ZSTD; } Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-12-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/302 | 4 +++- tests/qemu-iotests/302.out | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/302 b/tests/qemu-iotests/302 index 5695af4914..a6d79e727b 100755 --- a/tests/qemu-iotests/302 +++ b/tests/qemu-iotests/302 @@ -34,6 +34,7 @@ from iotests import ( qemu_img_measure, qemu_io, qemu_nbd_popen, + img_info_log, ) =20 iotests.script_initialize(supported_fmts=3D["qcow2"]) @@ -88,6 +89,7 @@ with tarfile.open(tar_file, "w") as tar: tar_file): =20 iotests.log("=3D=3D=3D Target image info =3D=3D=3D") + # Not img_info_log as it enforces imgfmt, but now we print info on= raw qemu_img_log("info", nbd_uri) =20 qemu_img( @@ -99,7 +101,7 @@ with tarfile.open(tar_file, "w") as tar: nbd_uri) =20 iotests.log("=3D=3D=3D Converted image info =3D=3D=3D") - qemu_img_log("info", nbd_uri) + img_info_log(nbd_uri) =20 iotests.log("=3D=3D=3D Converted image check =3D=3D=3D") qemu_img_log("check", nbd_uri) diff --git a/tests/qemu-iotests/302.out b/tests/qemu-iotests/302.out index e2f6077e83..3e7c281b91 100644 --- a/tests/qemu-iotests/302.out +++ b/tests/qemu-iotests/302.out @@ -6,14 +6,13 @@ virtual size: 448 KiB (458752 bytes) disk size: unavailable =20 =3D=3D=3D Converted image info =3D=3D=3D -image: nbd+unix:///exp?socket=3DSOCK_DIR/PID-nbd-sock -file format: qcow2 +image: TEST_IMG +file format: IMGFMT virtual size: 1 GiB (1073741824 bytes) -disk size: unavailable cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730241223860.5684685550219; Tue, 1 Feb 2022 07:44:01 -0800 (PST) Received: from localhost ([::1]:44922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvK4-0001il-IF for importer@patchew.org; Tue, 01 Feb 2022 10:44:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRS-0002mJ-Bq for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRL-00031Y-1I for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:32 -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-62-ndr_zvQhMgWcOAjH7FMaig-1; Tue, 01 Feb 2022 09:43:50 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78AB1640A3; Tue, 1 Feb 2022 14:43:48 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F75370D31; Tue, 1 Feb 2022 14:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726636; 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=dvtPQCatEZe0xC82XXY+CMWfvD5GlCP7wXvXV1nBZkQ=; b=HQaFKMFEV1ms6r1zEsgWlTmYznoRs9XLoBRGyVwss7m9s8/8Vc+g1ZH3/hQHxuqsK0WVXk djnBBAUAj4YnHA84QEr4sN5yTKz86x1CFRGu3iHwKrOU5KGsD2jr/tutRv7jt/oiNhiHna WVQMCUaRebWpREF+ZMcJ3DYGgbC0ObI= X-MC-Unique: ndr_zvQhMgWcOAjH7FMaig-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 14/24] qcow2: simple case support for downgrading of qcow2 images with zstd Date: Tue, 1 Feb 2022 15:42:23 +0100 Message-Id: <20220201144233.617021-15-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730243062100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy If image doesn't have any compressed cluster we can easily switch to zlib compression, which may allow to downgrade the image. That's mostly needed to support IMGOPTS=3D'compression_type=3Dzstd' in some iotests which do qcow2 downgrade. While being here also fix checkpatch complain against '#' in printf formatting. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-13-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- block/qcow2.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index d509016756..c8115e1cba 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -5279,6 +5279,38 @@ static int qcow2_load_vmstate(BlockDriverState *bs, = QEMUIOVector *qiov, return bs->drv->bdrv_co_preadv_part(bs, offset, qiov->size, qiov, 0, 0= ); } =20 +static int qcow2_has_compressed_clusters(BlockDriverState *bs) +{ + int64_t offset =3D 0; + int64_t bytes =3D bdrv_getlength(bs); + + if (bytes < 0) { + return bytes; + } + + while (bytes !=3D 0) { + int ret; + QCow2SubclusterType type; + unsigned int cur_bytes =3D MIN(INT_MAX, bytes); + uint64_t host_offset; + + ret =3D qcow2_get_host_offset(bs, offset, &cur_bytes, &host_offset, + &type); + if (ret < 0) { + return ret; + } + + if (type =3D=3D QCOW2_SUBCLUSTER_COMPRESSED) { + return 1; + } + + offset +=3D cur_bytes; + bytes -=3D cur_bytes; + } + + return 0; +} + /* * Downgrades an image's version. To achieve this, any incompatible featur= es * have to be removed. @@ -5336,9 +5368,10 @@ static int qcow2_downgrade(BlockDriverState *bs, int= target_version, * the first place; if that happens nonetheless, returning -ENOTSUP is= the * best thing to do anyway */ =20 - if (s->incompatible_features) { + if (s->incompatible_features & ~QCOW2_INCOMPAT_COMPRESSION) { error_setg(errp, "Cannot downgrade an image with incompatible feat= ures " - "%#" PRIx64 " set", s->incompatible_features); + "0x%" PRIx64 " set", + s->incompatible_features & ~QCOW2_INCOMPAT_COMPRESSION); return -ENOTSUP; } =20 @@ -5356,6 +5389,27 @@ static int qcow2_downgrade(BlockDriverState *bs, int= target_version, return ret; } =20 + if (s->incompatible_features & QCOW2_INCOMPAT_COMPRESSION) { + ret =3D qcow2_has_compressed_clusters(bs); + if (ret < 0) { + error_setg(errp, "Failed to check block status"); + return -EINVAL; + } + if (ret) { + error_setg(errp, "Cannot downgrade an image with zstd compress= ion " + "type and existing compressed clusters"); + return -ENOTSUP; + } + /* + * No compressed clusters for now, so just chose default zlib + * compression. + */ + s->incompatible_features &=3D ~QCOW2_INCOMPAT_COMPRESSION; + s->compression_type =3D QCOW2_COMPRESSION_TYPE_ZLIB; + } + + assert(s->incompatible_features =3D=3D 0); + s->qcow_version =3D target_version; ret =3D qcow2_update_header(bs); if (ret < 0) { --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643732839813403.59357095722623; Tue, 1 Feb 2022 08:27:19 -0800 (PST) Received: from localhost ([::1]:60336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvzx-00024K-UJ for importer@patchew.org; Tue, 01 Feb 2022 11:27:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRM-0002jn-O5 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37373) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRK-00031N-Nd for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:28 -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-524-U6kJkIP0MX-9qY2zJ56CTw-1; Tue, 01 Feb 2022 09:43:51 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 88FD28519F2; Tue, 1 Feb 2022 14:43:50 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E3E5752D9; Tue, 1 Feb 2022 14:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726635; 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=+Xwk9DN7yU2PApPIvMf0rAeulFfnQk7+1peMIStoBRc=; b=gwE0TxvYtd3OGsXHBPnRGLFkSLIq0Iw+nK1crjXssm3zfO/OhfYPNFTTb3CFO31K/UesLA V2gHCfkdvuWta9vOTTRQ3rlWu7UML0Fx5Z0o9on+sIJffBm5W8FMaan8JzZMrHXoXv34uN AvBfho5gQ/G2Phzmy94CL/sG/20Z6A4= X-MC-Unique: U6kJkIP0MX-9qY2zJ56CTw-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 15/24] iotests/common.rc: introduce _qcow2_dump_header helper Date: Tue, 1 Feb 2022 15:42:24 +0100 Message-Id: <20220201144233.617021-16-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643732842986100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We'll use it in tests instead of explicit qcow2.py. Then we are going to add some filtering in _qcow2_dump_header. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-14-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/common.rc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index d8582454de..5dea310ea0 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -996,5 +996,15 @@ _require_one_device_of() _notrun "$* not available" } =20 +_qcow2_dump_header() +{ + img=3D"$1" + if [ -z "$img" ]; then + img=3D"$TEST_IMG" + fi + + $PYTHON qcow2.py "$img" dump-header +} + # make sure this script returns success true --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164373019924242.2149783503977; Tue, 1 Feb 2022 07:43:19 -0800 (PST) Received: from localhost ([::1]:42602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvJO-0008V6-95 for importer@patchew.org; Tue, 01 Feb 2022 10:43:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQY-0002b3-PO for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:46:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuQT-00031K-Sd for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:46:37 -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-471-GrfgoOG3N4mhXJR6syDfXA-1; Tue, 01 Feb 2022 09:43:54 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C4E7764083; Tue, 1 Feb 2022 14:43:52 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B15F5DBB7; Tue, 1 Feb 2022 14:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726635; 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=cDg7ACz8VSWYIqRUrrFSCevtN6+Wto/rpYvUubzNvY8=; b=P78FDwPe6doRvhLPZ69mseD0zxAKtDtwV7eEz8VgSeGlurr/DFPWb/3VHLaNSPdsNi0aVz CXES1I3J9/Kyj8Zf1muJFKKntqIiNvXPcIpLmAKSUIvqfXcCYTbXsXbRrK2Cj5VGzcRkah zmuUax9P2idayAWljUjtVI93UY1oOgI= X-MC-Unique: GrfgoOG3N4mhXJR6syDfXA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 16/24] iotests: massive use _qcow2_dump_header Date: Tue, 1 Feb 2022 15:42:25 +0100 Message-Id: <20220201144233.617021-17-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730200699100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We are going to add filtering in _qcow2_dump_header and want all tests use it. The patch is generated by commands: cd tests/qemu-iotests sed -ie 's/$PYTHON qcow2.py "$TEST_IMG" dump-header\($\| \)/_qcow2_dump_h= eader\1/' ??? tests/* (the difficulty is to avoid converting dump-header-exts) Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-15-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/031 | 6 +++--- tests/qemu-iotests/036 | 6 +++--- tests/qemu-iotests/039 | 20 ++++++++++---------- tests/qemu-iotests/060 | 20 ++++++++++---------- tests/qemu-iotests/061 | 36 ++++++++++++++++++------------------ tests/qemu-iotests/137 | 2 +- tests/qemu-iotests/287 | 8 ++++---- 7 files changed, 49 insertions(+), 49 deletions(-) diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031 index 58b57a0ef2..648112f796 100755 --- a/tests/qemu-iotests/031 +++ b/tests/qemu-iotests/031 @@ -58,21 +58,21 @@ for compat in "compat=3D0.10" "compat=3D1.1"; do echo _make_test_img -o $compat 64M $PYTHON qcow2.py "$TEST_IMG" add-header-ext 0x12345678 "This is a test= header extension" - $PYTHON qcow2.py "$TEST_IMG" dump-header + _qcow2_dump_header _check_test_img =20 echo echo =3D=3D=3D Rewrite header with no backing file =3D=3D=3D echo $QEMU_IMG rebase -u -b "" "$TEST_IMG" - $PYTHON qcow2.py "$TEST_IMG" dump-header + _qcow2_dump_header _check_test_img =20 echo echo =3D=3D=3D Add a backing file and format =3D=3D=3D echo $QEMU_IMG rebase -u -b "/some/backing/file/path" -F host_device "$TEST= _IMG" - $PYTHON qcow2.py "$TEST_IMG" dump-header + _qcow2_dump_header done =20 # success, all done diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036 index 5e567012a8..f703605e44 100755 --- a/tests/qemu-iotests/036 +++ b/tests/qemu-iotests/036 @@ -58,7 +58,7 @@ $PYTHON qcow2.py "$TEST_IMG" set-feature-bit incompatible= 63 =20 # Without feature table $PYTHON qcow2.py "$TEST_IMG" del-header-ext 0x6803f857 -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep features +_qcow2_dump_header | grep features $PYTHON qcow2.py "$TEST_IMG" dump-header-exts _img_info =20 @@ -107,7 +107,7 @@ echo =3D=3D=3D Create image with unknown autoclear feat= ure bit =3D=3D=3D echo _make_test_img 64M $PYTHON qcow2.py "$TEST_IMG" set-feature-bit autoclear 63 -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep features +_qcow2_dump_header | grep features $PYTHON qcow2.py "$TEST_IMG" dump-header-exts =20 echo @@ -115,7 +115,7 @@ echo =3D=3D=3D Repair image =3D=3D=3D echo _check_test_img -r all =20 -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep features +_qcow2_dump_header | grep features $PYTHON qcow2.py "$TEST_IMG" dump-header-exts =20 # success, all done diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 index 12b2c7fa7b..8e783a8380 100755 --- a/tests/qemu-iotests/039 +++ b/tests/qemu-iotests/039 @@ -59,7 +59,7 @@ _make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" $size $QEMU_IO -c "write -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io =20 # The dirty bit must not be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features _check_test_img =20 echo @@ -73,7 +73,7 @@ $QEMU_IO -c "write -P 0x5a 0 512" \ | _filter_qemu_io =20 # The dirty bit must be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features _check_test_img =20 echo @@ -82,7 +82,7 @@ echo "=3D=3D Read-only access must still work =3D=3D" $QEMU_IO -r -c "read -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io =20 # The dirty bit must be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 echo echo "=3D=3D Repairing the image file must succeed =3D=3D" @@ -90,7 +90,7 @@ echo "=3D=3D Repairing the image file must succeed =3D=3D" _check_test_img -r all =20 # The dirty bit must not be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 echo echo "=3D=3D Data should still be accessible after repair =3D=3D" @@ -108,12 +108,12 @@ $QEMU_IO -c "write -P 0x5a 0 512" \ | _filter_qemu_io =20 # The dirty bit must be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 $QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io =20 # The dirty bit must not be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 echo echo "=3D=3D Creating an image file with lazy_refcounts=3Doff =3D=3D" @@ -126,7 +126,7 @@ $QEMU_IO -c "write -P 0x5a 0 512" \ | _filter_qemu_io =20 # The dirty bit must not be set since lazy_refcounts=3Doff -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features _check_test_img =20 echo @@ -141,7 +141,7 @@ $QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io $QEMU_IMG commit "$TEST_IMG" =20 # The dirty bit must not be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features $PYTHON qcow2.py "$TEST_IMG".base dump-header | grep incompatible_features =20 _check_test_img @@ -159,7 +159,7 @@ $QEMU_IO -c "reopen -o lazy-refcounts=3Don" \ | _filter_qemu_io =20 # The dirty bit must be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features _check_test_img =20 _make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" $size @@ -171,7 +171,7 @@ $QEMU_IO -c "reopen -o lazy-refcounts=3Doff" \ | _filter_qemu_io =20 # The dirty bit must not be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features _check_test_img =20 =20 diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index db26c6b246..d1e3204d4e 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -80,13 +80,13 @@ poke_file "$TEST_IMG" "$l1_offset" "\x80\x00\x00\x00\x0= 0\x03\x00\x00" _check_test_img =20 # The corrupt bit should not be set anyway -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 # Try to write something, thereby forcing the corrupt bit to be set $QEMU_IO -c "$OPEN_RW" -c "write -P 0x2a 0 512" | _filter_qemu_io =20 # The corrupt bit must now be set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 # This information should be available through qemu-img info _img_info --format-specific @@ -114,19 +114,19 @@ poke_file "$TEST_IMG" "$(($rb_offset+8))" "\x00\x01" # Redirect new data cluster onto refcount block poke_file "$TEST_IMG" "$l2_offset" "\x80\x00\x00\x00\x00\x02\x00\x00" _check_test_img -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features $QEMU_IO -c "$OPEN_RW" -c "write -P 0x2a 0 512" | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 # Try to fix it _check_test_img -r all =20 # The corrupt bit should be cleared -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 # Look if it's really really fixed $QEMU_IO -c "$OPEN_RW" -c "write -P 0x2a 0 512" | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 echo echo "=3D=3D=3D Testing cluster data reference into inactive L2 table =3D= =3D=3D" @@ -139,13 +139,13 @@ $QEMU_IO -c "$OPEN_RW" -c "write -P 2 0 512" | _filte= r_qemu_io poke_file "$TEST_IMG" "$l2_offset_after_snapshot" \ "\x80\x00\x00\x00\x00\x04\x00\x00" _check_test_img -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features $QEMU_IO -c "$OPEN_RW" -c "write -P 3 0 512" | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features _check_test_img -r all -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features $QEMU_IO -c "$OPEN_RW" -c "write -P 4 0 512" | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 # Check data $QEMU_IO -c "$OPEN_RO" -c "read -P 4 0 512" | _filter_qemu_io diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 index 9507c223bd..70edf1a163 100755 --- a/tests/qemu-iotests/061 +++ b/tests/qemu-iotests/061 @@ -55,9 +55,9 @@ echo "=3D=3D=3D Testing version downgrade with zero expan= sion =3D=3D=3D" echo _make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io _check_test_img =20 @@ -68,10 +68,10 @@ _make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M $QEMU_IO -c "write -z 0 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "write -z 32M 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c map "$TEST_IMG" | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IMG amend -o "compat=3D0.10" --image-opts \ driver=3Dqcow2,file.filename=3D$TEST_IMG,l2-cache-entry-size=3D4= 096 -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c "read -P 0 32M 128k" "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c map "$TEST_IMG" | _filter_qemu_io @@ -84,9 +84,9 @@ _make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M _NO_VALGRIND \ $QEMU_IO -c "write -P 0x2a 0 128k" -c flush \ -c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IO -c "read -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io _check_test_img =20 @@ -96,9 +96,9 @@ echo _make_test_img -o "compat=3D1.1" 64M $PYTHON qcow2.py "$TEST_IMG" set-feature-bit compatible 42 $PYTHON qcow2.py "$TEST_IMG" set-feature-bit autoclear 42 -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IMG amend -o "compat=3D0.10" "$TEST_IMG" -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header _check_test_img =20 echo @@ -106,9 +106,9 @@ echo "=3D=3D=3D Testing version upgrade and resize =3D= =3D=3D" echo _make_test_img -o "compat=3D0.10" 64M $QEMU_IO -c "write -P 0x2a 42M 64k" "$TEST_IMG" | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IMG amend -o "compat=3D1.1,lazy_refcounts=3Don,size=3D128M" "$TEST_I= MG" -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IO -c "read -P 0x2a 42M 64k" "$TEST_IMG" | _filter_qemu_io _check_test_img =20 @@ -120,29 +120,29 @@ $QEMU_IO -c "write -P 0x2a 24M 64k" "$TEST_IMG" | _fi= lter_qemu_io $QEMU_IMG snapshot -c foo "$TEST_IMG" $QEMU_IMG resize "$TEST_IMG" 64M && echo "unexpected pass" -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep '^\(version\|size\|nb_snap= \)' +_qcow2_dump_header | grep '^\(version\|size\|nb_snap\)' =20 $QEMU_IMG amend -o "compat=3D1.1,size=3D128M" "$TEST_IMG" || echo "unexpected fail" -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep '^\(version\|size\|nb_snap= \)' +_qcow2_dump_header | grep '^\(version\|size\|nb_snap\)' =20 $QEMU_IMG snapshot -c bar "$TEST_IMG" $QEMU_IMG resize --shrink "$TEST_IMG" 64M || echo "unexpected fail" -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep '^\(version\|size\|nb_snap= \)' +_qcow2_dump_header | grep '^\(version\|size\|nb_snap\)' =20 $QEMU_IMG amend -o "compat=3D0.10,size=3D32M" "$TEST_IMG" && echo "unexpected pass" -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep '^\(version\|size\|nb_snap= \)' +_qcow2_dump_header | grep '^\(version\|size\|nb_snap\)' =20 $QEMU_IMG snapshot -a bar "$TEST_IMG" || echo "unexpected fail" -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep '^\(version\|size\|nb_snap= \)' +_qcow2_dump_header | grep '^\(version\|size\|nb_snap\)' =20 $QEMU_IMG snapshot -d bar "$TEST_IMG" $QEMU_IMG amend -o "compat=3D0.10,size=3D32M" "$TEST_IMG" || echo "unexpected fail" -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep '^\(version\|size\|nb_snap= \)' +_qcow2_dump_header | grep '^\(version\|size\|nb_snap\)' =20 _check_test_img =20 @@ -154,9 +154,9 @@ _make_test_img -o "compat=3D1.1,lazy_refcounts=3Don" 64M _NO_VALGRIND \ $QEMU_IO -c "write -P 0x2a 0 128k" -c flush \ -c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 | _filter_qemu_io -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IMG amend -o "lazy_refcounts=3Doff" "$TEST_IMG" -$PYTHON qcow2.py "$TEST_IMG" dump-header +_qcow2_dump_header $QEMU_IO -c "read -P 0x2a 0 128k" "$TEST_IMG" | _filter_qemu_io _check_test_img =20 diff --git a/tests/qemu-iotests/137 b/tests/qemu-iotests/137 index 4680d5df3d..52ee135184 100755 --- a/tests/qemu-iotests/137 +++ b/tests/qemu-iotests/137 @@ -140,7 +140,7 @@ $QEMU_IO \ =20 # The dirty bit must not be set # (Filter the external data file bit) -if $PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features \ +if _qcow2_dump_header | grep incompatible_features \ | grep -q '\<0\>' then echo 'ERROR: Dirty bit set' diff --git a/tests/qemu-iotests/287 b/tests/qemu-iotests/287 index 2d5334e8bf..5427ad5456 100755 --- a/tests/qemu-iotests/287 +++ b/tests/qemu-iotests/287 @@ -61,13 +61,13 @@ echo echo "=3D=3D=3D Testing compression type incompatible bit setting for zlib= =3D=3D=3D" echo _make_test_img -o compression_type=3Dzlib 64M -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 echo echo "=3D=3D=3D Testing compression type incompatible bit setting for zstd= =3D=3D=3D" echo _make_test_img -o compression_type=3Dzstd 64M -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 echo echo "=3D=3D=3D Testing zlib with incompatible bit set =3D=3D=3D" @@ -75,7 +75,7 @@ echo _make_test_img -o compression_type=3Dzlib 64M $PYTHON qcow2.py "$TEST_IMG" set-feature-bit incompatible 3 # to make sure the bit was actually set -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then echo "Error: The image opened successfully. The image must not be open= ed." @@ -87,7 +87,7 @@ echo _make_test_img -o compression_type=3Dzstd 64M $PYTHON qcow2.py "$TEST_IMG" set-header incompatible_features 0 # to make sure the bit was actually unset -$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features +_qcow2_dump_header | grep incompatible_features =20 if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then echo "Error: The image opened successfully. The image must not be open= ed." --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730010808954.2554579201792; Tue, 1 Feb 2022 07:40:10 -0800 (PST) Received: from localhost ([::1]:35994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvGM-0003uU-0K for importer@patchew.org; Tue, 01 Feb 2022 10:40:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRK-0002jD-V5 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRC-000320-OV for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:23 -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-477-9rW7gO2LM46CxDwfJIMNfA-1; Tue, 01 Feb 2022 09:43:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 12BC31853028; Tue, 1 Feb 2022 14:43:55 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9E87752DC; Tue, 1 Feb 2022 14:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726639; 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=cOwd976ZkCxTHyx7WyVoHEGfka5t5wqZwTU7gBZF170=; b=EEx8JWr50b5I/gLNgyFVJ6Eh+ezUsJIvCJU0qG41WgpMOC0ypTYBkW/LUZFXRM0cl8A3fG GtKi8EAMIcciS4LNDMZJEXLTArUaOkAFD4kOAupNd0Sfsg0t5dcfNIXK6ismJEUli1JOZ7 M75tnQ0Jwk+TBm4PGfmmaqxdskY0RVE= X-MC-Unique: 9rW7gO2LM46CxDwfJIMNfA-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 17/24] iotest 39: use _qcow2_dump_header Date: Tue, 1 Feb 2022 15:42:26 +0100 Message-Id: <20220201144233.617021-18-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730013283100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy _qcow2_dump_header has filter for compression type, so this change makes test pass with IMGOPTS=3D'compression_type=3Dzstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-16-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/039 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 index 8e783a8380..00d379cde2 100755 --- a/tests/qemu-iotests/039 +++ b/tests/qemu-iotests/039 @@ -142,7 +142,7 @@ $QEMU_IMG commit "$TEST_IMG" =20 # The dirty bit must not be set _qcow2_dump_header | grep incompatible_features -$PYTHON qcow2.py "$TEST_IMG".base dump-header | grep incompatible_features +_qcow2_dump_header "$TEST_IMG".base | grep incompatible_features =20 _check_test_img TEST_IMG=3D"$TEST_IMG".base _check_test_img --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643731859992576.0205266624982; Tue, 1 Feb 2022 08:10:59 -0800 (PST) Received: from localhost ([::1]:34720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvkB-0000zE-5v for importer@patchew.org; Tue, 01 Feb 2022 11:10:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRH-0002ij-7V for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuR6-000337-VN for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:18 -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-649-IPhWmTjlNqOoonna-RPxqg-1; Tue, 01 Feb 2022 09:43:58 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 725C01091DA0; Tue, 1 Feb 2022 14:43:57 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCD31694BF; Tue, 1 Feb 2022 14:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726642; 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=jtblX3LJL9Mjij0dB8LHJlSnSd5p8GepfY2WsPdYtYw=; b=URonqoIeK/fwLcNVeVWtOcnvWr2NGuTO8uH3OHsOyySwtB3DvbBWy96dCxI8+feV8rPYQR lRBgRjn37vxDUb6rO9vKZWQdTFg/8Hwukg42rbhhXufRFZaZPIRlSHasL3FGuTsa9wcbmP FqSKdyJZa42kxmxS7f7Nlf/xXNLaLgY= X-MC-Unique: IPhWmTjlNqOoonna-RPxqg-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 18/24] iotests: bash tests: filter compression type Date: Tue, 1 Feb 2022 15:42:27 +0100 Message-Id: <20220201144233.617021-19-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643731861645100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy We want iotests pass with both the default zlib compression and with IMGOPTS=3D'compression_type=3Dzstd'. Actually the only test that is interested in real compression type in test output is 287 (test for qcow2 compression type), so implement specific option for it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-17-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/060.out | 2 +- tests/qemu-iotests/061.out | 12 ++++++------ tests/qemu-iotests/082.out | 14 +++++++------- tests/qemu-iotests/198.out | 4 ++-- tests/qemu-iotests/287 | 8 ++++---- tests/qemu-iotests/common.filter | 8 ++++++++ tests/qemu-iotests/common.rc | 14 +++++++++++++- 7 files changed, 41 insertions(+), 21 deletions(-) diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index b74540bafb..329977d9b9 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -17,7 +17,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: true diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index 7ecbd4dea8..139fc68177 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -525,7 +525,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data @@ -552,7 +552,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 data file: foo @@ -567,7 +567,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 data file raw: false @@ -583,7 +583,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data @@ -597,7 +597,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data @@ -612,7 +612,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out index 077ed0f2c7..d0dd333117 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -17,7 +17,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 4096 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: true refcount bits: 16 corrupt: false @@ -31,7 +31,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: true refcount bits: 16 corrupt: false @@ -329,7 +329,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 4096 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: true refcount bits: 16 corrupt: false @@ -342,7 +342,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: true refcount bits: 16 corrupt: false @@ -639,7 +639,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: true refcount bits: 16 corrupt: false @@ -652,7 +652,7 @@ virtual size: 130 MiB (136314880 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: false refcount bits: 16 corrupt: false @@ -665,7 +665,7 @@ virtual size: 132 MiB (138412032 bytes) cluster_size: 65536 Format specific information: compat: 1.1 - compression type: zlib + compression type: COMPRESSION_TYPE lazy refcounts: true refcount bits: 16 corrupt: false diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out index 3952708444..805494916f 100644 --- a/tests/qemu-iotests/198.out +++ b/tests/qemu-iotests/198.out @@ -36,7 +36,7 @@ image: json:{ /* filtered */ } file format: IMGFMT virtual size: 16 MiB (16777216 bytes) Format specific information: - compression type: zlib + compression type: COMPRESSION_TYPE encrypt: ivgen alg: plain64 hash alg: sha256 @@ -81,7 +81,7 @@ virtual size: 16 MiB (16777216 bytes) backing file: TEST_DIR/t.IMGFMT.base backing file format: IMGFMT Format specific information: - compression type: zlib + compression type: COMPRESSION_TYPE encrypt: ivgen alg: plain64 hash alg: sha256 diff --git a/tests/qemu-iotests/287 b/tests/qemu-iotests/287 index 5427ad5456..6414640b21 100755 --- a/tests/qemu-iotests/287 +++ b/tests/qemu-iotests/287 @@ -61,13 +61,13 @@ echo echo "=3D=3D=3D Testing compression type incompatible bit setting for zlib= =3D=3D=3D" echo _make_test_img -o compression_type=3Dzlib 64M -_qcow2_dump_header | grep incompatible_features +_qcow2_dump_header --no-filter-compression | grep incompatible_features =20 echo echo "=3D=3D=3D Testing compression type incompatible bit setting for zstd= =3D=3D=3D" echo _make_test_img -o compression_type=3Dzstd 64M -_qcow2_dump_header | grep incompatible_features +_qcow2_dump_header --no-filter-compression | grep incompatible_features =20 echo echo "=3D=3D=3D Testing zlib with incompatible bit set =3D=3D=3D" @@ -75,7 +75,7 @@ echo _make_test_img -o compression_type=3Dzlib 64M $PYTHON qcow2.py "$TEST_IMG" set-feature-bit incompatible 3 # to make sure the bit was actually set -_qcow2_dump_header | grep incompatible_features +_qcow2_dump_header --no-filter-compression | grep incompatible_features =20 if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then echo "Error: The image opened successfully. The image must not be open= ed." @@ -87,7 +87,7 @@ echo _make_test_img -o compression_type=3Dzstd 64M $PYTHON qcow2.py "$TEST_IMG" set-header incompatible_features 0 # to make sure the bit was actually unset -_qcow2_dump_header | grep incompatible_features +_qcow2_dump_header --no-filter-compression | grep incompatible_features =20 if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then echo "Error: The image opened successfully. The image must not be open= ed." diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 2b2b53946c..75cc241580 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -247,6 +247,7 @@ _filter_img_info() -e "/block_state_zero: \\(on\\|off\\)/d" \ -e "/log_size: [0-9]\\+/d" \ -e "s/iters: [0-9]\\+/iters: 1024/" \ + -e 's/\(compression type: \)\(zlib\|zstd\)/\1COMPRESSION_TYPE/' \ -e "s/uuid: [-a-f0-9]\\+/uuid: 00000000-0000-0000-0000-00000000000= 0/" | \ while IFS=3D'' read -r line; do if [[ $format_specific =3D=3D 1 ]]; then @@ -337,5 +338,12 @@ _filter_authz_check_tls() $SED -e 's/TLS x509 authz check for .* is denied/TLS x509 authz check = for DISTINGUISHED-NAME is denied/' } =20 +_filter_qcow2_compression_type_bit() +{ + $SED -e 's/\(incompatible_features\s\+\)\[3\(, \)\?/\1[/' \ + -e 's/\(incompatible_features.*\), 3\]/\1]/' \ + -e 's/\(incompatible_features.*\), 3\(,.*\)/\1\2/' +} + # make sure this script returns success true diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 5dea310ea0..9885030b43 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -699,6 +699,7 @@ _img_info() -e "s#$TEST_DIR#TEST_DIR#g" \ -e "s#$SOCK_DIR/fuse-#TEST_DIR/#g" \ -e "s#$IMGFMT#IMGFMT#g" \ + -e 's/\(compression type: \)\(zlib\|zstd\)/\1COMPRESSION_TYPE/= ' \ -e "/^disk size:/ D" \ -e "/actual-size/ D" | \ while IFS=3D'' read -r line; do @@ -998,12 +999,23 @@ _require_one_device_of() =20 _qcow2_dump_header() { + if [[ "$1" =3D=3D "--no-filter-compression" ]]; then + local filter_compression=3D0 + shift + else + local filter_compression=3D1 + fi + img=3D"$1" if [ -z "$img" ]; then img=3D"$TEST_IMG" fi =20 - $PYTHON qcow2.py "$img" dump-header + if [[ $filter_compression =3D=3D 0 ]]; then + $PYTHON qcow2.py "$img" dump-header + else + $PYTHON qcow2.py "$img" dump-header | _filter_qcow2_compression_ty= pe_bit + fi } =20 # make sure this script returns success --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643733147780225.86950380856126; Tue, 1 Feb 2022 08:32:27 -0800 (PST) Received: from localhost ([::1]:41566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEw4w-0000Jn-St for importer@patchew.org; Tue, 01 Feb 2022 11:32:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRW-0002mz-KP for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRL-00033N-53 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -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-466-Qi-yjtnnM8ac8FJufsVS5Q-1; Tue, 01 Feb 2022 09:44:01 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8051D1091DA3; Tue, 1 Feb 2022 14:43:59 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24D7E7DE43; Tue, 1 Feb 2022 14:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726644; 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=4m1IWIM4vrFshxv3bARBPkRLI1EnZQyjA3vdEGy/SvQ=; b=KsNSlZORtwFwGCq4wzNzgx70K5hh7PvCvJec1vyvHrlJm6Ey8OF/zR5MUWaBhixHgRWnVM JarWLryvGRQLyHwR7QsG69fiMfB8GxnLuAlAIPhdFlUYacYu4xOTmpqejYCNZUFxfiTltb VvEOv8B7DetyqWygzSwm9uwMCwE8nSY= X-MC-Unique: Qi-yjtnnM8ac8FJufsVS5Q-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 19/24] iotests 60: more accurate set dirty bit in qcow2 header Date: Tue, 1 Feb 2022 15:42:28 +0100 Message-Id: <20220201144233.617021-20-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643733149663100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Don't touch other incompatible bits, like compression-type. This makes the test pass with IMGOPTS=3D'compression_type=3Dzstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-18-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/060 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index d1e3204d4e..df87d600f7 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -326,7 +326,7 @@ _make_test_img 64M # Let the refblock appear unaligned poke_file "$TEST_IMG" "$rt_offset" "\x00\x00\x00\x00\xff\xff\x2a\x0= 0" # Mark the image dirty, thus forcing an automatic check when opening it -poke_file "$TEST_IMG" 72 "\x00\x00\x00\x00\x00\x00\x00\x01" +$PYTHON qcow2.py "$TEST_IMG" set-feature-bit incompatible 0 # Open the image (qemu should refuse to do so) $QEMU_IO -c close "$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt =20 --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730530881423.7986318639191; Tue, 1 Feb 2022 07:48:50 -0800 (PST) Received: from localhost ([::1]:53054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvOk-0007WC-78 for importer@patchew.org; Tue, 01 Feb 2022 10:48:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRM-0002jI-Ic for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRK-00034M-LF for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:28 -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-222-zLZZ77HOMEKGHJXIKptlyQ-1; Tue, 01 Feb 2022 09:44:02 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE8788144E0; Tue, 1 Feb 2022 14:44:01 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 567C0752D6; Tue, 1 Feb 2022 14:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726650; 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=mEZubA4ulbjlRJDiuwJYLdFsxmg+fwni0GGh0RbT14g=; b=ZDdT291xBTHGapWPjQZvJtAv7WSS37I8iJwwVQyTDEY23RLweK6V0KXMFOdOPUZNhEwJ5n txZPzPW4BdPG0kHOPxYzkpnDlnF7ZCn/SDfPAtcAYzb2aA/qiQAW7FLtZk48vmvSNtgZ3F tUpukoihuQu3UfMs2ACKUF0vXV808ZQ= X-MC-Unique: zLZZ77HOMEKGHJXIKptlyQ-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 20/24] iotest 214: explicit compression type Date: Tue, 1 Feb 2022 15:42:29 +0100 Message-Id: <20220201144233.617021-21-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730533447100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy The test-case "Corrupted size field in compressed cluster descriptor" heavily depends on zlib compression type. So, make it explicit. This way test passes with IMGOPTS=3D'compression_type=3Dzstd'. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-19-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/214 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214 index 0889089d81..c66e246ba2 100755 --- a/tests/qemu-iotests/214 +++ b/tests/qemu-iotests/214 @@ -51,7 +51,7 @@ echo # The L2 entries of the two compressed clusters are located at # 0x800000 and 0x800008, their original values are 0x4008000000a00000 # and 0x4008000000a00802 (5 sectors for compressed data each). -_make_test_img 8M -o cluster_size=3D2M +_make_test_img 8M -o cluster_size=3D2M,compression_type=3Dzlib $QEMU_IO -c "write -c -P 0x11 0 2M" -c "write -c -P 0x11 2M 2M" "$TEST_IMG= " \ 2>&1 | _filter_qemu_io | _filter_testdir =20 --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643730692480902.733383190527; Tue, 1 Feb 2022 07:51:32 -0800 (PST) Received: from localhost ([::1]:57990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvRL-0002gD-66 for importer@patchew.org; Tue, 01 Feb 2022 10:51:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRG-0002ie-S8 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuR6-00033n-Qg for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:16 -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-582-P_coUg61Px2ErTeqNKe0Dw-1; Tue, 01 Feb 2022 09:44:04 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BA44C1091DA6; Tue, 1 Feb 2022 14:44:03 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5FA1B752D0; Tue, 1 Feb 2022 14:44:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726645; 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=2sW42O4WbSGtiZVVHXKVJ30oeYi2esE3imjEpVkaKIY=; b=PTodWWRtDswSKwG4W2ktoJ8aNFEj5Oe67N9LU/lldRECb90oloIGURtIKHJc8mXfCmH2zu /r504YbW+e0aOEGPfTR3WfGom5xduglrywWNXY5M+tkmFs3ES8UvRx2W4sb4PP4aH3i4fZ 2jxXYb8i4+3rhs0rZcyRjtHNZvSNdEo= X-MC-Unique: P_coUg61Px2ErTeqNKe0Dw-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 21/24] iotests: declare lack of support for compresion_type in IMGOPTS Date: Tue, 1 Feb 2022 15:42:30 +0100 Message-Id: <20220201144233.617021-22-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643730695217100001 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy compression_type can't be used if we want to create image with compat=3D0.10. So, skip these tests, not many of them. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-20-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/031 | 5 +++-- tests/qemu-iotests/051 | 5 +++-- tests/qemu-iotests/061 | 6 +++++- tests/qemu-iotests/112 | 3 ++- tests/qemu-iotests/290 | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031 index 648112f796..ee587b1606 100755 --- a/tests/qemu-iotests/031 +++ b/tests/qemu-iotests/031 @@ -42,8 +42,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file fuse # We want to test compat=3D0.10, which does not support external data -# files or refcount widths other than 16 -_unsupported_imgopts data_file 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' +# files or refcount widths other than 16 or compression type +_unsupported_imgopts data_file compression_type \ + 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' =20 CLUSTER_SIZE=3D65536 =20 diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index e9042a6214..f1a506518b 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -41,8 +41,9 @@ _supported_fmt qcow2 _supported_proto file # A compat=3D0.10 image is created in this test which does not support any= thing # other than refcount_bits=3D16; -# it also will not support an external data file -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file +# it also will not support an external data file and compression type +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file \ + compression_type _require_drivers nbd =20 if [ "$QEMU_DEFAULT_MACHINE" =3D "pc" ]; then diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 index 70edf1a163..513fbec14c 100755 --- a/tests/qemu-iotests/061 +++ b/tests/qemu-iotests/061 @@ -48,7 +48,11 @@ _supported_os Linux # not work with it; # we have explicit tests for various cluster sizes, the remaining tests # require the default 64k cluster -_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file cl= uster_size +# we don't have explicit tests for zstd qcow2 compression type, as zstd ma= y be +# not compiled in. And we can't create compat images with comression type +# extension +_unsupported_imgopts 'refcount_bits=3D\([^1]\|.\([^6]\|$\)\)' data_file \ + cluster_size compression_type =20 echo echo "=3D=3D=3D Testing version downgrade with zero expansion =3D=3D=3D" diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112 index 07ac74fb2c..5333212993 100755 --- a/tests/qemu-iotests/112 +++ b/tests/qemu-iotests/112 @@ -43,7 +43,8 @@ _supported_proto file fuse # This test will set refcount_bits on its own which would conflict with the # manual setting; compat will be overridden as well; # and external data files do not work well with our refcount testing -_unsupported_imgopts refcount_bits 'compat=3D0.10' data_file +# also, compression type is not supported with compat=3D0.10 used in test +_unsupported_imgopts refcount_bits 'compat=3D0.10' data_file compression_t= ype =20 print_refcount_bits() { diff --git a/tests/qemu-iotests/290 b/tests/qemu-iotests/290 index ed80da2685..776b59de1b 100755 --- a/tests/qemu-iotests/290 +++ b/tests/qemu-iotests/290 @@ -41,7 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file fuse _supported_os Linux -_unsupported_imgopts 'compat=3D0.10' refcount_bits data_file +_unsupported_imgopts 'compat=3D0.10' refcount_bits data_file compression_t= ype =20 echo echo "### Test 'qemu-io -c discard' on a QCOW2 image without a backing fil= e" --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164373224595622.612862553420655; Tue, 1 Feb 2022 08:17:25 -0800 (PST) Received: from localhost ([::1]:51604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvqO-0004Ry-3a for importer@patchew.org; Tue, 01 Feb 2022 11:17:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRO-0002kQ-2w for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRK-000356-TF for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:29 -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-7-2Lv4cCLwPLOIe1qLBgQ1vw-1; Tue, 01 Feb 2022 09:44:07 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C40188519E1; Tue, 1 Feb 2022 14:44:05 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 69B90752D0; Tue, 1 Feb 2022 14:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726654; 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=H+Pb8HokcDYno3dh4hvfbNVCAwktJ6kXptko6KLaw7Q=; b=DFgz90nBEAWo+HS7/xpn2soFf9aoNLnxXOrOBrYvWNwt6/ZnTydFfXwYTccYYtGQ+8uWTR 2scWByFpyEzl5exCCZtNLqM7imUKOElgYETbJOAX2o7Saa1fO9kdW93/4w0EpYJZnrJ7Yp RP7knbsRGjGbbW/+ZxbuArDbHvM8xVk= X-MC-Unique: 2Lv4cCLwPLOIe1qLBgQ1vw-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 22/24] block-backend: Retain permissions after migration Date: Tue, 1 Feb 2022 15:42:31 +0100 Message-Id: <20220201144233.617021-23-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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.129.124; envelope-from=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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_H2=-0.001, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643732248121100001 After migration, the permissions the guest device wants to impose on its BlockBackend are stored in blk->perm and blk->shared_perm. In blk_root_activate(), we take our permissions, but keep all shared permissions open by calling `blk_set_perm(blk->perm, BLK_PERM_ALL)`. Only afterwards (immediately or later, depending on the runstate) do we restrict the shared permissions by calling `blk_set_perm(blk->perm, blk->shared_perm)`. Unfortunately, our first call with shared_perm=3DBLK_PERM_ALL has overwritten blk->shared_perm to be BLK_PERM_ALL, so this is a no-op and the set of shared permissions is not restricted. Fix this bug by saving the set of shared permissions before invoking blk_set_perm() with BLK_PERM_ALL and restoring it afterwards. Fixes: 5f7772c4d0cf32f4e779fcd5a69ae4dae24aeebf ("block-backend: Defer shared_perm tightening migration completion") Reported-by: Peng Liang Signed-off-by: Hanna Reitz Message-Id: <20211125135317.186576-2-hreitz@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Peng Liang --- block/block-backend.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index 23e727199b..4ff6b4d785 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -190,6 +190,7 @@ static void blk_root_activate(BdrvChild *child, Error *= *errp) { BlockBackend *blk =3D child->opaque; Error *local_err =3D NULL; + uint64_t saved_shared_perm; =20 if (!blk->disable_perm) { return; @@ -197,12 +198,22 @@ static void blk_root_activate(BdrvChild *child, Error= **errp) =20 blk->disable_perm =3D false; =20 + /* + * blk->shared_perm contains the permissions we want to share once + * migration is really completely done. For now, we need to share + * all; but we also need to retain blk->shared_perm, which is + * overwritten by a successful blk_set_perm() call. Save it and + * restore it below. + */ + saved_shared_perm =3D blk->shared_perm; + blk_set_perm(blk, blk->perm, BLK_PERM_ALL, &local_err); if (local_err) { error_propagate(errp, local_err); blk->disable_perm =3D true; return; } + blk->shared_perm =3D saved_shared_perm; =20 if (runstate_check(RUN_STATE_INMIGRATE)) { /* Activation can happen when migration process is still active, f= or --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643732007932897.2923957039291; Tue, 1 Feb 2022 08:13:27 -0800 (PST) Received: from localhost ([::1]:43030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvmZ-0006lt-6G for importer@patchew.org; Tue, 01 Feb 2022 11:13:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRO-0002kR-8w for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRK-00034G-PF for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:29 -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-590-Skvv6MmiPh-T6ygNtnCpfg-1; Tue, 01 Feb 2022 09:44:09 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA4D21091DA0; Tue, 1 Feb 2022 14:44:07 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C3CE70D2B; Tue, 1 Feb 2022 14:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726650; 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=EBP42+llKkf/zlfM9rVqtVCLG3K2hw9I/0giDQuALt4=; b=GY4EY4abaaEyyiP9cYzpFitN5JmJB0dSd3CGZdKDzAloBlBwzI+hj0okoX20hbHJvltnbH ePxR0syxGSTS5xk3HvzhFwQpHXmjbTvXn1jX714fnf5E0Vb4UNMK4tglOsaVaY2zMjxrLa aaAM4Ig9+z+JyoMQcM/1t3FvupcZDLI= X-MC-Unique: Skvv6MmiPh-T6ygNtnCpfg-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 23/24] iotests/migration-permissions: New test Date: Tue, 1 Feb 2022 15:42:32 +0100 Message-Id: <20220201144233.617021-24-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hreitz@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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, 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: , Cc: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643732010680100001 Content-Type: text/plain; charset="utf-8" This test checks that a raw image in use by a virtio-blk device does not share the WRITE permission both before and after migration. Signed-off-by: Hanna Reitz --- .../qemu-iotests/tests/migration-permissions | 101 ++++++++++++++++++ .../tests/migration-permissions.out | 5 + 2 files changed, 106 insertions(+) create mode 100755 tests/qemu-iotests/tests/migration-permissions create mode 100644 tests/qemu-iotests/tests/migration-permissions.out diff --git a/tests/qemu-iotests/tests/migration-permissions b/tests/qemu-io= tests/tests/migration-permissions new file mode 100755 index 0000000000..6be02581c7 --- /dev/null +++ b/tests/qemu-iotests/tests/migration-permissions @@ -0,0 +1,101 @@ +#!/usr/bin/env python3 +# group: migration +# +# Copyright (C) 2021 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import os +import iotests +from iotests import imgfmt, qemu_img_create, qemu_io + + +test_img =3D os.path.join(iotests.test_dir, 'test.img') +mig_sock =3D os.path.join(iotests.sock_dir, 'mig.sock') + + +class TestMigrationPermissions(iotests.QMPTestCase): + def setUp(self): + qemu_img_create('-f', imgfmt, test_img, '1M') + + # Set up two VMs (source and destination) accessing the same raw + # image file with a virtio-blk device; prepare the destination for + # migration with .add_incoming() and enable migration events + vms =3D [None, None] + for i in range(2): + vms[i] =3D iotests.VM(path_suffix=3Df'{i}') + vms[i].add_blockdev(f'file,node-name=3Dprot,filename=3D{test_i= mg}') + vms[i].add_blockdev(f'{imgfmt},node-name=3Dfmt,file=3Dprot') + vms[i].add_device('virtio-blk,drive=3Dfmt') + + if i =3D=3D 1: + vms[i].add_incoming(f'unix:{mig_sock}') + + vms[i].launch() + + result =3D vms[i].qmp('migrate-set-capabilities', + capabilities=3D[ + {'capability': 'events', 'state': True} + ]) + self.assert_qmp(result, 'return', {}) + + self.vm_s =3D vms[0] + self.vm_d =3D vms[1] + + def tearDown(self): + self.vm_s.shutdown() + self.vm_d.shutdown() + try: + os.remove(mig_sock) + except FileNotFoundError: + pass + os.remove(test_img) + + # Migrate an image in use by a virtio-blk device to another VM and + # verify that the WRITE permission is unshared both before and after + # migration + def test_post_migration_permissions(self): + # Try to access the image R/W, which should fail because virtio-blk + # has not been configured with share-rw=3Don + log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img) + if not log.strip(): + print('ERROR (pre-migration): qemu-io should not be able to ' + 'access this image, but it reported no error') + else: + # This is the expected output + assert 'Is another process using the image' in log + + # Now migrate the VM + self.vm_s.qmp('migrate', uri=3Df'unix:{mig_sock}') + assert self.vm_s.wait_migration(None) + assert self.vm_d.wait_migration(None) + + # Try the same qemu-io access again, verifying that the WRITE + # permission remains unshared + log =3D qemu_io('-f', imgfmt, '-c', 'quit', test_img) + if not log.strip(): + print('ERROR (post-migration): qemu-io should not be able to ' + 'access this image, but it reported no error') + else: + # This is the expected output + assert 'Is another process using the image' in log + + +if __name__ =3D=3D '__main__': + # Only works with raw images because we are testing the + # BlockBackend permissions; image format drivers may additionally + # unshare permissions and thus tamper with the result + iotests.main(supported_fmts=3D['raw'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/tests/migration-permissions.out b/tests/qem= u-iotests/tests/migration-permissions.out new file mode 100644 index 0000000000..ae1213e6f8 --- /dev/null +++ b/tests/qemu-iotests/tests/migration-permissions.out @@ -0,0 +1,5 @@ +. +---------------------------------------------------------------------- +Ran 1 tests + +OK --=20 2.34.1 From nobody Fri May 17 11:28:37 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643731611558131.0629335833711; Tue, 1 Feb 2022 08:06:51 -0800 (PST) Received: from localhost ([::1]:54360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEvgA-0003dG-Il for importer@patchew.org; Tue, 01 Feb 2022 11:06:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRS-0002mH-42 for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEuRK-00035o-Vp for qemu-devel@nongnu.org; Tue, 01 Feb 2022 09:47:31 -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-466-l7WNQVr2ODOP1xstS2Sh-w-1; Tue, 01 Feb 2022 09:44:18 -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 764511091DA1; Tue, 1 Feb 2022 14:44:17 +0000 (UTC) Received: from localhost (unknown [10.39.193.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E0F110A4B2A; Tue, 1 Feb 2022 14:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726659; 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=mZ7oPLP4UxfLyIyf/qXkjqCDbpV8idHpSluH2HZaDug=; b=SFr9wtRfuopI/IsbZOV8+Wr0OlFS6Y3S15bXaMmQ4PgSVqmES+I9otNe9oK9BlPG2NJFss ka4cLCGb06XWAD1Yf3u5Tul2X3BLehkhUcBnYCbP2sQG/BdycMA/DyMxsXjBJWfk4WwC1N BqxNtEwbBEif/BfotCwFDpHnoIe63hM= X-MC-Unique: l7WNQVr2ODOP1xstS2Sh-w-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 24/24] block.h: remove outdated comment Date: Tue, 1 Feb 2022 15:42:33 +0100 Message-Id: <20220201144233.617021-25-hreitz@redhat.com> In-Reply-To: <20220201144233.617021-1-hreitz@redhat.com> References: <20220201144233.617021-1-hreitz@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=hreitz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=hreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.081, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: Kevin Wolf , Peter Maydell , Hanna Reitz , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1643731612922100001 From: Emanuele Giuseppe Esposito The comment "disk I/O throttling" doesn't make any sense at all any more. It was added in commit 0563e191516 to describe bdrv_io_limits_enable()/disable(), which were removed in commit 97148076, so the comment is just a forgotten leftover. Suggested-by: Kevin Wolf Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20220131125615.74612-1-eesposit@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Hanna Reitz --- include/block/block.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/block/block.h b/include/block/block.h index 9d4050220b..e1713ee306 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -344,7 +344,6 @@ typedef unsigned int BdrvChildRole; char *bdrv_perm_names(uint64_t perm); uint64_t bdrv_qapi_perm_to_blk_perm(BlockPermission qapi_perm); =20 -/* disk I/O throttling */ void bdrv_init(void); void bdrv_init_with_whitelist(void); bool bdrv_uses_whitelist(void); --=20 2.34.1