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",
}
}
- if (virDomainDiskSourceDefParseAuthValidate(def->src) < 0)
- return -1;
+ 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) {
+ 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;
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("supplying <cipher> for domain disk definition "
+ "is unnecessary"));
+ return -1;
+ }
}
}