[PATCH v1 14/14] vircgroup: turn more cgroup functions static

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

 



The new functions virCgroupSetAndRetrieveCpuShares(),
virCgroupSetupCpuPeriodQuota() and virCgroupGetCpuPeriodQuota()
centralized all callers of {get/set}Cpu{Shares,CfsPeriod,CfsQuota}
to be inside vircgroup.c.

Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---
 src/libvirt_private.syms |  5 -----
 src/util/vircgroup.c     | 20 ++++++++++----------
 src/util/vircgroup.h     |  7 -------
 3 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 1ec73a13c2..eff741fe23 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1678,8 +1678,6 @@ virCgroupGetBlkioWeight;
 virCgroupGetCpuacctPercpuUsage;
 virCgroupGetCpuacctStat;
 virCgroupGetCpuacctUsage;
-virCgroupGetCpuCfsPeriod;
-virCgroupGetCpuCfsQuota;
 virCgroupGetCpuPeriodQuota;
 virCgroupGetCpusetCpus;
 virCgroupGetCpusetMemoryMigrate;
@@ -1710,11 +1708,8 @@ virCgroupNewThread;
 virCgroupPathOfController;
 virCgroupRemove;
 virCgroupSetAndRetrieveCpuShares;
-virCgroupSetCpuCfsPeriod;
-virCgroupSetCpuCfsQuota;
 virCgroupSetCpusetMemoryMigrate;
 virCgroupSetCpusetMems;
-virCgroupSetCpuShares;
 virCgroupSetFreezerState;
 virCgroupSetMemory;
 virCgroupSetMemoryLimitParameters;
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index f0103d8062..c39f7b1957 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -2249,7 +2249,7 @@ virCgroupGetDomainTotalCpuStats(virCgroupPtr group,
 }
 
 
-int
+static int
 virCgroupSetCpuShares(virCgroupPtr group, unsigned long long shares)
 {
     VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_CPU,
@@ -2273,7 +2273,7 @@ virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares)
  *
  * Returns: 0 on success
  */
-int
+static int
 virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_period)
 {
     VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_CPU,
@@ -2289,7 +2289,7 @@ virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_period)
  *
  * Returns: 0 on success
  */
-int
+static int
 virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_period)
 {
     VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_CPU,
@@ -2306,7 +2306,7 @@ virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_period)
  *
  * Returns: 0 on success
  */
-int
+static int
 virCgroupSetCpuCfsQuota(virCgroupPtr group, long long cfs_quota)
 {
     VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_CPU,
@@ -2660,7 +2660,7 @@ virCgroupKillPainfully(virCgroupPtr group)
  *
  * Returns: 0 on success
  */
-int
+static int
 virCgroupGetCpuCfsQuota(virCgroupPtr group, long long *cfs_quota)
 {
     VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_CPU,
@@ -3326,7 +3326,7 @@ virCgroupDenyDevicePath(virCgroupPtr group G_GNUC_UNUSED,
 }
 
 
-int
+static int
 virCgroupSetCpuShares(virCgroupPtr group G_GNUC_UNUSED,
                       unsigned long long shares G_GNUC_UNUSED)
 {
@@ -3346,7 +3346,7 @@ virCgroupGetCpuShares(virCgroupPtr group G_GNUC_UNUSED,
 }
 
 
-int
+static int
 virCgroupSetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED,
                          unsigned long long cfs_period G_GNUC_UNUSED)
 {
@@ -3356,7 +3356,7 @@ virCgroupSetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED,
 }
 
 
-int
+static int
 virCgroupGetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED,
                          unsigned long long *cfs_period G_GNUC_UNUSED)
 {
@@ -3366,7 +3366,7 @@ virCgroupGetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED,
 }
 
 
-int
+static int
 virCgroupSetCpuCfsQuota(virCgroupPtr group G_GNUC_UNUSED,
                         long long cfs_quota G_GNUC_UNUSED)
 {
@@ -3404,7 +3404,7 @@ virCgroupKillPainfully(virCgroupPtr group G_GNUC_UNUSED)
 }
 
 
-int
+static int
 virCgroupGetCpuCfsQuota(virCgroupPtr group G_GNUC_UNUSED,
                         long long *cfs_quota G_GNUC_UNUSED)
 {
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index 1607e951b1..1a47c234de 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -197,15 +197,8 @@ virCgroupGetDomainTotalCpuStats(virCgroupPtr group,
                                 virTypedParameterPtr params,
                                 int nparams);
 
-int virCgroupSetCpuShares(virCgroupPtr group, unsigned long long shares);
 int virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares);
 
-int virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_period);
-int virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_period);
-
-int virCgroupSetCpuCfsQuota(virCgroupPtr group, long long cfs_quota);
-int virCgroupGetCpuCfsQuota(virCgroupPtr group, long long *cfs_quota);
-
 int virCgroupGetCpuacctUsage(virCgroupPtr group, unsigned long long *usage);
 int virCgroupGetCpuacctPercpuUsage(virCgroupPtr group, char **usage);
 int virCgroupGetCpuacctStat(virCgroupPtr group, unsigned long long *user,
-- 
2.24.1






[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