Hi Eric, Daniel,
Thanks for the response.
Sure let me try that.
Its defeats the purpose of virDomainSetMetadata if you cant set <metadata> :)
Individual API is written just to support that (obviously along with setting <title>
and <description>).
API takes domain pointer as its first argument which is the return value of
virDomainDefine.
As per my interpretation, you define the XML of <domain> first, grab an handle and
call SetMetadata.
That’s the way I was able to set <title> and <description> and that’s the way
I feel we should set <metadata> as well UNLESS there is a reason for not doing it.
Thanks,
Ronak
-----Original Message-----
From: Eric Blake [mailto:eblake@redhat.com]
Sent: Tuesday, December 11, 2012 8:00 AM
To: Daniel P. Berrange
Cc: SHAH, Ronak (Ronak R); libvir-list(a)redhat.com
Subject: Re: [libvirt] virDomainSetMetadata --> qemuDomainSetMetadata
On 12/11/2012 03:07 AM, Daniel P. Berrange wrote:
On Mon, Dec 10, 2012 at 11:33:34PM +0000, SHAH, Ronak (Ronak R)
wrote:
> Hi,
>
> I have requirement to add <metadata> tag into the libvirt XML from the
application.
> While calling virDomainSetMetadata which internally call
> qemuDomainSetMetadata (correct me here if I am wrong), I am getting following error:
>
> qemuDomainSetMetdata:12623 : argument unsupported: QEMU driver does
> not support<metadata> element
>
> Support for setting and getting <metadata> with special namespace is
deliberately added in 0.9.10 of libvirt and I am using 0.9.13.
> I am surprise that the internal qemu driver is still cribbing out it.
The QEMU driver does support the <metadata> element, but only if you
specify it when defining the XML as a whole (eg virDomainDefine). For
unknown reasons, the qemuDomainSetMetdata was not implemented to allow
for live updating of the <metadata>.
That said, it's a nice beginner's project to implement that functionality, if
you'd like to try your hand at writing the patch.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org