Bug 1619625 - 'virsh domblkinfo --all' interrupted by empty cdrom device
Summary: 'virsh domblkinfo --all' interrupted by empty cdrom device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Pavel Mores
QA Contact: Han Han
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-21 10:50 UTC by yafu
Modified: 2020-05-05 09:44 UTC (History)
9 users (show)

Fixed In Version: libvirt-5.9.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:43:16 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2017 None None None 2020-05-05 09:44:40 UTC

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):
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:

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

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

v5.8.0-32-g5be0d28b3e

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"/>
      <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

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.

https://access.redhat.com/errata/RHBA-2020:2017


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