Signed-off-by: Ryota Ozaki <ozaki.ryota(a)gmail.com>
From 23b096394eb15183a12c3277ac7a61e1eb73deb2 Mon Sep 17 00:00:00 2001
From: Ryota Ozaki <ozaki.ryota(a)gmail.com>
Date: Sat, 23 May 2009 20:52:51 +0900
Subject: [PATCH] fix storage volume inconsistencies in schema and document
This patch fixes the following inconsistencies:
- The volume element does not take a type attribute,
but the document says it can.
- The capacity element can take a unit attribute optionally,
but the schema does not reflect that.
This patch also modifies a testcase to check the unit attribute.
---
docs/formatstorage.html | 4 ++--
docs/formatstorage.html.in | 4 ++--
docs/schemas/storagevol.rng | 11 +++++++++++
tests/storagevolschemadata/vol-qcow2.xml | 2 +-
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/docs/formatstorage.html b/docs/formatstorage.html
index fc47991..e96712d 100644
--- a/docs/formatstorage.html
+++ b/docs/formatstorage.html
@@ -294,7 +294,7 @@
<a name="StorageVolFirst"
id="StorageVolFirst">General metadata</a>
</h3>
<pre>
- <volume type="file">
+ <volume>
<name>sparse.img</name>
<key>/var/lib/xen/images/sparse.img</key>
<allocation>0</allocation>
@@ -432,7 +432,7 @@
<a name="exampleVol" id="exampleVol">Storage
volume</a>
</h3>
<pre>
- <volume type="file">
+ <volume>
<name>sparse.img</name>
<allocation>0</allocation>
<capacity unit="T">1</capacity>
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
index 60e2ebc..4878d72 100644
--- a/docs/formatstorage.html.in
+++ b/docs/formatstorage.html.in
@@ -183,7 +183,7 @@
<h3><a name="StorageVolFirst">General
metadata</a></h3>
<pre>
- <volume type="file">
+ <volume>
<name>sparse.img</name>
<key>/var/lib/xen/images/sparse.img</key>
<allocation>0</allocation>
@@ -353,7 +353,7 @@
<h3><a name="exampleVol">Storage volume</a></h3>
<pre>
- <volume type="file">
+ <volume>
<name>sparse.img</name>
<allocation>0</allocation>
<capacity unit="T">1</capacity>
diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng
index c7bd3a7..7dc7876 100644
--- a/docs/schemas/storagevol.rng
+++ b/docs/schemas/storagevol.rng
@@ -29,6 +29,11 @@
<define name='sizing'>
<optional>
<element name='capacity'>
+ <optional>
+ <attribute name='unit'>
+ <ref name='unit'/>
+ </attribute>
+ </optional>
<ref name='uint'/>
</element>
</optional>
@@ -183,5 +188,11 @@
</data>
</define>
+ <define name='unit'>
+ <data type='string'>
+ <param name="pattern">[kKmMgGtTpPyYzZ]</param>
+ </data>
+ </define>
+
</grammar>
diff --git a/tests/storagevolschemadata/vol-qcow2.xml
b/tests/storagevolschemadata/vol-qcow2.xml
index a3f5cca..c1cf02f 100644
--- a/tests/storagevolschemadata/vol-qcow2.xml
+++ b/tests/storagevolschemadata/vol-qcow2.xml
@@ -3,7 +3,7 @@
<key>/var/lib/libvirt/images/OtherDemo.img</key>
<source>
</source>
- <capacity>5242880000</capacity>
+ <capacity unit="G">5</capacity>
<allocation>294912</allocation>
<target>
<path>/var/lib/libvirt/images/OtherDemo.img</path>
--
1.6.0.6