mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 22:45:17 +00:00
conf: Validate disk source configuration also for the backing store
Since we already parse the <backingStore> of a disk source, we should also validate the configuration for the whole backing chain and not only for the top level image. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
c4e7c1f212
commit
28e1068c4f
@ -8974,6 +8974,8 @@ virDomainDiskSourceDefParseAuthValidate(const virStorageSource *src)
|
|||||||
static int
|
static int
|
||||||
virDomainDiskDefParseValidate(const virDomainDiskDef *def)
|
virDomainDiskDefParseValidate(const virDomainDiskDef *def)
|
||||||
{
|
{
|
||||||
|
virStorageSourcePtr next;
|
||||||
|
|
||||||
if (def->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
|
if (def->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
|
||||||
if (def->event_idx != VIR_TRISTATE_SWITCH_ABSENT) {
|
if (def->event_idx != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
@ -9044,19 +9046,21 @@ virDomainDiskDefParseValidate(const virDomainDiskDef *def)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virDomainDiskSourceDefParseAuthValidate(def->src) < 0)
|
for (next = def->src; next; next = next->backingStore) {
|
||||||
return -1;
|
if (virDomainDiskSourceDefParseAuthValidate(next) < 0)
|
||||||
|
|
||||||
if (def->src->encryption) {
|
|
||||||
virStorageEncryptionPtr encryption = def->src->encryption;
|
|
||||||
|
|
||||||
if (encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS &&
|
|
||||||
encryption->encinfo.cipher_name) {
|
|
||||||
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||||
_("supplying <cipher> for domain disk definition "
|
|
||||||
"is unnecessary"));
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (next->encryption) {
|
||||||
|
virStorageEncryptionPtr encryption = next->encryption;
|
||||||
|
|
||||||
|
if (encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS &&
|
||||||
|
encryption->encinfo.cipher_name) {
|
||||||
|
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("supplying <cipher> for domain disk definition "
|
||||||
|
"is unnecessary"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user