]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-aa-helper: Don't probe image metadata for terminated chains
authorPeter Krempa <pkrempa@redhat.com>
Fri, 22 Jan 2021 16:16:38 +0000 (17:16 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Jan 2021 06:49:57 +0000 (07:49 +0100)
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>
src/security/virt-aa-helper.c

index d3abe37a8ccc8d1e31eb2e4d398056c89568c025..d33bacde5d9c46d9c75207e0bd8cd28024873aa7 100644 (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.