[libvirt] [PATCH] qemu: Fix starting domains with no cpu cgroup
Daniel Veillard
veillard at redhat.com
Wed Aug 29 13:51:58 UTC 2012
On Wed, Aug 29, 2012 at 03:42:57PM +0200, Jiri Denemark wrote:
> If cgroups are enabled in general but cpu cgroup is disabled in
> qemu.conf or not mounted at all, libvirt would refuse to start any
> domain even though scheduler parameters are not set in domain XML.
>
> This patch makes cpu cgroup mandatory only for domains that actually
> want to use it.
> ---
> src/qemu/qemu_cgroup.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
> index be1b96d..df67ff3 100644
> --- a/src/qemu/qemu_cgroup.c
> +++ b/src/qemu/qemu_cgroup.c
> @@ -549,7 +549,8 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
> if (driver->cgroup == NULL)
> return 0; /* Not supported, so claim success */
>
> - if (!qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
> + if ((period || quota) &&
> + !qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
> virReportError(VIR_ERR_SYSTEM_ERROR, "%s",
> _("cgroup cpu is not active"));
> return -1;
ACK, please push :-)
thanks !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list