From patchwork Thu May 12 21:39:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 621751 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r5RGv2g0qz9sXR for ; Fri, 13 May 2016 07:40:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=comcast.net header.i=@comcast.net header.b=jupdriP/; dkim-atps=neutral Received: from localhost ([::1]:59896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0yKz-0003zI-F4 for incoming@patchwork.ozlabs.org; Thu, 12 May 2016 17:40:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0yKa-0003Gx-Fk for qemu-devel@nongnu.org; Thu, 12 May 2016 17:39:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0yKZ-0003La-4H for qemu-devel@nongnu.org; Thu, 12 May 2016 17:39:40 -0400 Received: from resqmta-po-04v.sys.comcast.net ([2001:558:fe16:19:96:114:154:163]:34242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0yKY-0003LN-VG for qemu-devel@nongnu.org; Thu, 12 May 2016 17:39:39 -0400 Received: from resomta-po-09v.sys.comcast.net ([96.114.154.233]) by comcast with SMTP id 0yKWbVcGYIY3M0yKYbtprl; Thu, 12 May 2016 21:39:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1463089178; bh=6VQYFgBuGLJw6GkEGeRpg6/K8+UL3aG4fXQ2gLoeECE=; h=Received:Received:From:To:Subject:Date:Message-Id; b=jupdriP/upBw7P3zeayAtBYbAqkLIjPv7w64IVAWnmCv/maYY6vTZf5F8rF6UEmak AqcZ5UfWXnrrOzFQfv4Vd/CVFE8nmt39AEaVeGwxeSRi2GnTELov4SnqqZEC0JaJQg EJPQ1HacjxNr+C/KrObCP3l5ndk+hkjL1UVM+lkq8GzoK8RhCbI8PSq8g3PBpzWQnB 4mr+c3hoQLaZGCkRrH2WKGZZz3vV2pDWzZ3Xyazn8p/dhrrEGZienhCCPXVBQsa4v+ Rh3s/pxov0APb+4Vijjakb7r2V/gGtlJvqpnD5IL8w/EKgTfe5hc2fWY1esL86u9aa NGGYcilsaEglg== Received: from red.redhat.com ([24.10.254.122]) by resomta-po-09v.sys.comcast.net with comcast id tZfX1s0042fD5rL01ZfeCt; Thu, 12 May 2016 21:39:38 +0000 From: Eric Blake To: qemu-devel@nongnu.org Date: Thu, 12 May 2016 15:39:29 -0600 Message-Id: <1463089170-30550-3-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463089170-30550-1-git-send-email-eblake@redhat.com> References: <1463089170-30550-1-git-send-email-eblake@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:558:fe16:19:96:114:154:163 Subject: [Qemu-devel] [PATCH 2/3] qemu-iotests: Simplify 109 with unaligned qemu-img compare X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" For some time now, qemu-img compare has been able to compare unaligned images. So we no longer need test 109's hack of resizing to sector boundaries before invoking compare. Signed-off-by: Eric Blake Reviewed-by: Max Reitz --- Note that qemu-img compare on unaligned images is still a bit underwhelming on message quality: $ printf abc > file1 $ printf ab > file2 $ qemu-img compare file1 file2 Content mismatch at offset 0! $ printf 'ab\0' > file1 $ qemu-img compare file1 file2 Images are identical. The first message should claim that the mismatch is at offset 2 (or in sector 0), rather than at offset 0; and the second message might be wise to mention that the sizes differ even though the contents read identically (since we pad out 0s to the end of the sector for both raw files). But improving that is unrelated to this patch. --- tests/qemu-iotests/109 | 2 -- tests/qemu-iotests/109.out | 4 ---- 2 files changed, 6 deletions(-) diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109 index f980b0c..adf9889 100755 --- a/tests/qemu-iotests/109 +++ b/tests/qemu-iotests/109 @@ -104,8 +104,6 @@ for sample_img in empty.bochs iotest-dirtylog-10G-4M.vhdx parallels-v1 \ $QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY" - # qemu-img compare can't handle unaligned file sizes - $QEMU_IMG resize -f raw "$TEST_IMG.src" +0 $QEMU_IMG compare -f raw -F raw "$TEST_IMG" "$TEST_IMG.src" done diff --git a/tests/qemu-iotests/109.out b/tests/qemu-iotests/109.out index 38bc073..7c797ed 100644 --- a/tests/qemu-iotests/109.out +++ b/tests/qemu-iotests/109.out @@ -143,7 +143,6 @@ read 65536/65536 bytes at offset 0 {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 2560, "offset": 2560, "speed": 0, "type": "mirror"}} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 2560, "offset": 2560, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} -Image resized. Warning: Image size mismatch! Images are identical. @@ -164,7 +163,6 @@ read 65536/65536 bytes at offset 0 {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 31457280, "offset": 31457280, "speed": 0, "type": "mirror"}} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 31457280, "offset": 31457280, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} -Image resized. Warning: Image size mismatch! Images are identical. @@ -185,7 +183,6 @@ read 65536/65536 bytes at offset 0 {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 327680, "offset": 327680, "speed": 0, "type": "mirror"}} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 327680, "offset": 327680, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} -Image resized. Warning: Image size mismatch! Images are identical. @@ -206,7 +203,6 @@ read 65536/65536 bytes at offset 0 {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "src", "len": 2048, "offset": 2048, "speed": 0, "type": "mirror"}} {"return": [{"io-status": "ok", "device": "src", "busy": false, "len": 2048, "offset": 2048, "paused": false, "speed": 0, "ready": true, "type": "mirror"}]} -Image resized. Warning: Image size mismatch! Images are identical.