From nobody Sat Sep 21 03:09:15 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 1647951604076723.5347873436838; Tue, 22 Mar 2022 05:20:04 -0700 (PDT) Received: from localhost ([::1]:53350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWdUZ-0003rI-0p for importer@patchew.org; Tue, 22 Mar 2022 08:20:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWd8l-0003Qk-2r for qemu-devel@nongnu.org; Tue, 22 Mar 2022 07:57:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:35705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWd8i-0006XB-LW for qemu-devel@nongnu.org; Tue, 22 Mar 2022 07:57:30 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-403-Y9lrb4Z6P2WyjgBN3Ep2_w-1; Tue, 22 Mar 2022 07:57:25 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B89121C04B5F; Tue, 22 Mar 2022 11:57:24 +0000 (UTC) Received: from localhost (unknown [10.39.194.233]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 545EE400E54A; Tue, 22 Mar 2022 11:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647950248; 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=iS3BtLoCzcRjS57tPU0kBHul11WGdwxkp7b3ZNP7CdI=; b=SNRJ5cEOFGsmZr/szMw7+fbA5EllyF8QQIVCtXsUb0j7jD/p2rkOOjTJe7Rjpx0L5LwpYr WfaU3mlITItd9ssC0sZ2PsF/PVhg3IYSl+D7MHAaOS1yOlIi8Yx9QtKQlzLOHMmLc5BM8x 0gt0c6pD7iWtQu7MQxYRvuRHShJp0Wo= X-MC-Unique: Y9lrb4Z6P2WyjgBN3Ep2_w-1 From: Hanna Reitz To: qemu-block@nongnu.org Subject: [PULL 21/25] iotests: replace qemu_img_log('create', ...) calls Date: Tue, 22 Mar 2022 12:56:43 +0100 Message-Id: <20220322115647.726044-22-hreitz@redhat.com> In-Reply-To: <20220322115647.726044-1-hreitz@redhat.com> References: <20220322115647.726044-1-hreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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 , 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: 1647951604672100001 Content-Type: text/plain; charset="utf-8" From: John Snow qemu_img_log() calls into qemu_img_pipe(), which always removes output for 'create' commands on success anyway. Replace all of these calls to the simpler qemu_img_create(...) which doesn't log, but raises a detailed exception object on failure instead. Blank lines are removed from output files where appropriate. Signed-off-by: John Snow Reviewed-by: Hanna Reitz Message-Id: <20220321201618.903471-17-jsnow@redhat.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/255 | 8 ++++---- tests/qemu-iotests/255.out | 4 ---- tests/qemu-iotests/274 | 17 ++++++++--------- tests/qemu-iotests/274.out | 29 ----------------------------- tests/qemu-iotests/280 | 2 +- tests/qemu-iotests/280.out | 1 - 6 files changed, 13 insertions(+), 48 deletions(-) diff --git a/tests/qemu-iotests/255 b/tests/qemu-iotests/255 index 3d6d0e80cb..f86fa851b6 100755 --- a/tests/qemu-iotests/255 +++ b/tests/qemu-iotests/255 @@ -42,8 +42,8 @@ with iotests.FilePath('t.qcow2') as disk_path, \ size_str =3D str(size) =20 iotests.create_image(base_path, size) - iotests.qemu_img_log('create', '-f', iotests.imgfmt, mid_path, size_st= r) - iotests.qemu_img_log('create', '-f', iotests.imgfmt, disk_path, size_s= tr) + iotests.qemu_img_create('-f', iotests.imgfmt, mid_path, size_str) + iotests.qemu_img_create('-f', iotests.imgfmt, disk_path, size_str) =20 # Create a backing chain like this: # base <- [throttled: bps-read=3D4096] <- mid <- overlay @@ -92,8 +92,8 @@ with iotests.FilePath('src.qcow2') as src_path, \ size =3D 128 * 1024 * 1024 size_str =3D str(size) =20 - iotests.qemu_img_log('create', '-f', iotests.imgfmt, src_path, size_st= r) - iotests.qemu_img_log('create', '-f', iotests.imgfmt, dst_path, size_st= r) + iotests.qemu_img_create('-f', iotests.imgfmt, src_path, size_str) + iotests.qemu_img_create('-f', iotests.imgfmt, dst_path, size_str) =20 iotests.log(iotests.qemu_io('-f', iotests.imgfmt, '-c', 'write 0 1M', src_path), diff --git a/tests/qemu-iotests/255.out b/tests/qemu-iotests/255.out index 11a05a5213..2e837cbb5f 100644 --- a/tests/qemu-iotests/255.out +++ b/tests/qemu-iotests/255.out @@ -3,8 +3,6 @@ Finishing a commit job with background reads =20 =3D=3D=3D Create backing chain and start VM =3D=3D=3D =20 - - =3D=3D=3D Start background read requests =3D=3D=3D =20 =3D=3D=3D Run a commit job =3D=3D=3D @@ -21,8 +19,6 @@ Closing the VM while a job is being cancelled =20 =3D=3D=3D Create images and start VM =3D=3D=3D =20 - - wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 diff --git a/tests/qemu-iotests/274 b/tests/qemu-iotests/274 index 080a90f10f..2495e051a2 100755 --- a/tests/qemu-iotests/274 +++ b/tests/qemu-iotests/274 @@ -31,12 +31,11 @@ size_long =3D 2 * 1024 * 1024 size_diff =3D size_long - size_short =20 def create_chain() -> None: - iotests.qemu_img_log('create', '-f', iotests.imgfmt, base, - str(size_long)) - iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', base, - '-F', iotests.imgfmt, mid, str(size_short)) - iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', mid, - '-F', iotests.imgfmt, top, str(size_long)) + iotests.qemu_img_create('-f', iotests.imgfmt, base, str(size_long)) + iotests.qemu_img_create('-f', iotests.imgfmt, '-b', base, + '-F', iotests.imgfmt, mid, str(size_short)) + iotests.qemu_img_create('-f', iotests.imgfmt, '-b', mid, + '-F', iotests.imgfmt, top, str(size_long)) =20 iotests.qemu_io_log('-c', 'write -P 1 0 %d' % size_long, base) =20 @@ -160,9 +159,9 @@ with iotests.FilePath('base') as base, \ ('off', '512k', '256k', '500k', '436k')]: =20 iotests.log('=3D=3D=3D preallocation=3D%s =3D=3D=3D' % prealloc) - iotests.qemu_img_log('create', '-f', iotests.imgfmt, base, base_si= ze) - iotests.qemu_img_log('create', '-f', iotests.imgfmt, '-b', base, - '-F', iotests.imgfmt, top, top_size_old) + iotests.qemu_img_create('-f', iotests.imgfmt, base, base_size) + iotests.qemu_img_create('-f', iotests.imgfmt, '-b', base, + '-F', iotests.imgfmt, top, top_size_old) iotests.qemu_io_log('-c', 'write -P 1 %s 64k' % off, base) =20 # After this, top_size_old to base_size should be allocated/zeroed. diff --git a/tests/qemu-iotests/274.out b/tests/qemu-iotests/274.out index 1ce40d839a..acd8b166a6 100644 --- a/tests/qemu-iotests/274.out +++ b/tests/qemu-iotests/274.out @@ -1,7 +1,4 @@ =3D=3D Commit tests =3D=3D - - - wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -63,9 +60,6 @@ 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 - - - wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -92,9 +86,6 @@ 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 - - - wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -127,9 +118,6 @@ 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 - - - wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -154,9 +142,6 @@ 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 - - - wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -190,8 +175,6 @@ read 1048576/1048576 bytes at offset 1048576 =20 =3D=3D Resize tests =3D=3D =3D=3D=3D preallocation=3Doff =3D=3D=3D - - wrote 65536/65536 bytes at offset 5368709120 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -207,8 +190,6 @@ 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 - - wrote 65536/65536 bytes at offset 33285996544 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -229,8 +210,6 @@ 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 - - wrote 65536/65536 bytes at offset 9437184 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -246,8 +225,6 @@ 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 - - wrote 65536/65536 bytes at offset 11534336 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -263,8 +240,6 @@ 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 - - wrote 65536/65536 bytes at offset 259072 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -281,8 +256,6 @@ 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 - - wrote 65536/65536 bytes at offset 344064 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 @@ -298,8 +271,6 @@ 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 - - wrote 65536/65536 bytes at offset 446464 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 diff --git a/tests/qemu-iotests/280 b/tests/qemu-iotests/280 index 628f3c33ca..5f50500fdb 100755 --- a/tests/qemu-iotests/280 +++ b/tests/qemu-iotests/280 @@ -33,7 +33,7 @@ with iotests.FilePath('base') as base_path , \ iotests.FilePath('top') as top_path, \ iotests.VM() as vm: =20 - iotests.qemu_img_log('create', '-f', iotests.imgfmt, base_path, '64M') + iotests.qemu_img_create('-f', iotests.imgfmt, base_path, '64M') =20 iotests.log('=3D=3D=3D Launch VM =3D=3D=3D') vm.add_object('iothread,id=3Diothread0') diff --git a/tests/qemu-iotests/280.out b/tests/qemu-iotests/280.out index e39164c579..c75f437c00 100644 --- a/tests/qemu-iotests/280.out +++ b/tests/qemu-iotests/280.out @@ -1,4 +1,3 @@ - =3D=3D=3D Launch VM =3D=3D=3D Enabling migration QMP events on VM... {"return": {}} --=20 2.35.1