From: Jiri Denemark Date: Wed, 21 Apr 2010 07:39:49 +0000 (+0200) Subject: Fix initial VCPU pinning in qemu driver X-Git-Tag: v0.8.1~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fbb810cf44e319c91ac04fff8beee1f8a9936f1;p=thirdparty%2Flibvirt.git Fix initial VCPU pinning in qemu driver 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. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5f4adfd956..89cd291d3d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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 &&