[PATCH 06/12] virt-aa-helper: Use proper check for empty disk in 'get_files'

Peter Krempa pkrempa at redhat.com
Mon Jan 25 16:05:18 UTC 2021


'virDomainDiskGetSource' returns src->path effectively. Checking whether
a disk is empty is done via 'virStorageSourceIsEmpty'.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 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 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.
-- 
2.29.2




More information about the libvir-list mailing list