mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
qemu: domain: Properly lookup top of chain in qemuDomainGetStorageSourceByDevstr
When idx is 0 virStorageFileChainLookup returns the base (bottom) of the backing chain rather than the top. This is expected by the callers of qemuDomainGetStorageSourceByDevstr. Add a special case for idx == 0
This commit is contained in:
parent
e9f9690958
commit
20ee78bf9b
@ -8605,7 +8605,10 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);
|
||||
if (idx == 0)
|
||||
src = disk->src;
|
||||
else
|
||||
src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(target);
|
||||
|
Loading…
x
Reference in New Issue
Block a user