[libvirt PATCH] examples: fix storage volume size schema

Daniel P. Berrangé posted 1 patch 3 years, 6 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20201006092226.2489088-1-berrange@redhat.com
examples/xml/storage/vol-cow.xml    | 6 ++----
examples/xml/storage/vol-qcow.xml   | 6 ++----
examples/xml/storage/vol-qcow2.xml  | 6 ++----
examples/xml/storage/vol-raw.xml    | 6 ++----
examples/xml/storage/vol-sparse.xml | 6 ++----
examples/xml/storage/vol-vmdk.xml   | 6 ++----
6 files changed, 12 insertions(+), 24 deletions(-)
[libvirt PATCH] examples: fix storage volume size schema
Posted by Daniel P. Berrangé 3 years, 6 months ago
There is no such <storage> element, <capacity> and <allocation> exist at
the top level.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 examples/xml/storage/vol-cow.xml    | 6 ++----
 examples/xml/storage/vol-qcow.xml   | 6 ++----
 examples/xml/storage/vol-qcow2.xml  | 6 ++----
 examples/xml/storage/vol-raw.xml    | 6 ++----
 examples/xml/storage/vol-sparse.xml | 6 ++----
 examples/xml/storage/vol-vmdk.xml   | 6 ++----
 6 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/examples/xml/storage/vol-cow.xml b/examples/xml/storage/vol-cow.xml
index 1d80a01f4b..f2bf1b4950 100644
--- a/examples/xml/storage/vol-cow.xml
+++ b/examples/xml/storage/vol-cow.xml
@@ -1,9 +1,7 @@
 <volume type="file">
   <name>cow.img</name>
-  <storage>
-    <allocation>0</allocation>
-    <capacity unit="T">1</capacity>
-  </storage>
+  <allocation>0</allocation>
+  <capacity unit="T">1</capacity>
   <target>
     <format type="cow"/>
   </target>
diff --git a/examples/xml/storage/vol-qcow.xml b/examples/xml/storage/vol-qcow.xml
index af2011d66a..6c30329f39 100644
--- a/examples/xml/storage/vol-qcow.xml
+++ b/examples/xml/storage/vol-qcow.xml
@@ -1,9 +1,7 @@
 <volume type="file">
   <name>qcow.img</name>
-  <storage>
-    <allocation>0</allocation>
-    <capacity unit="T">1</capacity>
-  </storage>
+  <allocation>0</allocation>
+  <capacity unit="T">1</capacity>
   <target>
     <format type="qcow"/>
   </target>
diff --git a/examples/xml/storage/vol-qcow2.xml b/examples/xml/storage/vol-qcow2.xml
index 9d944a78d7..14639da796 100644
--- a/examples/xml/storage/vol-qcow2.xml
+++ b/examples/xml/storage/vol-qcow2.xml
@@ -1,9 +1,7 @@
 <volume type="file">
   <name>qcow2.img</name>
-  <storage>
-    <allocation>0</allocation>
-    <capacity unit="T">1</capacity>
-  </storage>
+  <allocation>0</allocation>
+  <capacity unit="T">1</capacity>
   <target>
     <format type="qcow2"/>
   </target>
diff --git a/examples/xml/storage/vol-raw.xml b/examples/xml/storage/vol-raw.xml
index 59d4b457b1..bc4e049a35 100644
--- a/examples/xml/storage/vol-raw.xml
+++ b/examples/xml/storage/vol-raw.xml
@@ -1,7 +1,5 @@
 <volume type="file">
   <name>raw.img</name>
-  <storage>
-    <allocation unit="M">10</allocation>
-    <capacity unit="M">1000</capacity>
-  </storage>
+  <allocation unit="M">10</allocation>
+  <capacity unit="M">1000</capacity>
 </volume>
