From: Zeeshan Ali (Khattak) Date: Tue, 24 Jan 2012 02:26:18 +0000 (+0200) Subject: Allow custom metadata in domain configuration XML X-Git-Tag: v0.9.10-rc1~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa981fc945e7995aef0e828cfbce3cfda87bfe04;p=thirdparty%2Flibvirt.git 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. --- diff --git a/AUTHORS b/AUTHORS index 783c48a16e..f383c660ab 100644 --- a/AUTHORS +++ b/AUTHORS @@ -217,6 +217,7 @@ Patches have also been contributed by: Deepak C Shetty Martin Kletzander Laszlo Ersek + Zeeshan Ali (Khattak) [....send patches to get your name here....] diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6667bed6b5..6b025e8564 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -3556,6 +3556,26 @@ qemu-kvm -net nic,model=? /dev/null sub-element label are supported.

+

Custom metadata

+ +
+  ...
+  <metadata>
+    <app1:foo xmlns:app1="http://app1.org/app1/">..</app1:foo>
+    <app2:bar xmlns:app2="http://app1.org/app2/">..</app2:bar>
+  </metadata>
+  ...
+ +
+
metadata
+
The metadata 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). Since 0.9.10
+
+

Example configs

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 2041dfbbc2..4fa968dc43 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -25,6 +25,9 @@ + + + @@ -2942,6 +2945,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + fooish + barish + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml new file mode 100644 index 0000000000..a6888ee3ae --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-metadata.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + +

+ + + + + + fooish + barish + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 293c2a7d5f..df317fd538 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -210,6 +210,8 @@ mymain(void) DO_TEST_DIFFERENT("graphics-listen-network2"); DO_TEST_DIFFERENT("graphics-spice-timeout"); + DO_TEST_DIFFERENT("metadata"); + virCapabilitiesFree(driver.caps); return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);