[PATCH 2/2] qemu: domain: Forbid slice/encryption/copy_on_read with disk type='lun'

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

 



Any non-raw block layer feature will not work with raw SCSI command
passthrough via 'scsi-block'. Explicitly refuse use of luks encryption,
storage slices and copy on read.

https://bugzilla.redhat.com/show_bug.cgi?id=1820040

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c   | 13 +++++++++++++
 src/qemu/qemu_validate.c |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index c4ca93722f..18384be2af 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10491,6 +10491,19 @@ qemuDomainDefValidateDiskLunSource(const virStorageSource *src)
         return -1;
     }

+    if (src->sliceStorage) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("disk device 'lun' doesn't support storage slice"));
+        return -1;
+    }
+
+    if (src->encryption &&
+        src->encryption->format != VIR_STORAGE_ENCRYPTION_FORMAT_DEFAULT) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("disk device 'lun' doesn't support encryption"));
+        return -1;
+    }
+
     return 0;
 }

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index f789ed075a..d34151050f 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1997,6 +1997,13 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
             return -1;
         }

+        if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("copy_on_read is not compatible with 'lun' disk '%s'"),
+                           disk->dst);
+            return -1;
+        }
+
         if (qemuDomainDefValidateDiskLunSource(disk->src) < 0)
             return -1;

-- 
2.26.2





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux