]> xenbits.xensource.com Git - libvirt.git/commitdiff
Move volume XMLs out of storagevolxml2argvdata
authorJán Tomko <jtomko@redhat.com>
Mon, 22 Jul 2013 13:44:06 +0000 (15:44 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 25 Jul 2013 11:26:41 +0000 (13:26 +0200)
Reuse the XML files in storagevolxml2xmlin.

(This requires changing a few backing files to /dev/null,
since virStorageBackendCreateQemuImgCmd checks for its
presence)

18 files changed:
tests/storagevolxml2argvdata/vol-file.xml [deleted file]
tests/storagevolxml2argvdata/vol-qcow2-0.10-lazy.xml [deleted file]
tests/storagevolxml2argvdata/vol-qcow2-1.1.xml [deleted file]
tests/storagevolxml2argvdata/vol-qcow2-lazy.xml [deleted file]
tests/storagevolxml2argvdata/vol-qcow2-nobacking.xml [deleted file]
tests/storagevolxml2argvdata/vol-qcow2.xml [deleted file]
tests/storagevolxml2argvtest.c
tests/storagevolxml2xmlin/vol-qcow2-0.10-lazy.xml [new file with mode: 0644]
tests/storagevolxml2xmlin/vol-qcow2-1.1.xml
tests/storagevolxml2xmlin/vol-qcow2-lazy.xml
tests/storagevolxml2xmlin/vol-qcow2-nobacking.xml [new file with mode: 0644]
tests/storagevolxml2xmlin/vol-qcow2.xml
tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml [new file with mode: 0644]
tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml [new file with mode: 0644]
tests/storagevolxml2xmlout/vol-qcow2.xml
tests/storagevolxml2xmltest.c

diff --git a/tests/storagevolxml2argvdata/vol-file.xml b/tests/storagevolxml2argvdata/vol-file.xml
deleted file mode 100644 (file)
index d3f65f6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<volume>
-  <name>sparse.img</name>
-  <source/>
-  <capacity unit="TiB">1</capacity>
-  <allocation unit="bytes">0</allocation>
-  <target>
-    <path>/var/lib/libvirt/images/sparse.img</path>
-    <permissions>
-      <mode>0</mode>
-      <owner>0744</owner>
-      <group>0</group>
-      <label>virt_image_t</label>
-    </permissions>
-    <timestamps>
-      <atime>1341933637.273190990</atime>
-      <mtime>1341930622.047245868</mtime>
-      <ctime>1341930622.047245868</ctime>
-    </timestamps>
-  </target>
-</volume>
diff --git a/tests/storagevolxml2argvdata/vol-qcow2-0.10-lazy.xml b/tests/storagevolxml2argvdata/vol-qcow2-0.10-lazy.xml
deleted file mode 100644 (file)
index 5bf98b7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<volume>
-  <name>OtherDemo.img</name>
-  <key>/var/lib/libvirt/images/OtherDemo.img</key>
-  <source>
-  </source>
-  <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>
-    <compat>0.10</compat>
-    <features>
-      <lazy_refcounts/>
-    </features>
-  </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/storagevolxml2argvdata/vol-qcow2-1.1.xml b/tests/storagevolxml2argvdata/vol-qcow2-1.1.xml
deleted file mode 100644 (file)
index 696e1e0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<volume>
-  <name>OtherDemo.img</name>
-  <key>/var/lib/libvirt/images/OtherDemo.img</key>
-  <source>
-  </source>
-  <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>
-    <features/>
-  </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/storagevolxml2argvdata/vol-qcow2-lazy.xml b/tests/storagevolxml2argvdata/vol-qcow2-lazy.xml
deleted file mode 100644 (file)
index c1d7875..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<volume>
-  <name>OtherDemo.img</name>
-  <key>/var/lib/libvirt/images/OtherDemo.img</key>
-  <source>
-  </source>
-  <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>
-    <compat>1.1</compat>
-    <features>
-      <lazy_refcounts/>
-    </features>
-  </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/storagevolxml2argvdata/vol-qcow2-nobacking.xml b/tests/storagevolxml2argvdata/vol-qcow2-nobacking.xml
deleted file mode 100644 (file)
index 6a6bd5b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<volume>
-  <name>OtherDemo.img</name>
-  <key>/var/lib/libvirt/images/OtherDemo.img</key>
-  <source>
-  </source>
-  <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>
-</volume>
diff --git a/tests/storagevolxml2argvdata/vol-qcow2.xml b/tests/storagevolxml2argvdata/vol-qcow2.xml
deleted file mode 100644 (file)
index 49a7de3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<volume>
-  <name>OtherDemo.img</name>
-  <key>/var/lib/libvirt/images/OtherDemo.img</key>
-  <source>
-  </source>
-  <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>
index 8ef438fff9efbddc79b330c06842e740362f86a9..5561f51894d9edef327145aa5aa661cf50a0fb5d 100644 (file)
@@ -121,12 +121,12 @@ testCompareXMLToArgvHelper(const void *data)
     char *cmdline = NULL;
 
     if (info->inputvol &&
-        virAsprintf(&inputvolxml, "%s/storagevolxml2argvdata/%s.xml",
+        virAsprintf(&inputvolxml, "%s/storagevolxml2xmlin/%s.xml",
                     abs_srcdir, info->inputvol) < 0)
         goto cleanup;
     if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml",
                     abs_srcdir, info->pool) < 0 ||
-        virAsprintf(&volxml, "%s/storagevolxml2argvdata/%s.xml",
+        virAsprintf(&volxml, "%s/storagevolxml2xmlin/%s.xml",
                     abs_srcdir, info->vol) < 0) {
         goto cleanup;
     }
diff --git a/tests/storagevolxml2xmlin/vol-qcow2-0.10-lazy.xml b/tests/storagevolxml2xmlin/vol-qcow2-0.10-lazy.xml
new file mode 100644 (file)
index 0000000..5bf98b7
--- /dev/null
@@ -0,0 +1,35 @@
+<volume>
+  <name>OtherDemo.img</name>
+  <key>/var/lib/libvirt/images/OtherDemo.img</key>
+  <source>
+  </source>
+  <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>
+    <compat>0.10</compat>
+    <features>
+      <lazy_refcounts/>
+    </features>
+  </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>
index e8df8b3014fcf310cc8cb13186a5d9e965ca6af5..696e1e07501796cd2912fbd163173d11b195ae8d 100644 (file)
@@ -20,7 +20,7 @@
     <features/>
   </target>
   <backingStore>
-    <path>/var/lib/libvirt/images/BaseDemo.img</path>
+    <path>/dev/null</path>
     <format type='raw'/>
     <permissions>
       <mode>0644</mode>
index 336342a4f824d082704912eadff6cf1ee61f6d65..c1d7875d668e7068f67dede6cacef09035b30768 100644 (file)
@@ -23,7 +23,7 @@
     </features>
   </target>
   <backingStore>
-    <path>/var/lib/libvirt/images/BaseDemo.img</path>
+    <path>/dev/null</path>
     <format type='raw'/>
     <permissions>
       <mode>0644</mode>
diff --git a/tests/storagevolxml2xmlin/vol-qcow2-nobacking.xml b/tests/storagevolxml2xmlin/vol-qcow2-nobacking.xml
new file mode 100644 (file)
index 0000000..6a6bd5b
--- /dev/null
@@ -0,0 +1,21 @@
+<volume>
+  <name>OtherDemo.img</name>
+  <key>/var/lib/libvirt/images/OtherDemo.img</key>
+  <source>
+  </source>
+  <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>
+</volume>
index b4924de8404f6958444b55d5bcc6b8d88df8927f..49a7de33d39413c2313ce3177a17f1a694ad97fd 100644 (file)
@@ -19,7 +19,7 @@
     </encryption>
   </target>
   <backingStore>
-    <path>/var/lib/libvirt/images/BaseDemo.img</path>
+    <path>/dev/null</path>
     <format type='raw'/>
     <permissions>
       <mode>0644</mode>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml b/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml
new file mode 100644 (file)
index 0000000..a7b5fed
--- /dev/null
@@ -0,0 +1,35 @@
+<volume>
+  <name>OtherDemo.img</name>
+  <key>(null)</key>
+  <source>
+  </source>
+  <capacity unit='bytes'>5368709120</capacity>
+  <allocation unit='bytes'>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>
+    <compat>0.10</compat>
+    <features>
+      <lazy_refcounts/>
+    </features>
+  </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>
index 454ac112996ef596a1d22b87ebf44a690853a63f..b7df8a6caecb4aca083408da84c650816a1fe595 100644 (file)
@@ -21,7 +21,7 @@
     <features/>
   </target>
   <backingStore>
-    <path>/var/lib/libvirt/images/BaseDemo.img</path>
+    <path>/dev/null</path>
     <format type='raw'/>
     <permissions>
       <mode>0644</mode>
index 4e30edef98db96f21ae6d604ca21a022c6395212..92b78756689245f0d3d1140dde5e40dcf9a9f41e 100644 (file)
@@ -23,7 +23,7 @@
     </features>
   </target>
   <backingStore>
-    <path>/var/lib/libvirt/images/BaseDemo.img</path>
+    <path>/dev/null</path>
     <format type='raw'/>
     <permissions>
       <mode>0644</mode>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml b/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml
new file mode 100644 (file)
index 0000000..e2da702
--- /dev/null
@@ -0,0 +1,21 @@
+<volume>
+  <name>OtherDemo.img</name>
+  <key>(null)</key>
+  <source>
+  </source>
+  <capacity unit='bytes'>5368709120</capacity>
+  <allocation unit='bytes'>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>
+</volume>
index 4490931f18125acb86b55e814c5d27579cb737c2..f931a629cdb7e5622d2b3c06a74825eb8fdcdc69 100644 (file)
@@ -19,7 +19,7 @@
     </encryption>
   </target>
   <backingStore>
-    <path>/var/lib/libvirt/images/BaseDemo.img</path>
+    <path>/dev/null</path>
     <format type='raw'/>
     <permissions>
       <mode>0644</mode>
index 05d2306f45197f89744cd7d1dc8a3d73b37dad12..5b0a60b64086e9a8b9ee131044dea9d8505f8b4d 100644 (file)
@@ -114,6 +114,8 @@ mymain(void)
     DO_TEST("pool-dir", "vol-qcow2");
     DO_TEST("pool-dir", "vol-qcow2-1.1");
     DO_TEST("pool-dir", "vol-qcow2-lazy");
+    DO_TEST("pool-dir", "vol-qcow2-0.10-lazy");
+    DO_TEST("pool-dir", "vol-qcow2-nobacking");
     DO_TEST("pool-disk", "vol-partition");
     DO_TEST("pool-logical", "vol-logical");
     DO_TEST("pool-logical", "vol-logical-backing");