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 1184929 - libvirtError: argument unsupported: QEMU driver does not support <metadata> element
Summary: libvirtError: argument unsupported: QEMU driver does not support <metadata> e...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1181157
Blocks: 1179592
TreeView+ depends on / blocked
 
Reported: 2015-01-22 13:56 UTC by Jan Kurik
Modified: 2015-02-05 12:48 UTC (History)
26 users (show)

Fixed In Version: libvirt-1.1.1-29.el7_0.6
Doc Type: Enhancement
Doc Text:
The support for custom metadata stored in the [metadata] element of the guest XML configuration file has been implemented for the virDomainSetMetadata and virDomainGetMetadata APIs. This allows users to modify the custom metadata of a running virtual machine by using these APIs.
Clone Of: 1181157
Environment:
Last Closed: 2015-02-05 12:48:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The script to reproduce the bug (2.37 KB, text/plain)
2015-02-05 05:17 UTC, zhenfeng wang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0131 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-02-05 17:48:27 UTC

Description Jan Kurik 2015-01-22 13:56:15 UTC
This bug has been copied from bug #1181157 and has been proposed
to be backported to 7.0 z-stream (EUS).

Comment 8 zhenfeng wang 2015-01-29 09:50:14 UTC
I could reproduce this bug with libvirt libvirt-1.1.1-29.el7_0.4
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     7.0                            shut off

# python testmetadata.py -n 7.0 -o set -t 2 -u "http://herp.derp/" -k test -m "<foo><bar fooish='blurb'>baz</bar></foo>"
libvirt: QEMU Driver error : argument unsupported: QEMU driver does not support <metadata> element
Traceback (most recent call last):
  File "testmetadata.py", line 85, in <module>
    main()
  File "testmetadata.py", line 78, in main
    do_set(dom, mtype, metadata, key, uri, flags)
  File "testmetadata.py", line 9, in do_set
    if dom.setMetadata(mtype, metadata, key, uri, flags):
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1597, in setMetadata
    if ret == -1: raise libvirtError ('virDomainSetMetadata() failed', dom=self)
libvirt.libvirtError: argument unsupported: QEMU driver does not support <metadata> element

Verify this bug with libvirt-1.1.1-29.el7_0.5

scenario 1 verify the bug with the python script

1.# python testmetadata.py -n 7.0 -o set -t 2 -u "http://herp.derp/" -k test -m "<foo><bar fooish='blurb'>baz</bar></foo>"
Okay

2.# python testmetadata.py -n 7.0 -o get -t 2 -u "http://herp.derp/"
<foo>
  <bar fooish="blurb">baz</bar>
</foo>

# virsh dumpxml 7.0 |grep metadata -a2
--
  <metadata>
    <test:foo xmlns:test="http://herp.derp/">
      <test:bar fooish="blurb">baz</test:bar>
    </test:foo>
  </metadata>

3.# python testmetadata.py -n 7.0 -o remove -t 2 -u "http://herp.derp/"
Okay

#virsh dumpxml 7.0 |grep metadata -a2
--
  <metadata/>

scenario 2 
verify the metadata with the virsh command
1.# virsh metadata 7.0 --uri http://herp.derp/ --key herp --set  "<derp xmlns:foobar='http://foo.bar/'></derp>"
Metadata modified

# virsh metadata 7.0 --uri http://herp.derp/ 
<derp xmlns:foobar="http://foo.bar/"/>

# virsh dumpxml 7.0 |grep metadata -a3
--
  <metadata>
    <herp:derp xmlns:foobar="http://foo.bar/" xmlns:herp="http://herp.derp/"/>
  </metadata>

2.Edit the metadata, it will open a window to edit, we can edit it and save it
# virsh metadata 7.0 --edit --key herp --uri http://herp.derp/
<derp xmlns:foobar="http://foo1.bar/"/>

wq:

# virsh metadata 7.0 --key herp --uri http://herp.derp/<derp xmlns:foobar="http://foo1.bar/"/>

3.Edit and set the metadata at the same time will report the expect error

# virsh metadata 7.0  --edit --key herp --uri http://herp.derp/ --set "<derp xmlns:foobar='http://foo.bar/'></derp>"
error: Options --edit and --set are mutually exclusive

4.remove the metadatavirsh list
# virsh metadata 7.0  --uri http://herp.derp/
<derp xmlns:foobar="http://herp.derp/"/>
# virsh metadata 7.0  --uri http://herp.derp/ --remove
Metadata removed
# virsh metadata 7.0  --uri http://herp.derp/
error: metadata not found: Requested metadata element is not present

5.Prepare a pure shutoff guest which didn't include metadata element
run the virsh metadata --remove , the libvirtd didn't crash 
virsh metadata rhel7 "http://herp.derp" --remove

6.Setting metadata with special character in key value  will report the expect error and won't cause the guest fail to start 
# virsh metadata 7.0 "http://herp.derp/" "herp//" "<foo><bar>baz</bar></foo>"
error: internal error: failed to validate prefix for a new XML namespace

# virsh metadata 7.0 "http://herp.derp/" "herp//" "<foo><bar>baz</bar></foo>" --config
error: internal error: failed to validate prefix for a new XML namespace

# virsh start 7.0
Domain 7.0 started

# virsh metadata 7.0 "http://herp.derp/" "herp//" "<foo><bar>baz</bar></foo>" --config
error: internal error: failed to validate prefix for a new XML namespace

# virsh metadata 7.0 "http://herp.derp/" "herp//" "<foo><bar>baz</bar></foo>" 
error: internal error: failed to validate prefix for a new XML namespace

Comment 9 zhenfeng wang 2015-02-05 05:17:29 UTC
Created attachment 988386 [details]
The script to reproduce the bug

Comment 11 errata-xmlrpc 2015-02-05 12:48:44 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/RHBA-2015-0131.html


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