diff --git a/examples/xml/storage/vol-sparse.xml b/examples/xml/storage/vol-sparse.xml
index c529a490d9..2ec9f0b748 100644
--- a/examples/xml/storage/vol-sparse.xml
+++ b/examples/xml/storage/vol-sparse.xml
@@ -1,7 +1,5 @@
 <volume type="file">
   <name>sparse.img</name>
-  <storage>
-    <allocation>0</allocation>
-    <capacity unit="T">1</capacity>
-  </storage>
+  <allocation>0</allocation>
+  <capacity unit="T">1</capacity>
 </volume>
diff --git a/examples/xml/storage/vol-vmdk.xml b/examples/xml/storage/vol-vmdk.xml
index 5af0a8499f..05309a1438 100644
--- a/examples/xml/storage/vol-vmdk.xml
+++ b/examples/xml/storage/vol-vmdk.xml
@@ -1,9 +1,7 @@
 <volume type="file">
   <name>vmdk3.img</name>
-  <storage>
-    <allocation>0</allocation>
-    <capacity unit="T">1</capacity>
-  </storage>
+  <allocation>0</allocation>
+  <capacity unit="T">1</capacity>
   <target>
     <format type="vmdk"/>
   </target>
-- 
2.26.2

Re: [libvirt PATCH] examples: fix storage volume size schema
Posted by Peter Krempa 3 years, 6 months ago
On Tue, Oct 06, 2020 at 10:22:27 +0100, Daniel Berrange wrote:
> There is no such <storage> element, <capacity> and <allocation> exist at
> the top level.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  examples/xml/storage/vol-cow.xml    | 6 ++----
>  examples/xml/storage/vol-qcow.xml   | 6 ++----
>  examples/xml/storage/vol-qcow2.xml  | 6 ++----
>  examples/xml/storage/vol-raw.xml    | 6 ++----
>  examples/xml/storage/vol-sparse.xml | 6 ++----
>  examples/xml/storage/vol-vmdk.xml   | 6 ++----
>  6 files changed, 12 insertions(+), 24 deletions(-)

Definitely an improvement but some of them still don't validate:

jing ../../../docs/schemas/storagevol.rng vol*
/home/pipo/libvirt/examples/xml/storage/vol-raw.xml:5:10: error: element "volume" incomplete; missing required element "target"
/home/pipo/libvirt/examples/xml/storage/vol-sparse.xml:5:10: error: element "volume" incomplete; missing required element "target"


I'll probably fix those along with addition to virschematest to prevent
this from happening.

Re: [libvirt PATCH] examples: fix storage volume size schema
Posted by Peter Krempa 3 years, 6 months ago
On Tue, Oct 06, 2020 at 12:47:23 +0200, Peter Krempa wrote:
> On Tue, Oct 06, 2020 at 10:22:27 +0100, Daniel Berrange wrote:
> > There is no such <storage> element, <capacity> and <allocation> exist at
> > the top level.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  examples/xml/storage/vol-cow.xml    | 6 ++----
> >  examples/xml/storage/vol-qcow.xml   | 6 ++----
> >  examples/xml/storage/vol-qcow2.xml  | 6 ++----
> >  examples/xml/storage/vol-raw.xml    | 6 ++----
> >  examples/xml/storage/vol-sparse.xml | 6 ++----
> >  examples/xml/storage/vol-vmdk.xml   | 6 ++----
> >  6 files changed, 12 insertions(+), 24 deletions(-)
> 
> Definitely an improvement but some of them still don't validate:
> 
> jing ../../../docs/schemas/storagevol.rng vol*
> /home/pipo/libvirt/examples/xml/storage/vol-raw.xml:5:10: error: element "volume" incomplete; missing required element "target"
> /home/pipo/libvirt/examples/xml/storage/vol-sparse.xml:5:10: error: element "volume" incomplete; missing required element "target"
> 
> 
> I'll probably fix those along with addition to virschematest to prevent
> this from happening.

Forgot to add:

Reviewed-by: Peter Krempa <pkrempa@redhat.com>