From cd49f058a0b346af0af90d50e046d4965bd48c44 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 22 Jan 2021 17:16:38 +0100 Subject: [PATCH] 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 Reviewed-by: Pavel Hrdina --- src/security/virt-aa-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index d3abe37a8c..d33bacde5d 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -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.