]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix starting domains with no cpu cgroup
authorJiri Denemark <jdenemar@redhat.com>
Wed, 29 Aug 2012 13:30:34 +0000 (15:30 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 29 Aug 2012 14:13:38 +0000 (16:13 +0200)
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

index be1b96d71478f3e90aad970bfba9df0d9bca0580..df67ff306ef180d3a4143eba712880e944411c50 100644 (file)
@@ -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;