]> git.proxmox.com Git - qemu.git/commit
block/vpc: Fix conversion from size to disk geometry
authorStefan Weil <weil@mail.berlios.de>
Mon, 10 May 2010 19:46:26 +0000 (21:46 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 14 Jul 2010 09:46:22 +0000 (11:46 +0200)
commit39187b5192bf16a6bbd3f272bef88f92e61b4c02
tree69f9a0830c1794f3ce150215d5ed1f03a48316ef
parent729862401ddbf2554807f085e234e26625ba542c
block/vpc: Fix conversion from size to disk geometry

The VHD algorithm calculates a disk geometry
which is usually smaller than the requested size.

QEMU tried to round up but failed for certain sizes:

qemu-img create -f vpc disk.vpc 9437184
would create an image with 9435136 bytes
(which is too small for qemu-img convert).

Instead of hacking the geometry algorithm, the patch
increases the number of sectors until we get enough
sectors.

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit dede4188cc817a039154ed2ecd7f3285f6b94056)
block/vpc.c