mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
vircgroup: add virCgroupGetCpuPeriodQuota()
Another vircgroup helper to avoid code repetition between the LXC and QEMU driver. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8c83c5e136
commit
0d8a377f79
@ -1693,6 +1693,7 @@ virCgroupGetCpuacctStat;
|
||||
virCgroupGetCpuacctUsage;
|
||||
virCgroupGetCpuCfsPeriod;
|
||||
virCgroupGetCpuCfsQuota;
|
||||
virCgroupGetCpuPeriodQuota;
|
||||
virCgroupGetCpusetCpus;
|
||||
virCgroupGetCpusetMemoryMigrate;
|
||||
virCgroupGetCpusetMems;
|
||||
|
@ -1783,13 +1783,7 @@ static int
|
||||
lxcGetVcpuBWLive(virCgroupPtr cgroup, unsigned long long *period,
|
||||
long long *quota)
|
||||
{
|
||||
if (virCgroupGetCpuCfsPeriod(cgroup, period) < 0)
|
||||
return -1;
|
||||
|
||||
if (virCgroupGetCpuCfsQuota(cgroup, quota) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
return virCgroupGetCpuPeriodQuota(cgroup, period, quota);
|
||||
}
|
||||
|
||||
|
||||
|
@ -10532,13 +10532,7 @@ static int
|
||||
qemuGetVcpuBWLive(virCgroupPtr cgroup, unsigned long long *period,
|
||||
long long *quota)
|
||||
{
|
||||
if (virCgroupGetCpuCfsPeriod(cgroup, period) < 0)
|
||||
return -1;
|
||||
|
||||
if (virCgroupGetCpuCfsQuota(cgroup, quota) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
return virCgroupGetCpuPeriodQuota(cgroup, period, quota);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -3739,3 +3739,17 @@ virCgroupSetupCpuPeriodQuota(virCgroupPtr cgroup,
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
virCgroupGetCpuPeriodQuota(virCgroupPtr cgroup, unsigned long long *period,
|
||||
long long *quota)
|
||||
{
|
||||
if (virCgroupGetCpuCfsPeriod(cgroup, period) < 0)
|
||||
return -1;
|
||||
|
||||
if (virCgroupGetCpuCfsQuota(cgroup, quota) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -227,6 +227,8 @@ int virCgroupSetupCpuShares(virCgroupPtr cgroup, unsigned long long shares,
|
||||
|
||||
int virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_period);
|
||||
int virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_period);
|
||||
int virCgroupGetCpuPeriodQuota(virCgroupPtr cgroup, unsigned long long *period,
|
||||
long long *quota);
|
||||
int virCgroupSetupCpuPeriodQuota(virCgroupPtr cgroup, unsigned long long period,
|
||||
long long quota);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user