A disk can have a mirror, look also in it's backing chain.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 18fd445e30..ebf18a546e 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11553,11 +11553,16 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr,
}
if (idx == 0)
- src = disk->src;
- else
- src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);
+ return disk->src;
+
+ if ((src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL)))
+ return src;
- return src;
+ if (disk->mirror &&
+ (src = virStorageFileChainLookup(disk->mirror, NULL, NULL, idx, NULL)))
+ return src;
+
+ return NULL;
}
--
2.26.2