Description of problem:
qemu returns numerous read errors when run with a file-backed disk which is stored on a disk with 4k physical sectors. The underlying cause of these read errors is pread() returning EINVAL in handle_aiocb_rw_linear(). Configuring the appliance to not use cache=off makes the problem go away.
By default, qemu seems to be aligning reads to 512 bytes. This fails for a file opened with O_DIRECT when the sector size is 4096 bytes. Disks with 4k sectors are only just starting to come to the market.
# fdisk -l /dev/vg_dellper30001/lv_home
Note: sector size is 4096 (not 512)
Disk /dev/vg_dellper30001/lv_home: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 81 cylinders, total 1310720 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Version-Release number of selected component (if applicable):
qemu-system-x86-0.14.0-8.fc15.x86_64
How reproducible:
100%
Steps to Reproduce:
I hit the problem with libguestfs. If you have a libguestfs source tree, and a physical disk with 4k sectors, after configure and make, run:
make -C images check
Actual results:
This will fail almost immediately in pvcreate.
Expected results:
qemu should check the sector size with the appropriate ioctl rather than using a hard-coded value of 512 bytes. It should Just Work(TM).
Comment 1Fedora Admin XMLRPC Client
2012-03-15 17:54:20 UTC
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Hmm, according to bug 608548, upstream has fixes and they should be in F15's qemu version. Maybe there was a missing piece?
Either way F15 is end of life pretty soon, so closing. mbooth, if this is still an issue in newer fedora, please reopen and we can go from there.