Bug 1619625

Summary: 'virsh domblkinfo --all' interrupted by empty cdrom device
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: yafu <yafu>
Component: libvirtAssignee: Pavel Mores <pmores>
Status: CLOSED ERRATA QA Contact: Han Han <hhan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: dyuan, hhan, jdenemar, jsuchane, lmen, pkrempa, rbalakri, tburke, xuzhang
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: libvirt-5.9.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-05 09:43:16 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:

Description yafu 2018-08-21 10:50:36 UTC
Description of problem:
'virsh domjobinfo --all' interrupted by empty cdrom device

Version-Release number of selected component (if applicable):

How reproducible:

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 type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='sdb' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    <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'/>

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:

Comment 4 Pavel Mores 2019-10-16 12:25:46 UTC
Fixed by

5be0d28b3e fixed handling of sourceless disks in 'domblkinfo' cmd


Comment 6 Han Han 2020-01-20 06:19:13 UTC
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"/>
      <target dev="sda" bus="scsi"/>
      <encryption format="luks">
        <secret type="passphrase" usage="/var/lib/libvirt/images/luks-dest"/>
      <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"/>
      <target dev="sdb" bus="scsi"/>
      <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"/>
      <target dev="sdc" bus="scsi"/>
      <alias name="scsi0-0-0-2"/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>

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

Comment 8 Han Han 2020-04-30 02:45:53 UTC
virsh only. I will not cover the test

Comment 9 errata-xmlrpc 2020-05-05 09:43:16 UTC
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.