Bug 658753

Summary: wrong file format when " qemu-img info " on lvm
Product: Red Hat Enterprise Linux 5 Reporter: slei
Component: kvmAssignee: Kevin Wolf <kwolf>
Status: CLOSED NEXTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.6CC: mkenneth, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-02 10:23:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580946    

Description slei 2010-12-01 07:19:03 UTC
Description of problem:
when i check the qcow2 file with following command:
#qemu-img check /dev/vg/lv 
qemu-img: This image format does not support checks

then i add " -f qcow2 " to the above command :
#qemu-img check -f qcow2 /dev/vg/lv
No errors were found on the image.

In order to know the reason ,i use the following command to check the file format of the "/dev/vg/lv":
#qemu-img info /dev/vg/lv
image: /dev/vg/lv
file format: host_device
virtual size: 10G (10737418240 bytes)
disk size: 0




Version-Release number of selected component (if applicable):
kernel version:
2.6.18-234.el5
kvm version:
kvm-83-219.el5


How reproducible:
1,create the lvm:
#qemu-img create -f raw 0.raw 10G && qemu-img create -f raw 1.raw 10G && losetup /dev/loop0 0.raw && losetup /dev/loop1 1.raw && pvcreate /dev/loop0 /dev/loop1 && vgcreate vg /dev/loop0 /dev/loop1 && lvcreate -L10G -n lv vg
Formatting '0.raw', fmt=raw, size=10485760 kB
Formatting '1.raw', fmt=raw, size=10485760 kB
  Physical volume "/dev/loop0" successfully created
  Physical volume "/dev/loop1" successfully created
  Volume group "vg" successfully created
  Logical volume "lv" created

2, create qcow2 image:
#qemu-img create -f qcow2 /dev/vg/lv 6G
Formatting '/dev/vg/lv', fmt=qcow2, size=10485760 kB

3, check /dev/vg/lv:
#qemu-img check  /dev/vg/lv
qemu-img: This image format does not support checks

4, check /dev/vg/lv with "-f qcow2":
#qemu-img check -f qcow2 /dev/vg/lv
No errors were found on the image.

5, check the file format :
#qemu-img info /dev/vg/lv
image: /dev/vg/lv
file format: host_device
virtual size: 10G (10737418240 bytes)
disk size: 0

Actual results:


Expected results:
3, check /dev/vg/lv:
#qemu-img check  /dev/vg/lv
No errors were found on the image.

5, check the file format :
#qemu-img info /dev/vg/lv
...
file format: qcow2
...


Additional info:

Comment 1 Kevin Wolf 2010-12-02 10:23:22 UTC
This is a known problem, but not fixable with reasonable effort in RHEL 5.

RHEL 6 does the expected thing here.