Bug 1662928 - disk format is not set automatically for disk type='volume'
Summary: disk format is not set automatically for disk type='volume'
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 31
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-02 12:49 UTC by Katerina Koukiou
Modified: 2020-11-24 17:36 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-24 17:36:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1328003 0 unspecified CLOSED disk source format is not properly set for disk type='volume' 2021-02-22 00:41:40 UTC

Description Katerina Koukiou 2019-01-02 12:49:27 UTC
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


How reproducible:
Always

Steps to Reproduce:
1. Create volume of type file and qcow2 format with the following XML.
 
$ cat volume.xml
<volume type='file'>
  <name>test01</name>
  <target>
    <path>/var/lib/libvirt/images/test01</path>
    <format type='qcow2'/>
</volume>

2. Create disk of type volume without driver type information with the following XML.
$ cat disk.xml
<disk type='volume' device='disk'>
  <driver name='qemu'/>
  <source pool='boot' volume='test01'/>
  <target dev='vdb' bus='virtio'/>
  <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
</disk>

3. Attach disk device to a domain

virsh # attach-device fedora29 disk.xml --config
Device attached successfully

Actual results:

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 -
function="0x0"/>
    <disk type="volume" device="disk">
      <driver name="qemu" type="raw"/>
      <source pool="boot" volume="test01"/>
      <backingStore/>
      <target dev="vdb" bus="virtio"/>
      <alias name="virtio-disk1"/>
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
    </disk>

Expected results:

The disk should inherit the format type from the volume automatically.

Comment 1 Peter Krempa 2019-01-08 16:58:23 UTC
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.

Comment 2 Ben Cotton 2019-10-31 20:12:31 UTC
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.

Comment 3 Peter Krempa 2019-11-01 09:57:00 UTC
We didn't do anythign to address this yet so I'll bump it to newer release.

Comment 4 Ben Cotton 2020-11-03 17:12:02 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
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 '31'.

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 31 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.

Comment 5 Ben Cotton 2020-11-24 17:36:51 UTC
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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