diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 1ab6351df2..7ea69fbb5a 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -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, diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 96f6c4b4c1..e90530284c 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -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;