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

[libvirt] [PATCH 2/2] schema: make source optional in volume XML



We don't parse it anyway.

https://bugzilla.redhat.com/show_bug.cgi?id=893273
---
 docs/schemas/storagevol.rng                    |  4 +++-
 tests/Makefile.am                              |  3 ++-
 tests/storagevolschemadata/qcow2-no-source.xml | 29 ++++++++++++++++++++++++++
 tests/storagevolschematest                     |  2 +-
 4 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 tests/storagevolschemadata/qcow2-no-source.xml

diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng
index ca8ce56..4649d91 100644
--- a/docs/schemas/storagevol.rng
+++ b/docs/schemas/storagevol.rng
@@ -20,7 +20,9 @@
           <text/>
         </element>
       </optional>
-      <ref name='source'/>
+      <optional>
+        <ref name='source'/>
+      </optional>
       <ref name='sizing'/>
       <ref name='target'/>
       <optional>
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 04b76ba..c3573a8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -73,11 +73,12 @@ EXTRA_DIST =		\
 	securityselinuxlabeldata \
 	schematestutils.sh \
 	sexpr2xmldata \
-	storagepoolschemadata \
 	storagepoolschematest \
+	storagepoolschemadata \
 	storagepoolxml2xmlin \
 	storagepoolxml2xmlout \
 	storagevolxml2argvdata \
+	storagevolschemadata \
 	storagevolschematest \
 	storagevolxml2xmlin \
 	storagevolxml2xmlout \
diff --git a/tests/storagevolschemadata/qcow2-no-source.xml b/tests/storagevolschemadata/qcow2-no-source.xml
new file mode 100644
index 0000000..777294e
--- /dev/null
+++ b/tests/storagevolschemadata/qcow2-no-source.xml
@@ -0,0 +1,29 @@
+<volume>
+  <name>OtherDemo.img</name>
+  <key>/var/lib/libvirt/images/OtherDemo.img</key>
+  <capacity unit="G">5</capacity>
+  <allocation>294912</allocation>
+  <target>
+    <path>/var/lib/libvirt/images/OtherDemo.img</path>
+    <format type='qcow2'/>
+    <permissions>
+      <mode>0644</mode>
+      <owner>0</owner>
+      <group>0</group>
+      <label>unconfined_u:object_r:virt_image_t:s0</label>
+    </permissions>
+    <encryption format='qcow'>
+      <secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
+    </encryption>
+  </target>
+  <backingStore>
+    <path>/dev/null</path>
+    <format type='raw'/>
+    <permissions>
+      <mode>0644</mode>
+      <owner>0</owner>
+      <group>0</group>
+      <label>unconfined_u:object_r:virt_image_t:s0</label>
+    </permissions>
+  </backingStore>
+</volume>
diff --git a/tests/storagevolschematest b/tests/storagevolschematest
index e1afa8d..9045e6b 100755
--- a/tests/storagevolschematest
+++ b/tests/storagevolschematest
@@ -4,7 +4,7 @@
 . $srcdir/test-lib.sh
 . $abs_srcdir/schematestutils.sh
 
-DIRS="storagevolxml2xmlin storagevolxml2xmlout"
+DIRS="storagevolxml2xmlin storagevolxml2xmlout storagevolschemadata"
 SCHEMA="storagevol.rng"
 
 check_schema "$DIRS" "$SCHEMA"
-- 
1.8.1.5


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