Description of problem: 'virsh domjobinfo --all' interrupted by empty cdrom device Version-Release number of selected component (if applicable): libvirt-4.5.0-7.el7.x86_64 qemu-kvm-rhev-2.12.0-11.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Prepare a guest with empty cdrom device: #virsh dumpxml iommu1 <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='writethrough'/> <source file='/nfs-images/yafu/76.qcow2'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='sdb' bus='scsi'/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/var/lib/libvirt/images/test.raw'/> <target dev='sdc' bus='virtio'/> <alias name='ua-04c8decd-4e33-4023-84de-a2205c777af6'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </disk> 2.Check the block list: #virsh domblklist iommu1 Target Source ------------------------------------------------ sda /nfs-images/yafu/76.qcow2 sdb - sdc /var/lib/libvirt/images/test.raw 3.Execute 'virsh domjobinfo --all": # virsh domblkinfo iommu1 --all Target Capacity Allocation Physical ----------------------------------------------------- sda 10737418240 15179927552 15150153728 error: invalid argument: disk 'sdb' does not currently have a source assigned Actual results: 'virsh domjobinfo --all' interrupted by empty cdrom device Expected results: 'virsh domjobinfo --all' should show all the block device info. Additional info:
Patch link: https://www.redhat.com/archives/libvir-list/2018-August/msg01300.html
Fixed by 5be0d28b3e fixed handling of sourceless disks in 'domblkinfo' cmd v5.8.0-32-g5be0d28b3e
Verified on libvirt-6.0.0-1.module+el8.2.0+5453+31b2b136.x86_64 qemu-kvm-4.2.0-6.module+el8.2.0+5453+31b2b136.x86_64: 1. Start a VM with following disks: # virsh dumpxml pc|xmllint --xpath //disk - <disk type="file" device="disk"> <driver name="qemu" type="raw"/> <source file="/var/lib/libvirt/images/luks-dest" index="3"/> <backingStore/> <target dev="sda" bus="scsi"/> <encryption format="luks"> <secret type="passphrase" usage="/var/lib/libvirt/images/luks-dest"/> </encryption> <alias name="scsi0-0-0-0"/> <address type="drive" controller="0" bus="0" target="0" unit="0"/> </disk><disk type="file" device="cdrom"> <driver name="qemu" type="raw"/> <source file="/var/lib/libvirt/images/boot.iso" index="2"/> <backingStore/> <target dev="sdb" bus="scsi"/> <readonly/> <alias name="scsi0-0-0-1"/> <address type="drive" controller="0" bus="0" target="0" unit="1"/> </disk><disk type="file" device="disk"> <driver name="qemu" type="raw"/> <source file="/tmp/sdc" index="1"/> <backingStore/> <target dev="sdc" bus="scsi"/> <alias name="scsi0-0-0-2"/> <address type="drive" controller="0" bus="0" target="0" unit="2"/> </disk> Check block info by domblkinfo --all # virsh domblkinfo --all pc Target Capacity Allocation Physical -------------------------------------------------- sda 10737418240 9099276288 10737684480 sdb 638582784 638582784 638582784 sdc 104857600 8192 104857600 Check cdrom block info only: # virsh domblkinfo pc sdb Capacity: 638582784 Allocation: 638582784 Physical: 638582784
virsh only. I will not cover the test
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2017