]> git.proxmox.com Git - mirror_qemu.git/commit
raw_bsd: don't check size alignment when only offset is set
authorTomáš Golembiovský <tgolembi@redhat.com>
Thu, 3 Nov 2016 13:47:49 +0000 (14:47 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Nov 2016 14:54:55 +0000 (15:54 +0100)
commit80a15e3e2eed96926d886693663503985c9a98bb
treea25918664fdefea27c1c7062ca3af04a1ecc9321
parent40332872fec584d2557ed2c3f48d55d15d95eddb
raw_bsd: don't check size alignment when only offset is set

We make sure that the size is aligned to sector length to prevent any
round ups. Otherwise we could end up reading/writing data outside the
area specified by user. This is only needed when user supplies the size
option to avoid any surprises. It is not necessary when only offset is
set.

More over, the check made it difficult to use the offset option without
size option. The check puts unneeded restriction on the offset which had
to be aligned too. Because bdrv_getlength() returns aligned value having
unaligned offset would make the check fail.

Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/raw_bsd.c