]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix initial VCPU pinning in qemu driver
authorJiri Denemark <jdenemar@redhat.com>
Wed, 21 Apr 2010 07:39:49 +0000 (09:39 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 22 Apr 2010 07:30:34 +0000 (09:30 +0200)
First, inital VCPU pinning is set correctly but then it is reset by
assigning qemu process to a new cgroup (which contains all CPUs). It's
easily fixed by swapping these two actions.

src/qemu/qemu_driver.c

index 5f4adfd956846f92072b0123cc8cc06a2ef4ed06..89cd291d3d7d86a0d8d61902bfb5213da9e2b1dd 100644 (file)
@@ -3081,10 +3081,12 @@ static int qemudSecurityHook(void *data) {
     /* This must take place before exec(), so that all QEMU
      * memory allocation is on the correct NUMA node
      */
-    if (qemudInitCpuAffinity(h->vm) < 0)
+    if (qemuAddToCgroup(h->driver, h->vm->def) < 0)
         return -1;
 
-    if (qemuAddToCgroup(h->driver, h->vm->def) < 0)
+    /* This must be done after cgroup placement to avoid resetting CPU
+     * affinity */
+    if (qemudInitCpuAffinity(h->vm) < 0)
         return -1;
 
     if (h->driver->securityDriver &&