qemu/block
Kevin Wolf b8684454e1 raw-posix: Fix .bdrv_co_get_block_status() for unaligned image size
Image files with an unaligned image size have a final hole that starts
at EOF, i.e. in the middle of a sector. Currently, *pnum == 0 is
returned when checking the status of this sector. In qemu-img, this
triggers an assertion failure.

In order to fix this, one type for the sector that contains EOF must be
found. Treating a hole as data is safe, so this patch rounds the
calculated number of data sectors up, so that a partial sector at EOF is
treated as a full data sector.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1229394

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Cole Robinson <crobinso@redhat.com>
2015-06-12 15:54:01 +02:00
..
accounting.c
archipelago.c
backup.c
blkdebug.c
blkverify.c
block-backend.c
bochs.c
cloop.c
commit.c
curl.c
dmg.c
gluster.c
io.c
iscsi.c
linux-aio.c
Makefile.objs
mirror.c
nbd-client.c
nbd-client.h
nbd.c
nfs.c
null.c
parallels.c
qapi.c
qcow2-cache.c
qcow2-cluster.c
qcow2-refcount.c
qcow2-snapshot.c
qcow2.c
qcow2.h
qcow.c
qed-check.c
qed-cluster.c
qed-gencb.c
qed-l2-cache.c
qed-table.c
qed.c
qed.h
quorum.c
raw_bsd.c
raw-aio.h
raw-posix.c raw-posix: Fix .bdrv_co_get_block_status() for unaligned image size 2015-06-12 15:54:01 +02:00
raw-win32.c
rbd.c
sheepdog.c
snapshot.c
ssh.c
stream.c
vdi.c
vhdx-endian.c
vhdx-log.c
vhdx.c
vhdx.h
vmdk.c
vpc.c
vvfat.c
win32-aio.c
write-threshold.c