Bug 748902 - qemu fails on disk with 4k sectors and cache=off
Summary: qemu fails on disk with 4k sectors and cache=off
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 748906 749122
TreeView+ depends on / blocked
 
Reported: 2011-10-25 14:29 UTC by Matthew Booth
Modified: 2015-02-28 03:14 UTC (History)
14 users (show)

Fixed In Version:
Clone Of:
: 748906 (view as bug list)
Environment:
Last Closed: 2012-05-29 00:32:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Matthew Booth 2011-10-25 14:29:08 UTC
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 1 Fedora 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.

Comment 2 Cole Robinson 2012-05-29 00:32:29 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.