From: Peter Krempa Date: Tue, 25 Jun 2019 08:36:06 +0000 (+0200) Subject: qemu: domain: Allow 'VIR_STORAGE_TYPE_VOLUME' disks with 'fat' format X-Git-Tag: v5.5.0-rc1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99917ade0a9789709e9e0b8391bebcf194e8b696;p=thirdparty%2Flibvirt.git qemu: domain: Allow 'VIR_STORAGE_TYPE_VOLUME' disks with 'fat' format 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 Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1326c3d6b1..5b72b7f7bf 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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' " diff --git a/tests/qemuxml2argvdata/disk-source-pool.args b/tests/qemuxml2argvdata/disk-source-pool.args index 676ffb5768..65565fe49e 100644 --- a/tests/qemuxml2argvdata/disk-source-pool.args +++ b/tests/qemuxml2argvdata/disk-source-pool.args @@ -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 diff --git a/tests/qemuxml2argvdata/disk-source-pool.xml b/tests/qemuxml2argvdata/disk-source-pool.xml index ed326d8d49..96bcae9a57 100644 --- a/tests/qemuxml2argvdata/disk-source-pool.xml +++ b/tests/qemuxml2argvdata/disk-source-pool.xml @@ -37,9 +37,17 @@
+ + + + + + - + +
+ diff --git a/tests/qemuxml2xmloutdata/disk-source-pool.xml b/tests/qemuxml2xmloutdata/disk-source-pool.xml index 567b22db84..7e3961381e 100644 --- a/tests/qemuxml2xmloutdata/disk-source-pool.xml +++ b/tests/qemuxml2xmloutdata/disk-source-pool.xml @@ -37,6 +37,13 @@
+ + + + + +
+