From 9fbb810cf44e319c91ac04fff8beee1f8a9936f1 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Wed, 21 Apr 2010 09:39:49 +0200 Subject: [PATCH] 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. --- src/qemu/qemu_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 && -- 2.47.2