]> git.proxmox.com Git - mirror_qemu.git/commit - block/vpc.c
block: round up file size to nearest sector
authorHu Tao <hutao@cn.fujitsu.com>
Wed, 10 Sep 2014 09:05:45 +0000 (17:05 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 12 Sep 2014 13:43:06 +0000 (15:43 +0200)
commitc2eb918e3299f930fd0d0ae48d002cf2599de250
treedd8c566df51931eb5853c1e578d4ee28fa3df958
parentbe2bfb9dbde59de27684623b9d8261262c5ad076
block: round up file size to nearest sector

Currently the file size requested by user is rounded down to nearest
sector, causing the actual file size could be a bit less than the size
user requested. Since some formats (like qcow2) record virtual disk
size in bytes, this can make the last few bytes cannot be accessed.

This patch fixes it by rounding up file size to nearest sector so that
the actual file size is no less than the requested file size.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 files changed:
block/archipelago.c
block/cow.c
block/gluster.c
block/iscsi.c
block/nfs.c
block/qcow.c
block/qcow2.c
block/qed.c
block/raw-posix.c
block/raw-win32.c
block/rbd.c
block/sheepdog.c
block/ssh.c
block/vdi.c
block/vhdx.c
block/vmdk.c
block/vpc.c
tests/qemu-iotests/104 [new file with mode: 0755]
tests/qemu-iotests/104.out [new file with mode: 0644]
tests/qemu-iotests/common.filter
tests/qemu-iotests/group