[PATCH v2 3/3] security: Drop virSecurityManagerSetHugepages

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

 



Since its introduction in 2012 this internal API did nothing.
Moreover we have the same API that does exactly the same:
virSecurityManagerDomainSetPathLabel.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/libvirt_private.syms        |  1 -
 src/qemu/qemu_process.c         |  4 ++--
 src/security/security_driver.h  |  1 -
 src/security/security_manager.c | 17 -----------------
 src/security/security_manager.h |  3 ---
 src/security/security_stack.c   | 19 -------------------
 6 files changed, 2 insertions(+), 43 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 7cc7bf8..04c18bf 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1164,7 +1164,6 @@ virSecurityManagerSetChildProcessLabel;
 virSecurityManagerSetDaemonSocketLabel;
 virSecurityManagerSetDiskLabel;
 virSecurityManagerSetHostdevLabel;
-virSecurityManagerSetHugepages;
 virSecurityManagerSetImageFDLabel;
 virSecurityManagerSetImageLabel;
 virSecurityManagerSetProcessLabel;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5e179b9..47e1fe2 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3247,8 +3247,8 @@ qemuProcessBuildDestroydHugepagesPath(virQEMUDriverPtr driver,
                     goto cleanup;
                 }
 
-                if (virSecurityManagerSetHugepages(driver->securityManager,
-                                                   vm->def, hugepagePath) < 0) {
+                if (virSecurityManagerDomainSetPathLabel(driver->securityManager,
+                                                         vm->def, hugepagePath) < 0) {
                     virReportError(VIR_ERR_INTERNAL_ERROR,
                                    "%s", _("Unable to set huge path in security driver"));
                     VIR_FREE(hugepagePath);
diff --git a/src/security/security_driver.h b/src/security/security_driver.h
index 7cb62f0..b48f2aa 100644
--- a/src/security/security_driver.h
+++ b/src/security/security_driver.h
@@ -168,7 +168,6 @@ struct _virSecurityDriver {
     virSecurityDomainSetTapFDLabel domainSetSecurityTapFDLabel;
 
     virSecurityDomainGetMountOptions domainGetSecurityMountOptions;
-    virSecurityDomainSetHugepages domainSetSecurityHugepages;
 
     virSecurityDriverGetBaseLabel getBaseLabel;
 
diff --git a/src/security/security_manager.c b/src/security/security_manager.c
index ecb4a40..f98c7d2 100644
--- a/src/security/security_manager.c
+++ b/src/security/security_manager.c
@@ -970,23 +970,6 @@ virSecurityManagerGetNested(virSecurityManagerPtr mgr)
 
 
 int
-virSecurityManagerSetHugepages(virSecurityManagerPtr mgr,
-                               virDomainDefPtr vm,
-                               const char *path)
-{
-    if (mgr->drv->domainSetSecurityHugepages) {
-        int ret;
-        virObjectLock(mgr);
-        ret = mgr->drv->domainSetSecurityHugepages(mgr, vm, path);
-        virObjectUnlock(mgr);
-        return ret;
-    }
-
-    return 0;
-}
-
-
-int
 virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr,
                                      virDomainDefPtr vm,
                                      const char *path)
diff --git a/src/security/security_manager.h b/src/security/security_manager.h
index 4cbc2d8..0d22cb1 100644
--- a/src/security/security_manager.h
+++ b/src/security/security_manager.h
@@ -149,9 +149,6 @@ int virSecurityManagerSetTapFDLabel(virSecurityManagerPtr mgr,
 char *virSecurityManagerGetMountOptions(virSecurityManagerPtr mgr,
                                         virDomainDefPtr vm);
 virSecurityManagerPtr* virSecurityManagerGetNested(virSecurityManagerPtr mgr);
-int virSecurityManagerSetHugepages(virSecurityManagerPtr mgr,
-                                   virDomainDefPtr sec,
-                                   const char *hugepages_path);
 
 int virSecurityManagerSetImageLabel(virSecurityManagerPtr mgr,
                                     virDomainDefPtr vm,
diff --git a/src/security/security_stack.c b/src/security/security_stack.c
index 3ea2751..c123931 100644
--- a/src/security/security_stack.c
+++ b/src/security/security_stack.c
@@ -511,23 +511,6 @@ virSecurityStackSetTapFDLabel(virSecurityManagerPtr mgr,
     return rc;
 }
 
-static int
-virSecurityStackSetHugepages(virSecurityManagerPtr mgr,
-                             virDomainDefPtr vm,
-                             const char *path)
-{
-    virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
-    virSecurityStackItemPtr item = priv->itemsHead;
-    int rc = 0;
-
-    for (; item; item = item->next) {
-        if (virSecurityManagerSetHugepages(item->securityManager, vm, path) < 0)
-            rc = -1;
-    }
-
-    return rc;
-}
-
 static char *
 virSecurityStackGetMountOptions(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
                                 virDomainDefPtr vm ATTRIBUTE_UNUSED)
@@ -663,8 +646,6 @@ virSecurityDriver virSecurityDriverStack = {
 
     .domainGetSecurityMountOptions      = virSecurityStackGetMountOptions,
 
-    .domainSetSecurityHugepages         = virSecurityStackSetHugepages,
-
     .getBaseLabel                       = virSecurityStackGetBaseLabel,
 
     .domainSetPathLabel                 = virSecurityStackDomainSetPathLabel,
-- 
2.8.4

--
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