virt-aa-helper: Don't probe image metadata for terminated chains

A terminated chain has a virStorageSource with type ==
VIR_STORAGE_TYPE_NONE at the end. Since virStorageSourceHasBacking
is explicitly returning false in that case we'd probe the chain
needlessly. Just check whether src->backingStore is non-NULL.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa 2021-01-22 17:16:38 +01:00
parent 679c937746
commit cd49f058a0

View File

@ -938,7 +938,7 @@ get_files(vahControl * ctl)
/* XXX - if we knew the qemu user:group here we could send it in
* so that the open could be re-tried as that user:group.
*/
if (!virStorageSourceHasBacking(disk->src))
if (!disk->src->backingStore)
virStorageSourceGetMetadata(disk->src, -1, -1, false);
/* XXX should handle open errors more careful than just ignoring them.