]> git.ipfire.org Git - thirdparty/qemu.git/commit - block.c
block: Round up total_sectors
authorFam Zheng <famz@redhat.com>
Wed, 6 Nov 2013 11:48:06 +0000 (19:48 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 8 Nov 2013 09:44:24 +0000 (10:44 +0100)
commit7e382003f1bd9d8a441ecc5ac8a74bad3564d943
treea2f2a09ee32f8e9be3073c6d3d17ba4932d5d63a
parente78835b722eb26f5a56370166e99b69e9751ea2a
block: Round up total_sectors

Since b94a2610, bdrv_getlength() is omitted when probing image. VMDK
monolithicFlat is broken by that because a file < 512 bytes can't be
read with its total_sectors truncated to 0. This patch round up the size
to BDRV_SECTOR_SIZE, when a image size is not sector aligned.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c