mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cputune: Support cputune for lxc driver
LXC driver doesn't support vcpu affinity yet, so just need to modify it to support cpu shares.
This commit is contained in:
parent
1cc4d0259c
commit
e98eb7f4a5
@ -117,6 +117,16 @@ static int lxcSetContainerResources(virDomainDefPtr def)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (def->cputune.shares) {
|
||||||
|
rc = virCgroupSetCpuShares(cgroup, def->cputune.shares);
|
||||||
|
if (rc != 0) {
|
||||||
|
virReportSystemError(-rc,
|
||||||
|
_("Unable to set cpu shares for domain %s"),
|
||||||
|
def->name);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rc = virCgroupSetMemory(cgroup, def->mem.max_balloon);
|
rc = virCgroupSetMemory(cgroup, def->mem.max_balloon);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
virReportSystemError(-rc,
|
virReportSystemError(-rc,
|
||||||
|
@ -2292,6 +2292,8 @@ static int lxcSetSchedulerParameters(virDomainPtr domain,
|
|||||||
params[i].value.ul);
|
params[i].value.ul);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vm->def->cputune.shares = params[i].value.ul;
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user