]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Split out logic to determine whether cpupin was provided
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 Jan 2016 18:39:02 +0000 (19:39 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 3 Feb 2016 12:10:04 +0000 (13:10 +0100)
src/conf/domain_conf.c

index ead76a1d710a6a2d81177c36390077e533726f11..6aef3f852801346768397f14198afb7adfb487cf 100644 (file)
@@ -1413,6 +1413,19 @@ virDomainDefGetVcpu(virDomainDefPtr def,
 }
 
 
+/**
+ * virDomainDefHasVcpuPin:
+ * @def: domain definition
+ *
+ * This helper returns true if any of the domain's vcpus has cpu pinning set
+ */
+static bool
+virDomainDefHasVcpuPin(const virDomainDef *def)
+{
+    return !!def->cputune.vcpupin;
+}
+
+
 virDomainDiskDefPtr
 virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt)
 {
@@ -15347,7 +15360,7 @@ virDomainDefParseXML(xmlDocPtr xml,
         goto error;
 
     if (virDomainNumatuneHasPlacementAuto(def->numa) &&
-        !def->cpumask && !def->cputune.vcpupin &&
+        !def->cpumask && !virDomainDefHasVcpuPin(def) &&
         !def->cputune.emulatorpin &&
         !virDomainIOThreadIDArrayHasPin(def))
         def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO;