mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
qemuDomainDeviceDefValidateDisk: Reorder some checks
I find this function more readable if checks for passed storage source are done first and backing chain is done last. Mixing them together does not hurt, but is less readable. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
@@ -5524,11 +5524,6 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk,
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||
if (qemuDomainValidateStorageSource(n, qemuCaps) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
|
||||
disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
@@ -5537,6 +5532,11 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk,
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) {
|
||||
if (qemuDomainValidateStorageSource(n, qemuCaps) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user