]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Use numad information when getting pin information
authorMartin Kletzander <mkletzan@redhat.com>
Sun, 26 Jul 2015 16:49:02 +0000 (18:49 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 13 Aug 2015 13:06:06 +0000 (15:06 +0200)
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 <mkletzan@redhat.com>
src/qemu/qemu_driver.c

index 2e445009fbdd883d539d927a1a8a6574ab80bb7f..fa655b5a15badaf5f08fe9c7b874b865dc83fb85 100644 (file)
@@ -5229,6 +5229,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);
@@ -5249,6 +5250,7 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom,
         goto cleanup;
 
     virBitmapSetAll(allcpumap);
+    priv = vm->privateData;
 
     /* Clamp to actual number of vcpus */
     if (ncpumaps > def->vcpus)
@@ -5267,6 +5269,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;
 
@@ -5417,6 +5422,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);
@@ -5433,10 +5439,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;