From 739c64c914deae4be776f255540187793a3dc1de Mon Sep 17 00:00:00 2001 Message-Id: <739c64c914deae4be776f255540187793a3dc1de@dist-git> From: Martin Kletzander Date: Thu, 13 Aug 2015 15:11:48 +0200 Subject: [PATCH] qemu: Use numad information when getting pin information Pinning information returned for emulatorpin and vcpupin calls is being returned from our data without querying cgroups for some time. However, not all the data were utilized. When automatic placement is used the information is not returned for the calls mentioned above. Since the numad hint in private data is properly saved/restored, we can safely use it to return true information. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1162947 Signed-off-by: Martin Kletzander (cherry picked from commit 776924e37649f2d47acd805746d5fd9325212ea5) Signed-off-by: Martin Kletzander Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 48857ce..748f16a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5244,6 +5244,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, int ret = -1; int hostcpus, vcpu; virBitmapPtr allcpumap = NULL; + qemuDomainObjPrivatePtr priv = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -5264,6 +5265,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, goto cleanup; virBitmapSetAll(allcpumap); + priv = vm->privateData; /* Clamp to actual number of vcpus */ if (ncpumaps > def->vcpus) @@ -5282,6 +5284,9 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, if (pininfo && pininfo->cpumask) bitmap = pininfo->cpumask; + else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO && + priv->autoCpuset) + bitmap = priv->autoCpuset; else bitmap = allcpumap; @@ -5432,6 +5437,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, int hostcpus; virBitmapPtr cpumask = NULL; virBitmapPtr bitmap = NULL; + qemuDomainObjPrivatePtr priv = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -5448,10 +5454,15 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, if ((hostcpus = nodeGetCPUCount(NULL)) < 0) goto cleanup; + priv = vm->privateData; + if (def->cputune.emulatorpin) { cpumask = def->cputune.emulatorpin; } else if (def->cpumask) { cpumask = def->cpumask; + } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO && + priv->autoCpuset) { + cpumask = priv->autoCpuset; } else { if (!(bitmap = virBitmapNew(hostcpus))) goto cleanup; -- 2.5.0