RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1367260 - key mismatched in http protocol of json backing format
Summary: key mismatched in http protocol of json backing format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1134878
TreeView+ depends on / blocked
 
Reported: 2016-08-16 05:21 UTC by Han Han
Modified: 2016-11-03 18:53 UTC (History)
5 users (show)

Fixed In Version: libvirt-2.0.0-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:53:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Han Han 2016-08-16 05:21:01 UTC
Description of problem:
For the http protocol of image json backing format, qemu uses file.url while libvirt uses file.uri, which causes mismatch.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-2.6.0-20.el7.x86_64
libvirt-2.0.0-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
When using file.uri:
# qemu-img create -f qcow2 -b 'json:{"file.driver":"http", "file.uri":"http://10.66.6.236/tune.qcow2"}' /tmp/http.img
qemu-img: /tmp/http.img: curl block driver requires an 'url' option



When using file.url:
# qemu-img create -f qcow2 -b 'json:{"file.driver":"http", "file.url":"http://10.66.6.236/tune.qcow2"}' /tmp/http.img
Formatting '/tmp/http.img', fmt=qcow2 size=3221225472 backing_file=json:{"file.driver":"http",, "file.url":"http://10.66.6.236/tune.qcow2"} encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

Prepare a running VM V-rh6.

# virsh attach-disk V-rh6 /tmp/http.img vdb --subdriver qcow2        
error: Failed to attach disk
error: invalid argument: missing URI in JSON backing volume definition


Actual results:
As above

Expected results:
libvirt uses file.url as json key to match qemu.

Additional info:

Comment 2 Peter Krempa 2016-08-16 11:33:50 UTC
Fixed upstream:

commit c2e12b01baaf660abcf87f4a6f470862ac7aca15
Author: Peter Krempa <pkrempa>
Date:   Tue Aug 16 09:24:12 2016 +0200

    utils: storage: Fix JSON field name for uri based storage
    
    qemu uses 'url' instead of 'uri'. They unfortunately look very similar.

Comment 6 Han Han 2016-08-30 02:20:34 UTC
Verify it on libvirt-2.0.0-6.el7.x86_64
Since http is not whitelisted in current qemu-kvm-rhev, using https protocol to verify the bug.
1. Build up a https server and copy a qcow2 image to the https root dir.

2. Create a json backing image, use sslverify=off due to untrusted https certificate.
# qemu-img create -f qcow2 -b 'json:{"file.driver":"https", "file.url":"https://lab.work.me/https", "file.sslverify":"off"}' /var/lib/libvirt/images/https.img
Formatting '/var/lib/libvirt/images/https.img', fmt=qcow2 size=524288000 backing_file=json:{"file.driver":"https",, "file.url":"https://lab.work.me/https",, "file.sslverify":"off"} encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

3. Refresh the default pool
# virsh pool-refresh default
Pool default refreshed

4. Attach and detach the backing image
# virsh list
 Id    Name                           State
----------------------------------------------------
 15    V                              running

# virsh attach-disk V  /var/lib/libvirt/images/https.img vdb --subdriver 
Disk attached successfully

In guest:
[root@localhost ~]# lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda           252:0    0    3G  0 disk 
├─vda1        252:1    0  500M  0 part /boot
└─vda2        252:2    0  2.5G  0 part 
  ├─rhel-root 253:0    0  2.2G  0 lvm  /
  └─rhel-swap 253:1    0  308M  0 lvm  [SWAP]
vdb           252:16   0  500M  0 disk 

# virsh detach-disk V  vdb  
Disk detached successfully

Comment 7 Han Han 2016-08-30 09:48:26 UTC
Http protocol:
# qemu-img create -f qcow2 -b 'json:{"file.driver":"http", "file.url":"http://10.66.6.236:81/tune.qcow2"}' /var/lib/libvirt/images/http.img
Formatting '/var/lib/libvirt/images/http.img', fmt=qcow2 size=104857600 backing_file=json:{"file.driver":"http",, "file.url":"http://10.66.6.236:81/tune.qcow2"} encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

# virsh pool-refresh default                       
Pool default refreshed

Comment 9 errata-xmlrpc 2016-11-03 18:53:25 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://rhn.redhat.com/errata/RHSA-2016-2577.html


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