[PATCHv2 1/9] rename qemuSetupCgroupVcpuBW to qemuSetupCgroupCpuBandwidth

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

 



This function sets cpu bandwidth, not only for vcpu. so rename it.
---
 src/qemu/qemu_cgroup.c |    9 +++++----
 src/qemu/qemu_cgroup.h |    6 +++---
 src/qemu/qemu_driver.c |    6 +++---
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index f8f375f..91dcedd 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -431,8 +431,9 @@ cleanup:
     return -1;
 }
 
-int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, unsigned long long period,
-                          long long quota)
+int qemuSetupCgroupCpuBandwidth(virCgroupPtr cgroup,
+                                unsigned long long period,
+                                long long quota)
 {
     int rc;
     unsigned long long old_period;
@@ -517,7 +518,7 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
                 vm_quota = quota * vm->def->vcpus;
             else
                 vm_quota = quota;
-            if (qemuSetupCgroupVcpuBW(cgroup, period, vm_quota) < 0)
+            if (qemuSetupCgroupCpuBandwidth(cgroup, period, vm_quota) < 0)
                 goto cleanup;
         }
     }
@@ -551,7 +552,7 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
 
         if (period || quota) {
             if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
-                if (qemuSetupCgroupVcpuBW(cgroup_vcpu, period, quota) < 0)
+                if (qemuSetupCgroupCpuBandwidth(cgroup_vcpu, period, quota) < 0)
                     goto cleanup;
             }
         }
diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h
index c1023b3..780b4a0 100644
--- a/src/qemu/qemu_cgroup.h
+++ b/src/qemu/qemu_cgroup.h
@@ -50,9 +50,9 @@ int qemuSetupHostUsbDeviceCgroup(usbDevice *dev,
 int qemuSetupCgroup(struct qemud_driver *driver,
                     virDomainObjPtr vm,
                     char *nodemask);
-int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
-                          unsigned long long period,
-                          long long quota);
+int qemuSetupCgroupCpuBandwidth(virCgroupPtr cgroup,
+                                unsigned long long period,
+                                long long quota);
 int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm);
 int qemuRemoveCgroup(struct qemud_driver *driver,
                      virDomainObjPtr vm,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2177c30..b0b7816 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7184,7 +7184,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
     if (((vm_quota != 0) && (vm_quota > old_quota)) ||
         ((period != 0) && (period < old_period)))
         /* Set cpu bandwidth for the vm */
-        if (qemuSetupCgroupVcpuBW(cgroup, period, vm_quota) < 0)
+        if (qemuSetupCgroupCpuBandwidth(cgroup, period, vm_quota) < 0)
             goto cleanup;
 
     /* If we does not know VCPU<->PID mapping or all vcpu runs in the same
@@ -7202,7 +7202,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
                 goto cleanup;
             }
 
-            if (qemuSetupCgroupVcpuBW(cgroup_vcpu, period, quota) < 0)
+            if (qemuSetupCgroupCpuBandwidth(cgroup_vcpu, period, quota) < 0)
                 goto cleanup;
 
             virCgroupFree(&cgroup_vcpu);
@@ -7212,7 +7212,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup,
     if (((vm_quota != 0) && (vm_quota <= old_quota)) ||
         ((period != 0) && (period >= old_period)))
         /* Set cpu bandwidth for the vm */
-        if (qemuSetupCgroupVcpuBW(cgroup, period, vm_quota) < 0)
+        if (qemuSetupCgroupCpuBandwidth(cgroup, period, vm_quota) < 0)
             goto cleanup;
 
     return 0;
-- 
1.7.4.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]