Description of problem:
type='qcow2' is not added automatically when adding a disk of type volume, when the volume is qcow2 and is residing on pool of type 'dir'.
Version-Release number of selected component (if applicable):
libvirt.x86_64 4.10.0-2.fc29 @group_virtmaint-sig-virt-preview
qemu-kvm.x86_64 2:3.1.0-2.fc29 @group_virtmaint-sig-virt-preview
Steps to Reproduce:
1. Create volume of type file and qcow2 format with the following XML.
$ cat volume.xml
2. Create disk of type volume without driver type information with the following XML.
$ cat disk.xml
<disk type='volume' device='disk'>
<source pool='boot' volume='test01'/>
<target dev='vdb' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
3. Attach disk device to a domain
virsh # attach-device fedora29 disk.xml --config
Device attached successfully
Dumping the domain XML shows that the disk was given raw format, although the volume is of type qcow2.
$ virsh -c qemu:///system dumpxml fedora29 | xmllint --xpath /domain/devices/disk -
<disk type="volume" device="disk">
<driver name="qemu" type="raw"/>
<source pool="boot" volume="test01"/>
<target dev="vdb" bus="virtio"/>
<address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
The disk should inherit the format type from the volume automatically.
Note that due to the fact that the PoolRefresh method of a storage pool discards all volume metadata and reprobes the image formats from the disk, it would not be safe to switch the format according to the format of the volume.
If a raw disk is given to the VM the OS may write a QCOW2 header which would be detected and used as qcow2 next time the pool is refreshed.
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 29 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
We didn't do anythign to address this yet so I'll bump it to newer release.