[PATCH 23/30] security: dac: break out SetImageLabelRelative

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This will be used for recursing into externalDataStore

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/security/security_dac.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index befa388791..326b9b1a3c 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -934,15 +934,16 @@ virSecurityDACSetImageLabelInternal(virSecurityManagerPtr mgr,
 
 
 static int
-virSecurityDACSetImageLabel(virSecurityManagerPtr mgr,
-                            virDomainDefPtr def,
-                            virStorageSourcePtr src,
-                            virSecurityDomainImageLabelFlags flags)
+virSecurityDACSetImageLabelRelative(virSecurityManagerPtr mgr,
+                                    virDomainDefPtr def,
+                                    virStorageSourcePtr src,
+                                    virStorageSourcePtr parent,
+                                    virSecurityDomainImageLabelFlags flags)
 {
     virStorageSourcePtr n;
 
     for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
-        if (virSecurityDACSetImageLabelInternal(mgr, def, n, src) < 0)
+        if (virSecurityDACSetImageLabelInternal(mgr, def, n, parent) < 0)
             return -1;
 
         if (!(flags & VIR_SECURITY_DOMAIN_IMAGE_LABEL_BACKING_CHAIN))
@@ -952,6 +953,14 @@ virSecurityDACSetImageLabel(virSecurityManagerPtr mgr,
     return 0;
 }
 
+static int
+virSecurityDACSetImageLabel(virSecurityManagerPtr mgr,
+                            virDomainDefPtr def,
+                            virStorageSourcePtr src,
+                            virSecurityDomainImageLabelFlags flags)
+{
+    return virSecurityDACSetImageLabelRelative(mgr, def, src, src, flags);
+}
 
 static int
 virSecurityDACRestoreImageLabelSingle(virSecurityManagerPtr mgr,
-- 
2.23.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux