mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00: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,6 +8605,9 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (idx == 0)
|
||||||
|
src = disk->src;
|
||||||
|
else
|
||||||
src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);
|
src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user