qemu-e2k/block
Peter Lieven 690cbb095a block/vpc: make calculate_geometry spec conform
The VHD spec [1] allows for total_sectors of 65535 x 16 x 255 (~127GB)
represented by a CHS geometry. If total_sectors is greater
than 65535 x 16 x 255 this geometry is set as a maximum.

Qemu, Hyper-V and disk2vhd use this special geometry as an indicator
to use the image current size from the footer as disk size.

This patch changes vpc_create to effectively calculate a CxHxS geometry
for the given image size if possible while rounding up if necessary.
If the image size is too big to be represented in CHS we set the maximum
and write the exact requested image size into the footer.

This partly reverts commit 258d2edb, but leaves support for >127G disks
intact.

[1] http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-442c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc

Signed-off-by: Peter Lieven <pl@kamp.de>
Message-id: 1425379316-19639-4-git-send-email-pl@kamp.de
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-03-16 12:10:30 -04:00
..
accounting.c block: add accounting for merged requests 2015-02-06 17:24:21 +01:00
archipelago.c block: remove superfluous '\n' around error_report/error_setg 2015-03-10 08:15:33 +03:00
backup.c qmp: Add command 'blockdev-backup' 2015-01-13 11:47:56 +00:00
blkdebug.c blkdebug: fix "once" rule 2015-03-10 14:02:21 +01:00
blkverify.c
block-backend.c block-backend: Add wrappers for blocksizes and geometry probing 2015-03-10 14:02:22 +01:00
bochs.c
cloop.c
commit.c block: let commit blockjob run in BDS AioContext 2014-11-03 11:41:49 +00:00
curl.c block/curl: Improve type safety of s->timeout. 2014-11-03 11:41:47 +00:00
dmg.c block/dmg: improve zeroes handling 2015-02-06 17:24:21 +01:00
gluster.c
iscsi.c iscsi: Fix check for username 2015-03-10 10:49:25 +01:00
linux-aio.c linux-aio: simplify removal of completed iocbs from the list 2014-12-12 16:57:55 +00:00
Makefile.objs block/dmg: support bzip2 block entry types 2015-02-06 17:24:21 +01:00
mirror.c block: mirror - change string allocation to 2-bytes 2015-01-23 18:17:06 +01:00
nbd-client.c nbd: fix the co_queue multi-adding bug 2015-02-16 15:07:17 +00:00
nbd-client.h nbd: Drop BDS backpointer 2015-02-16 14:36:03 +00:00
nbd.c nbd: fix resource leak 2015-03-10 08:15:34 +03:00
nfs.c block/nfs: Add create_opts 2014-12-10 10:31:19 +01:00
null.c
parallels.c block/parallels: fix access to not initialized memory in catalog_bitmap 2014-11-03 09:48:41 +00:00
qapi.c block: add event when disk usage exceeds threshold 2015-02-06 17:24:21 +01:00
qcow2-cache.c block: Give always priority to unused entries in the qcow2 L2 cache 2015-02-06 17:24:22 +01:00
qcow2-cluster.c qcow2: Use 64 bits for refcount values 2015-03-10 14:02:21 +01:00
qcow2-refcount.c qcow2: Respect new_block in alloc_refcount_block() 2015-03-16 12:10:30 -04:00
qcow2-snapshot.c qcow2: fix the macro QCOW_MAX_L1_SIZE's use 2015-03-12 17:41:23 +00:00
qcow2.c qcow2: fix the macro QCOW_MAX_L1_SIZE's use 2015-03-12 17:41:23 +00:00
qcow2.h qcow2: Helper function for refcount modification 2015-03-10 14:02:21 +01:00
qcow.c block: fix off-by-one error in qcow and qcow2 2015-02-06 17:24:21 +01:00
qed-check.c
qed-cluster.c
qed-gencb.c
qed-l2-cache.c
qed-table.c
qed.c qed: check for header size overflow 2015-02-06 17:24:21 +01:00
qed.h qed: Really remove unused field QEDAIOCB.finished 2015-02-06 17:24:21 +01:00
quorum.c
raw_bsd.c block: Add driver methods to probe blocksizes and geometry 2015-03-10 14:02:22 +01:00
raw-aio.h linux-aio: drop return code from laio_io_unplug and ioq_submit 2014-12-12 16:57:55 +00:00
raw-posix.c block/raw-posix: fix launching with failed disks 2015-03-10 14:02:24 +01:00
raw-win32.c block: Remove "growable" from BDS 2015-02-16 15:07:19 +00:00
rbd.c block/rbd: fix memory leak 2014-12-12 13:16:56 +00:00
sheepdog.c sheepdog: Fix misleading error messages in sd_snapshot_create() 2015-03-10 14:02:24 +01:00
snapshot.c snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem 2014-11-03 09:48:42 +00:00
ssh.c
stream.c block: let stream blockjob run in BDS AioContext 2014-11-03 11:41:49 +00:00
vdi.c block/vdi: Add locking for parallel requests 2015-03-10 14:02:24 +01:00
vhdx-endian.c
vhdx-log.c
vhdx.c block: vhdx - force FileOffsetMB field to '0' for certain block states 2015-01-23 12:41:32 -05:00
vhdx.h block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec 2014-12-12 15:42:22 +00:00
vmdk.c block: vmdk - fixed sizeof() error 2015-02-16 15:07:17 +00:00
vpc.c block/vpc: make calculate_geometry spec conform 2015-03-16 12:10:30 -04:00
vvfat.c QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use 2015-02-26 14:49:31 +01:00
win32-aio.c
write-threshold.c block: Fix block-set-write-threshold not to use funky error class 2015-03-16 17:07:25 +01:00