[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] fix storage volume inconsistencies in schema and document



Signed-off-by: Ryota Ozaki <ozaki ryota gmail com>

>From 23b096394eb15183a12c3277ac7a61e1eb73deb2 Mon Sep 17 00:00:00 2001
From: Ryota Ozaki <ozaki ryota 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>
-      &lt;volume type="file"&gt;
+      &lt;volume&gt;
 	&lt;name&gt;sparse.img&lt;/name&gt;
 	&lt;key&gt;/var/lib/xen/images/sparse.img&lt;/key&gt;
         &lt;allocation&gt;0&lt;/allocation&gt;
@@ -432,7 +432,7 @@
           <a name="exampleVol" id="exampleVol">Storage volume</a>
         </h3>
         <pre>
-      &lt;volume type="file"&gt;
+      &lt;volume&gt;
 	&lt;name&gt;sparse.img&lt;/name&gt;
 	&lt;allocation&gt;0&lt;/allocation&gt;
 	&lt;capacity unit="T"&gt;1&lt;/capacity&gt;
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>
-      &lt;volume type="file"&gt;
+      &lt;volume&gt;
 	&lt;name&gt;sparse.img&lt;/name&gt;
 	&lt;key&gt;/var/lib/xen/images/sparse.img&lt;/key&gt;
         &lt;allocation&gt;0&lt;/allocation&gt;
@@ -353,7 +353,7 @@
     <h3><a name="exampleVol">Storage volume</a></h3>

     <pre>
-      &lt;volume type="file"&gt;
+      &lt;volume&gt;
 	&lt;name&gt;sparse.img&lt;/name&gt;
 	&lt;allocation&gt;0&lt;/allocation&gt;
 	&lt;capacity unit="T"&gt;1&lt;/capacity&gt;
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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]