From: Peter Krempa Date: Fri, 22 Jan 2021 16:10:44 +0000 (+0100) Subject: virt-aa-helper: Use proper check for empty disk in 'get_files' X-Git-Tag: v7.1.0-rc1~422 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=679c9377460f96ff760c25256702beb620208c32;p=thirdparty%2Flibvirt.git virt-aa-helper: Use proper check for empty disk in 'get_files' 'virDomainDiskGetSource' returns src->path effectively. Checking whether a disk is empty is done via 'virStorageSourceIsEmpty'. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index f71fe6f23b..d3abe37a8c 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -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.