]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: Allow 'VIR_STORAGE_TYPE_VOLUME' disks with 'fat' format
authorPeter Krempa <pkrempa@redhat.com>
Tue, 25 Jun 2019 08:36:06 +0000 (10:36 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 26 Jun 2019 10:28:31 +0000 (12:28 +0200)
The storage volume may in fact convert into a directory when starting
the VM so that it may be actually possible to use it.

This is a regression caused by c9b27af32d5 as moving the check to
validation time without adjustment causes problems as the volumes are
not translated yet.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
tests/qemuxml2argvdata/disk-source-pool.args
tests/qemuxml2argvdata/disk-source-pool.xml
tests/qemuxml2xmloutdata/disk-source-pool.xml

index 1326c3d6b149620f57b2bd17f85fbebb3acc0207..5b72b7f7bf0a785f3e52eeb1f26ae874d79cefef 100644 (file)
@@ -5078,6 +5078,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src,
     }
 
     if (src->format == VIR_STORAGE_FILE_FAT &&
+        actualType != VIR_STORAGE_TYPE_VOLUME &&
         actualType != VIR_STORAGE_TYPE_DIR) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                        _("storage format 'fat' is supported only with 'dir' "
index 676ffb5768dacefe01f28fd23e5ad64fbac3fd84..65565fe49e9123385213649fe16ec70f6b8c0f58 100644 (file)
@@ -32,4 +32,8 @@ readonly=on \
 -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
 -drive file=/tmp/idedisk.img,format=raw,if=none,id=drive-ide0-0-2 \
 -device ide-hd,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2,bootindex=1 \
+-drive file=fat:/some/dir/device/vol1,if=none,id=drive-virtio-disk0,\
+readonly=on \
+-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
+id=virtio-disk0 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
index ed326d8d49dd5ef510d474b429e4be4b010fa051..96bcae9a579bded0ac3bc9c3419e12f85e8f4ec2 100644 (file)
       <target dev='hdd' bus='ide'/>
       <address type='drive' controller='0' bus='0' target='0' unit='2'/>
     </disk>
+    <disk type='volume' device='disk'>
+      <driver name='qemu' type='fat'/>
+      <source pool='pool-disk' volume='dir+vol1'/>
+      <target dev='vda' bus='virtio'/>
+      <readonly/>
+    </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <memballoon model='virtio'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </memballoon>
   </devices>
 </domain>
index 567b22db8496d7c179336ecdaa062d926f1002a1..7e3961381ec29dcd5e5141b8d59afdd72d58d788 100644 (file)
       <target dev='hdd' bus='ide'/>
       <address type='drive' controller='0' bus='0' target='0' unit='2'/>
     </disk>
+    <disk type='volume' device='disk'>
+      <driver name='qemu' type='fat'/>
+      <source pool='pool-disk' volume='dir+vol1'/>
+      <target dev='vda' bus='virtio'/>
+      <readonly/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </disk>
     <controller type='usb' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>