mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Allow custom metadata in domain configuration XML
Applications can now insert custom nodes and hierarchies into domain configuration XML. Although currently not enforced, applications are required to use their own namespaces on every custom node they insert, with only one top-level element per namespace.
This commit is contained in:
committed by
Eric Blake
parent
d19149dda8
commit
fa981fc945
@@ -3556,6 +3556,26 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
sub-element <code>label</code> are supported.
|
||||
</p>
|
||||
|
||||
<h3><a name="customMetadata">Custom metadata</a></h3>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<metadata>
|
||||
<app1:foo xmlns:app1="http://app1.org/app1/">..</app1:foo>
|
||||
<app2:bar xmlns:app2="http://app1.org/app2/">..</app2:bar>
|
||||
</metadata>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>metadata</code></dt>
|
||||
<dd>The <code>metadata</code> node can be used by applications to
|
||||
store custom metadata in the form of XML nodes/trees. Applications
|
||||
must use custom namespaces on their XML nodes/trees, with only
|
||||
one top-level element per namespace (if the application needs
|
||||
structure, they should have sub-elements to their namespace
|
||||
element). <span class="since">Since 0.9.10</span></dd>
|
||||
</dl>
|
||||
|
||||
<h2><a name="examples">Example configs</a></h2>
|
||||
|
||||
<p>
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
<optional>
|
||||
<ref name="description"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="metadata"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="cpu"/>
|
||||
</optional>
|
||||
@@ -2942,6 +2945,29 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="metadata">
|
||||
<element name="metadata">
|
||||
<zeroOrMore>
|
||||
<ref name="customElement"/>
|
||||
</zeroOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="customElement">
|
||||
<element>
|
||||
<anyName/>
|
||||
<zeroOrMore>
|
||||
<choice>
|
||||
<attribute>
|
||||
<anyName/>
|
||||
</attribute>
|
||||
<text/>
|
||||
<ref name="customElement"/>
|
||||
</choice>
|
||||
</zeroOrMore>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<!--
|
||||
Type library
|
||||
|
||||
|
||||
Reference in New Issue
Block a user