[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 17/37] block/vpc: fix virtual size for images crea
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 17/37] block/vpc: fix virtual size for images created with disk2vhd |
Date: |
Fri, 8 Nov 2013 11:12:11 +0100 |
From: Peter Lieven <address@hidden>
Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/vpc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block/vpc.c b/block/vpc.c
index 627d11c..577cc45 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -211,6 +211,15 @@ static int vpc_open(BlockDriverState *bs, QDict *options,
int flags,
bs->total_sectors = (int64_t)
be16_to_cpu(footer->cyls) * footer->heads * footer->secs_per_cyl;
+ /* images created with disk2vhd report a far higher virtual size
+ * than expected with the cyls * heads * sectors_per_cyl formula.
+ * use the footer->size instead if the image was created with
+ * disk2vhd.
+ */
+ if (!strncmp(footer->creator_app, "d2v", 4)) {
+ bs->total_sectors = be64_to_cpu(footer->size) / BDRV_SECTOR_SIZE;
+ }
+
/* Allow a maximum disk size of approximately 2 TB */
if (bs->total_sectors >= 65535LL * 255 * 255) {
ret = -EFBIG;
--
1.8.3.1
- [Qemu-devel] [PULL v2 00/37] Block patches, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 01/37] qapi: Fix comment for create-type to match code., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 04/37] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 05/37] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 06/37] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 09/37] block: qemu-iotests, add quotes to $TEST_IMG usage for 051, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 12/37] libqtest: rename qmp() to qmp_discard_response(), Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 13/37] libqtest: add qmp(fmt, ...) -> QDict* function, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 16/37] block: Save errno before error_setg_errno, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 14/37] blockdev-test: add test case for drive_add duplicate IDs, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 17/37] block/vpc: fix virtual size for images created with disk2vhd,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 18/37] block: vhdx - minor comments and typo correction., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 20/37] block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 24/37] block: vhdx code movement - move vhdx_close() above vhdx_open(), Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 25/37] block: vhdx - log parsing, replay, and flush support, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 27/37] block: vhdx - add log write support, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 02/37] qemu-iotests: Filter out actual image size in 067, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 29/37] block: vhdx - remove BAT file offset bit shifting, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 30/37] block: vhdx - move more endian translations to vhdx-endian.c, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 03/37] block/raw-posix: fix FreeBSD compilation, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 32/37] block: vhdx - fix comment typos in header, fix incorrect struct fields, Stefan Hajnoczi, 2013/11/08