From patchwork Mon Oct 27 09:07:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 403490 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 5B4AC1400A6 for ; Mon, 27 Oct 2014 20:38:37 +1100 (AEDT) Received: from localhost ([::1]:60347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xigl1-0000M3-Is for incoming@patchwork.ozlabs.org; Mon, 27 Oct 2014 05:38:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XigkK-0007ei-Ac for qemu-devel@nongnu.org; Mon, 27 Oct 2014 05:37:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XigkF-000369-Sg for qemu-devel@nongnu.org; Mon, 27 Oct 2014 05:37:52 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:36490 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XigkF-00035k-Fo for qemu-devel@nongnu.org; Mon, 27 Oct 2014 05:37:47 -0400 Received: from hades.sw.ru ([10.30.8.132]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id s9R95eiU004185; Mon, 27 Oct 2014 13:05:54 +0400 (MSK) From: "Denis V. Lunev" To: Date: Mon, 27 Oct 2014 12:07:11 +0300 Message-Id: <1414400832-17798-9-git-send-email-den@openvz.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414400832-17798-1-git-send-email-den@openvz.org> References: <1414400832-17798-1-git-send-email-den@openvz.org> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Cc: Kevin Wolf , "Denis V. Lunev" , Jeff Cody , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 8/9] iotests: padded parallels image test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Unfortunately, old guest OSes do not align partitions to page size by default. This is true for Windows 2003 and Windows XP. "Padding" is a value which should be added to guest LBA to obtain sector number inside the image. This results in a shifted images. 0123 offset inside image (in 512 byte sectors) +------- +.012 guest data (512 byte sectors) +------- The information about this is available in DiskDescriptor.xml ONLY. There is no such data in the image header. This patch contains very simple image with padding and corresponding XML disk descriptor created in authentic way. Signed-off-by: Denis V. Lunev Acked-by: Roman Kagan CC: Jeff Cody CC: Kevin Wolf CC: Stefan Hajnoczi --- tests/qemu-iotests/076 | 6 ++++++ tests/qemu-iotests/076.out | 4 ++++ tests/qemu-iotests/sample_images/parallels-padded.xml.bz2 | Bin 0 -> 377 bytes tests/qemu-iotests/sample_images/parallels-v2-padded.bz2 | Bin 0 -> 139 bytes 4 files changed, 10 insertions(+) create mode 100644 tests/qemu-iotests/sample_images/parallels-padded.xml.bz2 create mode 100644 tests/qemu-iotests/sample_images/parallels-v2-padded.bz2 diff --git a/tests/qemu-iotests/sample_images/parallels-padded.xml.bz2 b/tests/qemu-iotests/sample_images/parallels-padded.xml.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..90e481b88e1f4d65256d0511a8509114c6358052 GIT binary patch literal 377 zcmV-<0fzoUT4*^jL0KkKS+JP`&Hw4nhyVtdfq>MRN`P%Vs7e5mydg1cvP<`s zYo%7Ss&>_C5i%-bDqP)#HmEBiP+TU)8WyoiurHMw!l_ZF1>8_3m3N^^QwEd8=8hkN zLO3;VtVoT0C3B518KN#oIV4@)7DfOSbkchYBQVO$9`K;#(G?m(FfikRxR&q(!eB`z zPfQaAWzYbTAj%3PZH#S=y0Cm|7Ih97TD6vNg%Klm)F8;i7;OxS)eka zB8A?w-LbwRX=_?uTcBnnP&Yyj78F)siB literal 0 HcmV?d00001 diff --git a/tests/qemu-iotests/076 b/tests/qemu-iotests/076 index 8474fdd..fb2b41d 100755 --- a/tests/qemu-iotests/076 +++ b/tests/qemu-iotests/076 @@ -81,6 +81,12 @@ _use_sample_img parallels-v2.bz2 _use_sample_img parallels-simple.xml.bz2 { $QEMU_IO -c "read -P 0x11 0 64k" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir +echo +echo "== Read from a valid v2 image opened through xml with padding ==" +_use_sample_img parallels-v2-padded.bz2 +_use_sample_img parallels-padded.xml.bz2 +{ $QEMU_IO -c "read -P 0x11 0 64k" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/076.out b/tests/qemu-iotests/076.out index 628d9bf..46680d8 100644 --- a/tests/qemu-iotests/076.out +++ b/tests/qemu-iotests/076.out @@ -23,4 +23,8 @@ read 65536/65536 bytes at offset 0 == Read from a valid v2 image opened through xml == read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +== Read from a valid v2 image opened through xml with padding == +read 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) *** done