Move volume XMLs out of storagevolxml2argvdata

Reuse the XML files in storagevolxml2xmlin.

(This requires changing a few backing files to /dev/null,
since virStorageBackendCreateQemuImgCmd checks for its
presence)
This commit is contained in:
Ján Tomko 2013-07-22 15:44:06 +02:00
parent 823778829e
commit 3a75fca289
14 changed files with 17 additions and 77 deletions

View File

@ -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>

View File

@ -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>

View File

@ -121,12 +121,12 @@ testCompareXMLToArgvHelper(const void *data)
char *cmdline = NULL; char *cmdline = NULL;
if (info->inputvol && if (info->inputvol &&
virAsprintf(&inputvolxml, "%s/storagevolxml2argvdata/%s.xml", virAsprintf(&inputvolxml, "%s/storagevolxml2xmlin/%s.xml",
abs_srcdir, info->inputvol) < 0) abs_srcdir, info->inputvol) < 0)
goto cleanup; goto cleanup;
if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml", if (virAsprintf(&poolxml, "%s/storagepoolxml2xmlin/%s.xml",
abs_srcdir, info->pool) < 0 || abs_srcdir, info->pool) < 0 ||
virAsprintf(&volxml, "%s/storagevolxml2argvdata/%s.xml", virAsprintf(&volxml, "%s/storagevolxml2xmlin/%s.xml",
abs_srcdir, info->vol) < 0) { abs_srcdir, info->vol) < 0) {
goto cleanup; goto cleanup;
} }

View File

@ -20,7 +20,7 @@
<features/> <features/>
</target> </target>
<backingStore> <backingStore>
<path>/var/lib/libvirt/images/BaseDemo.img</path> <path>/dev/null</path>
<format type='raw'/> <format type='raw'/>
<permissions> <permissions>
<mode>0644</mode> <mode>0644</mode>

View File

@ -23,7 +23,7 @@
</features> </features>
</target> </target>
<backingStore> <backingStore>
<path>/var/lib/libvirt/images/BaseDemo.img</path> <path>/dev/null</path>
<format type='raw'/> <format type='raw'/>
<permissions> <permissions>
<mode>0644</mode> <mode>0644</mode>

View File

@ -19,7 +19,7 @@
</encryption> </encryption>
</target> </target>
<backingStore> <backingStore>
<path>/var/lib/libvirt/images/BaseDemo.img</path> <path>/dev/null</path>
<format type='raw'/> <format type='raw'/>
<permissions> <permissions>
<mode>0644</mode> <mode>0644</mode>

View File

@ -1,10 +1,10 @@
<volume> <volume>
<name>OtherDemo.img</name> <name>OtherDemo.img</name>
<key>/var/lib/libvirt/images/OtherDemo.img</key> <key>(null)</key>
<source> <source>
</source> </source>
<capacity unit="G">5</capacity> <capacity unit='bytes'>5368709120</capacity>
<allocation>294912</allocation> <allocation unit='bytes'>294912</allocation>
<target> <target>
<path>/var/lib/libvirt/images/OtherDemo.img</path> <path>/var/lib/libvirt/images/OtherDemo.img</path>
<format type='qcow2'/> <format type='qcow2'/>
@ -17,7 +17,7 @@
<encryption format='qcow'> <encryption format='qcow'>
<secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/> <secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
</encryption> </encryption>
<compat>1.1</compat> <compat>0.10</compat>
<features> <features>
<lazy_refcounts/> <lazy_refcounts/>
</features> </features>

View File

@ -21,7 +21,7 @@
<features/> <features/>
</target> </target>
<backingStore> <backingStore>
<path>/var/lib/libvirt/images/BaseDemo.img</path> <path>/dev/null</path>
<format type='raw'/> <format type='raw'/>
<permissions> <permissions>
<mode>0644</mode> <mode>0644</mode>

View File

@ -23,7 +23,7 @@
</features> </features>
</target> </target>
<backingStore> <backingStore>
<path>/var/lib/libvirt/images/BaseDemo.img</path> <path>/dev/null</path>
<format type='raw'/> <format type='raw'/>
<permissions> <permissions>
<mode>0644</mode> <mode>0644</mode>

View File

@ -1,10 +1,10 @@
<volume> <volume>
<name>OtherDemo.img</name> <name>OtherDemo.img</name>
<key>/var/lib/libvirt/images/OtherDemo.img</key> <key>(null)</key>
<source> <source>
</source> </source>
<capacity unit="G">5</capacity> <capacity unit='bytes'>5368709120</capacity>
<allocation>294912</allocation> <allocation unit='bytes'>294912</allocation>
<target> <target>
<path>/var/lib/libvirt/images/OtherDemo.img</path> <path>/var/lib/libvirt/images/OtherDemo.img</path>
<format type='qcow2'/> <format type='qcow2'/>
@ -18,14 +18,4 @@
<secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/> <secret type='passphrase' uuid='e78d4b51-a2af-485f-b0f5-afca709a80f4'/>
</encryption> </encryption>
</target> </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> </volume>

View File

@ -19,7 +19,7 @@
</encryption> </encryption>
</target> </target>
<backingStore> <backingStore>
<path>/var/lib/libvirt/images/BaseDemo.img</path> <path>/dev/null</path>
<format type='raw'/> <format type='raw'/>
<permissions> <permissions>
<mode>0644</mode> <mode>0644</mode>

View File

@ -114,6 +114,8 @@ mymain(void)
DO_TEST("pool-dir", "vol-qcow2"); DO_TEST("pool-dir", "vol-qcow2");
DO_TEST("pool-dir", "vol-qcow2-1.1"); DO_TEST("pool-dir", "vol-qcow2-1.1");
DO_TEST("pool-dir", "vol-qcow2-lazy"); 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-disk", "vol-partition");
DO_TEST("pool-logical", "vol-logical"); DO_TEST("pool-logical", "vol-logical");
DO_TEST("pool-logical", "vol-logical-backing"); DO_TEST("pool-logical", "vol-logical-backing");