<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 04/23/2014 12:21 AM, Royce Lv wrote:<br>
</div>
<blockquote cite="mid:535731CE.2000401@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 2014年04月23日 00:59, Aline Manera
wrote:<br>
</div>
<blockquote cite="mid:53569FDC.5000309@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 04/22/2014 12:59 AM, <a
moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:shaohef@linux.vnet.ibm.com">shaohef@linux.vnet.ibm.com</a>
wrote:<br>
</div>
<blockquote
cite="mid:1398139189-26732-1-git-send-email-shaohef@linux.vnet.ibm.com"
type="cite">
<pre wrap="">From: ShaoHe Feng <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com"><shaohef@linux.vnet.ibm.com></a>
V2 -> V3:
move the virDomain.metadata and virDomain.setMetadata to model/utils.py
add testcase
V1 -> V2:
libvirt also support virDomain.metadata and virDomain.setMetadata two api.
use virDomain.metadata to get the user and group.
use virDomain.setMetadata to set the user and group.
ShaoHe Feng (3):
Add two function to set and get domain xml metadata
bug fix: get user and group when vm is living.
update test case to set/get user and group when VM is running
src/kimchi/i18n.py | 1 +
src/kimchi/model/utils.py | 41 ++++++++++++++++++++++++++++++
src/kimchi/model/vms.py | 65 +++++++++++++++++++++++------------------------
tests/test_model.py | 13 ++++++++++
4 files changed, 87 insertions(+), 33 deletions(-)
</pre>
</blockquote>
<font face="DejaVu Sans Mono">As I commented in previous
version, </font><font face="DejaVu Sans Mono">virDomain.metadata
and virDomain.setMetadata does not work <br>
well in all libvirt versions<br>
</font><br>
----------------------------------------<br>
<br>
During the first development, I noticed the virDomain.metadata
and virDomain.setMetadata does not work <br>
well in all libvirt versions. <br>
<br>
While using those functions, some libvirt versions will report:
<br>
<br>
libvir: QEMU Driver error : argument unsupported: QEMU driver
does not support<metadata> element <br>
<br>
But if you manually get and set metadata element, libvirt works
fine. <br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
</blockquote>
I went through libvirt log I find:<br>
<br>
commit 21d13ddc5d2e1ba24fec401fd7aec0f33f0fecf0<br>
Author: Peter Krempa <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E" href="mailto:pkrempa@redhat.com"><pkrempa@redhat.com></a><br>
Date: Wed Feb 1 14:03:52 2012 +0100<br>
<br>
qemu: Add support for virDomainGetMetadata and
virDomainSetMetadata<br>
<br>
And in this patch:<br>
<br>
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG) {<br>
+ switch ((virDomainMetadataType) type) {<br>
+ case VIR_DOMAIN_METADATA_DESCRIPTION:<br>
+ VIR_FREE(persistentDef->description);<br>
+ if (metadata &&<br>
+ !(persistentDef->description =
strdup(metadata)))<br>
+ goto no_memory;<br>
+ break;<br>
+ case VIR_DOMAIN_METADATA_TITLE:<br>
+ VIR_FREE(persistentDef->title);<br>
+ if (metadata &&<br>
+ !(persistentDef->title = strdup(metadata)))<br>
+ goto no_memory;<br>
+ break;<br>
+ case VIR_DOMAIN_METADATA_ELEMENT:<br>
+ qemuReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",<br>
+ _("QEMU driver does not support"<br>
+ "<metadata> element"));<br>
+ goto cleanup;<br>
<br>
So in first version METADATA_ELEMENT is not supported for set and
get, and late after release 1.1.2 released(my ubuntu 13.10 is
1.1.1-0ubuntu8.5), metadata_element is handled:<br>
<br>
commit ac38bff077642daa17f9a82480062ebef4c11a7b<br>
Author: Peter Krempa <a moz-do-not-send="true"
class="moz-txt-link-rfc2396E" href="mailto:pkrempa@redhat.com"><pkrempa@redhat.com></a><br>
Date: Fri Sep 6 17:34:43 2013 +0200<br>
<br>
conf: Add support for requesting of XML metadata via the API<br>
<br>
So instead of using VIR_DOMAIN_METADATA_ELEMENT, I guess we can
use metadata_description, so that we can set this in live time, or
we can do as Aline did as a workaround until release 1.1.2 is on
all of our supported version?<br>
<br>
What do your say?<br>
<br>
</blockquote>
<br>
<font face="DejaVu Sans Mono">Good investigation, Royce!<br>
<br>
VIR_DOMAIN_METADATA_DESCRIPTION handles the <description>
tag and VIR_DOMAIN_METADATA_TITLE handles the <title> tag<br>
<br>
So I don't think we can use it for our proposal.<br>
</font>
</body>
</html>