[PATCH 04/10] security: Drop virSecurity(DAC|SELinux)SetImageLabelRelative()

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

 



The single caller for each function passes the same value
for @src and @parent, which means that we don't really need
the additional API.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/security/security_dac.c     | 19 +++++--------------
 src/security/security_selinux.c | 19 +++++--------------
 2 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 9c24a1c4a8..567be4bd23 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -939,12 +939,12 @@ virSecurityDACSetImageLabelInternal(virSecurityManager *mgr,
 
 
 static int
-virSecurityDACSetImageLabelRelative(virSecurityManager *mgr,
-                                    virDomainDef *def,
-                                    virStorageSource *src,
-                                    virStorageSource *parent,
-                                    virSecurityDomainImageLabelFlags flags)
+virSecurityDACSetImageLabel(virSecurityManager *mgr,
+                            virDomainDef *def,
+                            virStorageSource *src,
+                            virSecurityDomainImageLabelFlags flags)
 {
+    virStorageSource *parent = src;
     virStorageSource *n;
 
     for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
@@ -962,15 +962,6 @@ virSecurityDACSetImageLabelRelative(virSecurityManager *mgr,
     return 0;
 }
 
-static int
-virSecurityDACSetImageLabel(virSecurityManager *mgr,
-                            virDomainDef *def,
-                            virStorageSource *src,
-                            virSecurityDomainImageLabelFlags flags)
-{
-    return virSecurityDACSetImageLabelRelative(mgr, def, src, src, flags);
-}
-
 static int
 virSecurityDACRestoreImageLabelInt(virSecurityManager *mgr,
                                    virDomainDef *def,
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index d491435ae1..b49af26e49 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1980,12 +1980,12 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManager *mgr,
 
 
 static int
-virSecuritySELinuxSetImageLabelRelative(virSecurityManager *mgr,
-                                        virDomainDef *def,
-                                        virStorageSource *src,
-                                        virStorageSource *parent,
-                                        virSecurityDomainImageLabelFlags flags)
+virSecuritySELinuxSetImageLabel(virSecurityManager *mgr,
+                               virDomainDef *def,
+                               virStorageSource *src,
+                               virSecurityDomainImageLabelFlags flags)
 {
+    virStorageSource *parent = src;
     virStorageSource *n;
 
     for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
@@ -2004,15 +2004,6 @@ virSecuritySELinuxSetImageLabelRelative(virSecurityManager *mgr,
 }
 
 
-static int
-virSecuritySELinuxSetImageLabel(virSecurityManager *mgr,
-                                virDomainDef *def,
-                                virStorageSource *src,
-                                virSecurityDomainImageLabelFlags flags)
-{
-    return virSecuritySELinuxSetImageLabelRelative(mgr, def, src, src, flags);
-}
-
 struct virSecuritySELinuxMoveImageMetadataData {
     virSecurityManager *mgr;
     const char *src;
-- 
2.44.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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