]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
security: apparmor: Use only virStorageSource for disk paths
authorCole Robinson <crobinso@redhat.com>
Tue, 8 Oct 2019 16:04:57 +0000 (12:04 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 9 Oct 2019 18:17:16 +0000 (14:17 -0400)
This is closer to what security_selinux.c does, and will help add
support for qcow2 external data_files

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
src/security/virt-aa-helper.c

index 20281c38b76d27fe0c5f8df086638b2ddf2712d1..b675572144c0c509c37eaee79d514b95ccfe5fd4 100644 (file)
@@ -938,13 +938,13 @@ add_file_path(virStorageSourcePtr src,
 
 
 static int
-disk_add_files(virDomainDiskDefPtr disk,
-               virBufferPtr buf)
+storage_source_add_files(virStorageSourcePtr src,
+                         virBufferPtr buf)
 {
     size_t depth = 0;
     virStorageSourcePtr tmp;
 
-    for (tmp = disk->src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
+    for (tmp = src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
         if (add_file_path(tmp, depth, buf) < 0)
             return -1;
 
@@ -994,7 +994,7 @@ get_files(vahControl * ctl)
 
          /* XXX should handle open errors more careful than just ignoring them.
          */
-        if (disk_add_files(disk, &buf) < 0)
+        if (storage_source_add_files(disk->src, &buf) < 0)
             goto cleanup;
     }