mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemuDomainGetStorageSourceByDevstr: Look also in 'mirror' chain
A disk can have a mirror, look also in its backing chain. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
41c6939660
commit
5c52c186fd
@ -11669,11 +11669,16 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr,
|
||||
}
|
||||
|
||||
if (idx == 0)
|
||||
src = disk->src;
|
||||
else
|
||||
src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);
|
||||
return disk->src;
|
||||
|
||||
return src;
|
||||
if ((src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL)))
|
||||
return src;
|
||||
|
||||
if (disk->mirror &&
|
||||
(src = virStorageFileChainLookup(disk->mirror, NULL, NULL, idx, NULL)))
|
||||
return src;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user