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:
Osier Yang 2011-03-29 21:42:54 +08:00
parent 1cc4d0259c
commit e98eb7f4a5
2 changed files with 12 additions and 0 deletions

View File

@ -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);
if (rc != 0) {
virReportSystemError(-rc,

View File

@ -2292,6 +2292,8 @@ static int lxcSetSchedulerParameters(virDomainPtr domain,
params[i].value.ul);
goto cleanup;
}
vm->def->cputune.shares = params[i].value.ul;
}
ret = 0;