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:
Zeeshan Ali (Khattak)
2012-01-24 04:26:18 +02:00
committed by Eric Blake
parent d19149dda8
commit fa981fc945
11 changed files with 192 additions and 0 deletions

View File

@@ -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>
...
&lt;metadata&gt;
&lt;app1:foo xmlns:app1="http://app1.org/app1/"&gt;..&lt;/app1:foo&gt;
&lt;app2:bar xmlns:app2="http://app1.org/app2/"&gt;..&lt;/app2:bar&gt;
&lt;/metadata&gt;
...</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>

View File

@@ -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