]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-aa-helper: Use proper check for empty disk in 'get_files'
authorPeter Krempa <pkrempa@redhat.com>
Fri, 22 Jan 2021 16:10:44 +0000 (17:10 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Jan 2021 06:49:57 +0000 (07:49 +0100)
'virDomainDiskGetSource' returns src->path effectively. Checking whether
a disk is empty is done via 'virStorageSourceIsEmpty'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/security/virt-aa-helper.c

index f71fe6f23bb365a17c7f1cb2c85f2fc4222fc955..d3abe37a8ccc8d1e31eb2e4d398056c89568c025 100644 (file)
@@ -933,7 +933,7 @@ get_files(vahControl * ctl)
     for (i = 0; i < ctl->def->ndisks; i++) {
         virDomainDiskDefPtr disk = ctl->def->disks[i];
 
-        if (!virDomainDiskGetSource(disk))
+        if (virStorageSourceIsEmpty(disk->src))
             continue;
         /* 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.