From: Peter Krempa Date: Mon, 4 Jan 2016 18:39:02 +0000 (+0100) Subject: conf: Split out logic to determine whether cpupin was provided X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=598927a5bce5c47827f4d02b4596a564e7f8b28f;p=libvirt.git conf: Split out logic to determine whether cpupin was provided --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ead76a1d71..6aef3f8528 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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;