mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +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
|
||||
virDomainDiskDefParseValidate(const virDomainDiskDef *def)
|
||||
{
|
||||
virStorageSourcePtr next;
|
||||
|
||||
if (def->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
|
||||
if (def->event_idx != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
@ -9044,11 +9046,12 @@ virDomainDiskDefParseValidate(const virDomainDiskDef *def)
|
||||
}
|
||||
}
|
||||
|
||||
if (virDomainDiskSourceDefParseAuthValidate(def->src) < 0)
|
||||
for (next = def->src; next; next = next->backingStore) {
|
||||
if (virDomainDiskSourceDefParseAuthValidate(next) < 0)
|
||||
return -1;
|
||||
|
||||
if (def->src->encryption) {
|
||||
virStorageEncryptionPtr encryption = def->src->encryption;
|
||||
if (next->encryption) {
|
||||
virStorageEncryptionPtr encryption = next->encryption;
|
||||
|
||||
if (encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS &&
|
||||
encryption->encinfo.cipher_name) {
|
||||
@ -9059,6 +9062,7 @@ virDomainDiskDefParseValidate(const virDomainDiskDef *def)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user