Bug 1540022
Summary: | Fail to dump vol xml of json backing images | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Han Han <hhan> | ||||
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | ||||
Status: | CLOSED ERRATA | QA Contact: | Han Han <hhan> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 7.5 | CC: | dyuan, jiyan, lmen, lmiksik, mtessun, pkrempa, rbalakri, xuzhang, yisun | ||||
Target Milestone: | rc | Keywords: | Regression | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | libvirt-3.9.0-10.el7 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 1540136 (view as bug list) | Environment: | |||||
Last Closed: | 2018-04-10 11:04:21 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: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1539427, 1540136, 1664924 | ||||||
Attachments: |
|
Description
Han Han
2018-01-30 05:59:56 UTC
It works on libvirt-3.2.0-14.el7_4.9.x86_64 qemu-kvm-rhev-2.9.0-16.el7_4.14.x86_64: # qemu-img info /var/lib/libvirt/images/http.img image: /var/lib/libvirt/images/http.img file format: qcow2 virtual size: 761M (797966336 bytes) disk size: 196K cluster_size: 65536 backing file: json:{"file.driver":"http","file.url":"http://ftp.sjtu.edu.cn/ubuntu-cd/12.04/ubuntu-12.04.5-alternate-amd64.iso"} backing file format: raw Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false # virsh vol-dumpxml --pool default http.img <volume type='file'> <name>http.img</name> <key>/var/lib/libvirt/images/http.img</key> <source> </source> <capacity unit='bytes'>797966336</capacity> <allocation unit='bytes'>200704</allocation> <physical unit='bytes'>196624</physical> <target> <path>/var/lib/libvirt/images/http.img</path> <format type='qcow2'/> <permissions> <mode>0644</mode> <owner>0</owner> <group>0</group> <label>unconfined_u:object_r:virt_image_t:s0</label> </permissions> <timestamps> <atime>1517293323.129138576</atime> <mtime>1517293310.520066855</mtime> <ctime>1517293310.520066855</ctime> </timestamps> <compat>1.1</compat> <features/> </target> <backingStore> <path>json:{"file.driver":"http","file.url":"http://ftp.sjtu.edu.cn/ubuntu-cd/12.04/ubuntu-12.04.5-alternate-amd64.iso"}</path> <format type='raw'/> </backingStore> </volume> (In reply to Han Han from comment #2) [...] > <backingStore> > > <path>json:{"file.driver":"http","file.url": > "http://ftp.sjtu.edu.cn/ubuntu-cd/12.04/ubuntu-12.04.5-alternate-amd64. > iso"}</path> This is still wrong. I cloned this bug as https://bugzilla.redhat.com/show_bug.cgi?id=1540136 to track that part. Failure to print the XML when the backing volume is described by JSON string or inacessible was fixed upstream: commit b2c5f28a72465bf047311828c8c66112c8ca84e5 Author: Peter Krempa <pkrempa> Date: Tue Jan 30 11:41:59 2018 +0100 storage: util: Properly ignore errors when backing volume is inaccessible Commit 000e9504559 tried to fix improper bracketing when refreshing disk volume stats for a backing volume. Unfortunately the condition is still wrong as in cases as the backing store being inaccessible storageBackendUpdateVolTargetInfo returns -2 if instructed to ignore errors. The condition does not take this into account. Dumping XML of a volume which has inacessible backing store would then result into: # virsh vol-dumpxml http.img --pool default error: An error occurred, but the cause is unknown Properly ignore -2 for backing volumes. Verified on libvirt-3.9.0-10.el7.x86_64 qemu-kvm-rhev-2.10.0-18.el7.x86_64: SC1: Verified on raw backed image 1. Create a json backing image with http backend and refresh the pool # qemu-img create -f qcow2 -b 'json:{"file.driver":"http","file.url":"http://ftp.sjtu.edu.cn/ubuntu-cd/12.04/ubuntu-12.04.5-alternate-amd64.iso"}' /var/lib/libvirt/images/http.img -o backing_fmt=raw Formatting '/var/lib/libvirt/images/http.img', fmt=qcow2 size=797966336 backing_file=json:{"file.driver":"http",,"file.url":"http://ftp.sjtu.edu.cn/ubuntu-cd/12.04/ubuntu-12.04.5-alternate-amd64.iso"} backing_fmt=raw cluster_size=65536 lazy_refcounts=off refcount_bits=16 # virsh pool-refresh default Pool default refreshed 2. Dump the volume xml of backing image: # virsh vol-dumpxml --pool default http.img <volume type='file'> <name>http.img</name> <key>/var/lib/libvirt/images/http.img</key> <source> </source> <capacity unit='bytes'>797966336</capacity> <allocation unit='bytes'>200704</allocation> <physical unit='bytes'>196624</physical> <target> <path>/var/lib/libvirt/images/http.img</path> <format type='qcow2'/> <permissions> <mode>0644</mode> <owner>0</owner> <group>0</group> <label>unconfined_u:object_r:virt_image_t:s0</label> </permissions> <timestamps> <atime>1517465148.440388257</atime> <mtime>1517465148.440388257</mtime> <ctime>1517465148.440388257</ctime> </timestamps> <compat>1.1</compat> <features/> </target> <backingStore> <path>json:{"file.driver":"http","file.url":"http://ftp.sjtu.edu.cn/ubuntu-cd/12.04/ubuntu-12.04.5-alternate-amd64.iso"}</path> <format type='raw'/> </backingStore> </volume> SC2: Verified on raw backed image 1. Create a json backing image with http backend and refresh the pool # qemu-img create -f qcow2 -b 'json:{"file.driver":"http","file.url":"http://xx.xx.xx.xx/libvirt-CI-resources/RHEL-7.5-x86_64-latest.qcow2"}' /var/lib/libvirt/images/http_qcow2.img -o backing_fmt=qcow2 Formatting '/var/lib/libvirt/images/http_qcow2.img', fmt=qcow2 size=10737418240 backing_file=json:{"file.driver":"http",,"file.url":"http://xx.xx.xx.xx/libvirt-CI-resources/RHEL-7.5-x86_64-latest.qcow2"} backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 # virsh pool-refresh default Pool default refreshed 2. Dump the volume xml of backing image: # virsh vol-dumpxml --pool default http_qcow2.img <volume type='file'> <name>http_qcow2.img</name> <key>/var/lib/libvirt/images/http_qcow2.img</key> <source> </source> <capacity unit='bytes'>10737418240</capacity> <allocation unit='bytes'>200704</allocation> <physical unit='bytes'>196768</physical> <target> <path>/var/lib/libvirt/images/http_qcow2.img</path> <format type='qcow2'/> <permissions> <mode>0644</mode> <owner>0</owner> <group>0</group> <label>unconfined_u:object_r:virt_image_t:s0</label> </permissions> <timestamps> <atime>1517465440.967904362</atime> <mtime>1517465297.359669149</mtime> <ctime>1517465297.359669149</ctime> </timestamps> <compat>1.1</compat> <features/> </target> <backingStore> <path>json:{"file.driver":"http","file.url":"http://xx.xx.xx.xx/libvirt-CI-resources/RHEL-7.5-x86_64-latest.qcow2"}</path> <format type='raw'/> </backingStore> </volume> Though the backingStore foramt is not correct, the issue will be tracked on BZ1540136 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/RHEA-2018:0704 |