qemuDomainGetStorageSourceByDevstr: Lookup also '<dataStore>'

The <dataStore> volumes have their own 'id' so we need to be able to
look them up for the given image chain.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Peter Krempa 2024-11-26 15:59:43 +01:00
parent 515ed143ec
commit 976300fdf4

View File

@ -9260,12 +9260,18 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr,
for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) {
if (n->id == idx)
return n;
if (n->dataFileStore && n->dataFileStore->id == idx)
return n->dataFileStore;
}
if (disk->mirror) {
for (n = disk->mirror; virStorageSourceIsBacking(n); n = n->backingStore) {
if (n->id == idx)
return n;
if (n->dataFileStore && n->dataFileStore->id == idx)
return n->dataFileStore;
}
}
@ -9281,6 +9287,9 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr,
for (n = backupdisk->store; virStorageSourceIsBacking(n); n = n->backingStore) {
if (n->id == idx)
return n;
if (n->dataFileStore && n->dataFileStore->id == idx)
return n->dataFileStore;
}
}
}