qemu: domain: Forbid slice/encryption/copy_on_read with disk type='lun'

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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-05-07 10:55:37 +02:00
parent b40ec75296
commit 5d72c3ce28
2 changed files with 20 additions and 0 deletions

View File

@ -10487,6 +10487,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;
}

View File

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