Bug 1596096

Summary: 'virsh vol-dumpxml' failed to get vol info for images created with host_cdrom json backing when the cdrom is empty
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: yafu <yafu>
Component: libvirtAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED WONTFIX QA Contact: Meina Li <meili>
Severity: low Docs Contact:
Priority: low    
Version: 8.0CC: dyuan, hhan, jsuchane, lmen, xuzhang, yisun
Target Milestone: rcKeywords: Triaged
Target Release: 8.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-15 07:39:50 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:
Embargoed:

Description yafu 2018-06-28 09:08:33 UTC
Description of problem:
'virsh vol-dumpxml' failed to get vol info for images created with host_cdrom json backing when the cdrom is empty

Version-Release number of selected component (if applicable):
libvirt-4.4.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Create backing file with host_cdrom json backing and the cdrom is empty:
# qemu-img create -f qcow2 -b 'json:{"file.driver":"host_cdrom", "file.filename":"/dev/sr0"}' /var/lib/libvirt/images/host_cdrom.img
Formatting '/var/lib/libvirt/images/host_cdrom.img', fmt=qcow2 size=1073741312 backing_file=json:{"file.driver":"host_cdrom",, "file.filename":"/dev/sr0"} cluster_size=65536 lazy_refcounts=off refcount_bits=16

2.Refresh the pool:
#virsh pool-refresh default
Pool default refreshed

3.Execute 'virsh vol-dumpxml':
#virsh vol-dumpxml host_cdrom.img default
error: cannot read header '/dev/sr0': Input/output error


Actual results:
'virsh vol-dumpxml' failed to get vol info for images created with host_cdrom json backing when the cdrom is empty.


Expected results:
'virsh vol-dumpxml' should work well for images created with host cdrom json backing

Additional info:
1.Can get images info successfully with 'qemu-img info'
# qemu-img info /var/lib/libvirt/images/host_cdrom.img
image: /var/lib/libvirt/images/host_cdrom.img
file format: qcow2
virtual size: 1.0G (1073741312 bytes)
disk size: 196K
cluster_size: 65536
backing file: json:{"file.driver":"host_cdrom", "file.filename":"/dev/sr0"}
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

Comment 2 Han Han 2018-07-11 03:16:29 UTC
Send a patch to upstream: https://www.redhat.com/archives/libvir-list/2018-July/msg00655.html

Comment 4 Jaroslav Suchanek 2019-04-24 12:40:33 UTC
This bug is going to be addressed in the next major release.

Comment 7 RHEL Program Management 2021-02-15 07:39:50 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.