]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: cgroup: Remove now unreachable check
authorPeter Krempa <pkrempa@redhat.com>
Wed, 11 Nov 2015 09:28:47 +0000 (10:28 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 9 Dec 2015 13:57:12 +0000 (14:57 +0100)
Since commit 0c04906fa the check for priv->cgroup doesn't make sense as
the calls to virCgroupHasController return the same information. Remove
it and move it's comment partially to the new check.

The already spurious check was also later copied to the iothreads code.

src/qemu/qemu_cgroup.c

index b52ce3ae5e580905bb8bad127e226146af8858fd..95a8e66e23060c473d5343ecf018fc52f8da7221 100644 (file)
@@ -1018,18 +1018,13 @@ qemuSetupCgroupForVcpu(virDomainObjPtr vm)
     /*
      * If CPU cgroup controller is not initialized here, then we need
      * neither period nor quota settings.  And if CPUSET controller is
-     * not initialized either, then there's nothing to do anyway.
+     * not initialized either, then there's nothing to do anyway. CPU pinning
+     * will be set via virProcessSetAffinity.
      */
     if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU) &&
         !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
         return 0;
 
-    /* We are trying to setup cgroups for CPU pinning, which can also be done
-     * with virProcessSetAffinity, thus the lack of cgroups is not fatal here.
-     */
-    if (priv->cgroup == NULL)
-        return 0;
-
     if (priv->nvcpupids == 0 || priv->vcpupids[0] == vm->pid) {
         /* If we don't know VCPU<->PID mapping or all vcpu runs in the same
          * thread, we cannot control each vcpu.
@@ -1129,9 +1124,6 @@ qemuSetupCgroupForEmulator(virDomainObjPtr vm)
         !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
         return 0;
 
-    if (priv->cgroup == NULL)
-        return 0; /* Not supported, so claim success */
-
     if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0,
                            true, &cgroup_emulator) < 0)
         goto cleanup;
@@ -1202,12 +1194,6 @@ qemuSetupCgroupForIOThreads(virDomainObjPtr vm)
         !virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
         return 0;
 
-    /* We are trying to setup cgroups for CPU pinning, which can also be done
-     * with virProcessSetAffinity, thus the lack of cgroups is not fatal here.
-     */
-    if (priv->cgroup == NULL)
-        return 0;
-
     if (virDomainNumatuneGetMode(vm->def->numa, -1, &mem_mode) == 0 &&
         mem_mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT &&
         virDomainNumatuneMaybeFormatNodeset(vm->def->numa,