diff mbox series

[6/7] security: apparmor: Use only virStorageSource for disk paths

Message ID bc812b48f41ba3b3afaefae15084ad7634ad328e.1570551720.git.crobinso@redhat.com
State Accepted
Commit b2b003db742a9013176acb04581a08b2876673f2
Headers show
Series security: apparmor: prep for qcow2 data_file | expand

Commit Message

Cole Robinson Oct. 8, 2019, 4:22 p.m. UTC
This is closer to what security_selinux.c does, and will help add
support for qcow2 external data_files

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 src/security/virt-aa-helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox series

Patch

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 20281c38b7..b675572144 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -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;
     }