Bug 911990
Summary: | RFE: Support 4k sector size with qcow2 | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Xu Tian <xutian> | ||||
Component: | qemu-kvm | Assignee: | Kevin Wolf <kwolf> | ||||
Status: | CLOSED DUPLICATE | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 7.0 | CC: | acathrow, areis, bili, crobinso, hhuang, huding, juzhang, kwolf, lsu, qiguo, qzhang, shyu, sluo, virt-maint, xfu, xwei, yinyin2010 | ||||
Target Milestone: | rc | Keywords: | FutureFeature | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Enhancement | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2014-01-22 11:06:50 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Xu Tian
2013-02-17 05:21:35 UTC
FYI I tried this issue by using qemu-kvm-1.3.0-5.el7.x86_64. Do not hit this issue. The guest be booted with cache=none. #/usr/libexec/qemu-kvm -M pc-1.3 -cpu SandyBridge -enable-kvm -m 2048 -smp 2,sockets=1,cores=2,threads=1 -name rhel7 -uuid 6afa5f93-2d4f-420f-81c6-e5fdddbd1c83 -drive file=/home/a.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,serial=40c061dd-5d60-4fc5-865f-55db700407f0,cache=none,werror=stop,rerror=stop,aio=threads -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -vnc :1 -monitor stdio Verified that problem did NOT exist in prior RHEL7 nightly builds (before 1/15/2013). Email thread already started with Kevin, so assigning this BZ to Kevin for now. Please re-assign as appropriate. Your image is /tmp/test1.img. What kind of file system is /tmp on? If it's tmpfs, this doesn't support O_DIRECT, so the error would be expected. (In reply to comment #6) > Your image is /tmp/test1.img. What kind of file system is /tmp on? If it's > tmpfs, this doesn't support O_DIRECT, so the error would be expected. hi Kevin, create image file via "qemu-img create -f qcow2 /root/test.img 1G" and try to start up guest with cache=none still failed; file system on /root is xfs: /dev/mapper/rhel-root / xfs rw,relatime,attr2,inode64,noquota 0 0 try "dd if=/dev/zero of=/root/test2.img oflag=direct bs=1 count=1" it failed too, it looks root cause is fail to open image file with "O_DIRECT" on xfs file system; thanks, Xu Since this defeat caused by fail to open file with O_DIRECT in XFS file-system, so move it file-system component and update bug title; Thanks, Xu (In reply to comment #7) > (In reply to comment #6) > > Your image is /tmp/test1.img. What kind of file system is /tmp on? If it's > > tmpfs, this doesn't support O_DIRECT, so the error would be expected. > > hi Kevin, > > create image file via "qemu-img create -f qcow2 /root/test.img 1G" and try > to start up guest with cache=none still failed; file system on /root is xfs: > > /dev/mapper/rhel-root / xfs rw,relatime,attr2,inode64,noquota 0 0 > > try "dd if=/dev/zero of=/root/test2.img oflag=direct bs=1 count=1" it failed > too, it looks root cause is fail to open image file with "O_DIRECT" on xfs > file system; > > > thanks, > Xu sorry to used incorrect command in above comments, please ignore it; used a incorrect dd command:"dd if=/dev/zero of=/root/test2.img oflag=direct bs=1 count=1", invalid value of bs; try with "dd if=/dev/zero of=/root/test2.img oflag=direct bs=1M count=1" dd works well; thanks, Xu test below case: 1: create qcow2 image via qemu-img: result: guest not start up [root@localhost ~]# qemu-img create -f qcow2 /root/test-qcow2.img 1G Formatting '/root/test-qcow2.img', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off [root@localhost ~]# qemu-img info /root/test-qcow2.img image: /root/test-qcow2.img file format: qcow2 virtual size: 1.0G (1073741824 bytes) disk size: 196K cluster_size: 65536 [root@localhost ~]# qemu-kvm -drive file=/root/test-qcow2.img,if=none,cache=none,media=disk,format=qcow2 -vnc :0 qemu-kvm: -drive file=/root/test-qcow2.img,if=none,cache=none,media=disk,format=qcow2: could not open disk image /root/test-qcow2.img: Invalid argument 2: create raw image with "qemu-img" result: guest start up [root@localhost ~]# qemu-img create -f raw test-raw.img 1G Formatting 'test-raw.img', fmt=raw size=1073741824 [root@localhost ~]# qemu-kvm -drive file=/root/test-raw.img,if=none,cache=none,media=disk,format=raw -vnc :0 3. create raw image with "dd" result: guest start up [root@localhost ~]# dd if=/dev/zero of=/root/test-dd.img bs=1M count=1024 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 0.345461 s, 3.1 GB/s [root@localhost ~]# qemu-kvm -drive file=/root/test-dd.img,if=none,cache=none,media=disk,format=raw -vnc :0(In reply to comment #8) > Since this defeat caused by fail to open file with O_DIRECT in XFS > file-system, so move it file-system component and update bug title; > > Thanks, > Xu test below case: 1: create qcow2 image via qemu-img: result: guest not start up [root@localhost ~]# qemu-img create -f qcow2 test-qcow2.img 1G Formatting 'test-qcow2.img', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off [root@localhost ~]# strace -o /tmp/strace.log qemu-kvm -drive file=/root/test-qcow2.img,if=none,cache=none,media=disk,format=qcow2 -vnc :0 qemu-kvm: -drive file=/root/test-qcow2.img,if=none,cache=none,media=disk,format=qcow2: could not open disk image /root/test-qcow2.img: Invalid argument [root@localhost ~]# qemu-img info /root/test-qcow2.img image: /root/test-qcow2.img file format: qcow2 virtual size: 1.0G (1073741824 bytes) disk size: 196K cluster_size: 65536 [root@localhost ~]# 2: create raw image with "qemu-img" result: guest start up [root@localhost ~]# qemu-img create -f raw test-raw.img 1G Formatting 'test-raw.img', fmt=raw size=1073741824 [root@localhost ~]# qemu-kvm -drive file=/root/test-raw.img,if=none,cache=none,media=disk,format=raw -vnc :0 3. create raw image with "dd" result: guest start up [root@localhost ~]# dd if=/dev/zero of=/root/test-dd.img bs=1M count=1024 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 0.345461 s, 3.1 GB/s [root@localhost ~]# qemu-kvm -drive file=/root/test-dd.img,if=none,cache=none,media=disk,format=raw -vnc :0 Base on above test result, move back this bug to qemu-kvm component; Created attachment 700331 [details]
strace output
Hi Kevin, qemu-img version is "qemu-img-1.3.0-5.el7.x86_64", and I have post strace output; do you have suggestion? Anything need me to try, please ping me when free. thanks, Xu Please use -f with strace, the main thread of qemu doesn't do anything interesting. Does dd oflag=direct work with a block size of 512? (In reply to comment #13) > Please use -f with strace, the main thread of qemu doesn't do anything > interesting. > > Does dd oflag=direct work with a block size of 512? Hi Kevin, "dd if=/dev/zero of=/root/test.img oflag=direct bs=512b" works fine, but bs=1k not work, see details below: [root@localhost ~]# dd if=/dev/zero of=/root/test.img oflag=direct bs=512b count=100 100+0 records in 100+0 records out 26214400 bytes (26 MB) copied, 0.361657 s, 72.5 MB/s [root@localhost ~]# dd if=/dev/zero of=/root/test.img oflag=direct bs=1k count=100 dd: writing ‘/root/test.img’: Invalid argument 1+0 records in 0+0 records out 0 bytes (0 B) copied, 0.000215752 s, 0.0 kB/s [root@localhost ~]# dd if=/dev/zero of=/root/test.img oflag=direct bs=4k count=1024 1024+0 records in 1024+0 records out 4194304 bytes (4.2 MB) copied, 0.277361 s, 15.1 MB/s [root@localhost ~]# dd if=/dev/zero of=/root/test.img oflag=direct bs=4k count=10240 10240+0 records in 10240+0 records out 41943040 bytes (42 MB) copied, 1.22037 s, 34.4 MB/s [root@localhost ~]# uname -a Linux localhost.localdomain 3.7.0-0.34.el7.x86_64 #1 SMP Thu Jan 31 13:59:22 EST 2013 x86_64 x86_64 x86_64 GNU/Linux thanks, Xu Re-test this defeat with below scenerios: boot guest with 4k virtual block size + raw image: guest start up [root@localhost ~]# /usr/libexec/qemu-kvm -drive file=/root/test.raw,if=none,cache=none,format=raw,media=disk,id=drive-virtio-disk1 -device virtio-blk-pci,drive=drive-virtio-disk1,id=virtio-disk1,physical_block_size=4096 -smp 1 -m 512 -vnc :0 boot guest boot guest with 4k virtual block size + qcow2 image: fail to start up guest [root@localhost ~]# /usr/libexec/qemu-kvm -drive file=/root/test.qcow2,if=none,cache=none,format=qcow2,media=disk,id=drive-virtio-disk1 -device virtio-blk-pci,drive=drive-virtio-disk1,id=virtio-disk1,physical_block_size=4096 -smp 1 -m 512 -vnc :0 qemu-kvm: -drive file=/root/test.qcow2,if=none,cache=none,format=qcow2,media=disk,id=drive-virtio-disk1: could not open disk image /root/test.qcow2: Invalid argument Thanks for Kevin Wolf help on re-test this defeat; Xu (In reply to comment #15) > Re-test this defeat with below scenerios: > > boot guest with 4k virtual block size + raw image: > > guest start up > > [root@localhost ~]# /usr/libexec/qemu-kvm -drive > file=/root/test.raw,if=none,cache=none,format=raw,media=disk,id=drive-virtio- > disk1 -device > virtio-blk-pci,drive=drive-virtio-disk1,id=virtio-disk1, > physical_block_size=4096 -smp 1 -m 512 -vnc :0 > > boot guest boot guest with 4k virtual block size + qcow2 image: > > fail to start up guest > > [root@localhost ~]# /usr/libexec/qemu-kvm -drive > file=/root/test.qcow2,if=none,cache=none,format=qcow2,media=disk,id=drive- > virtio-disk1 -device > virtio-blk-pci,drive=drive-virtio-disk1,id=virtio-disk1, > physical_block_size=4096 -smp 1 -m 512 -vnc :0 > qemu-kvm: -drive > file=/root/test.qcow2,if=none,cache=none,format=qcow2,media=disk,id=drive- > virtio-disk1: could not open disk image /root/test.qcow2: Invalid argument > > > Thanks for Kevin Wolf help on re-test this defeat; > > Xu My hard disk sector size: Sector size (logical/physical): 512 bytes / 4096 bytes *** Bug 1018028 has been marked as a duplicate of this bug. *** *** Bug 960803 has been marked as a duplicate of this bug. *** *** This bug has been marked as a duplicate of bug 748906 *** |