mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemu: domain: Refactor control flow in qemuDomainDetermineDiskChain
Split out clearing of the backing chain prior to other code since it will be required later and optimize few layers of nested conditions and loops.
This commit is contained in:
parent
cb06ea57ad
commit
b19710b9b6
@ -6369,12 +6369,11 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virStorageSourceHasBacking(src)) {
|
||||
if (force_probe) {
|
||||
if (force_probe)
|
||||
virStorageSourceBackingStoreClear(src);
|
||||
} else {
|
||||
/* skip to the end of the chain */
|
||||
while (virStorageSourceIsBacking(src)) {
|
||||
|
||||
/* skip to the end of the chain if there is any */
|
||||
while (virStorageSourceHasBacking(src)) {
|
||||
if (report_broken &&
|
||||
virStorageFileSupportsAccess(src)) {
|
||||
|
||||
@ -6391,8 +6390,6 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
|
||||
}
|
||||
src = src->backingStore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We skipped to the end of the chain. Skip detection if there's the
|
||||
* terminator. (An allocated but empty backingStore) */
|
||||
|
Loading…
x
Reference in New Issue
Block a user