From: Osier Yang Date: Fri, 12 Oct 2012 14:44:35 +0000 (+0800) Subject: conf: Ignore emulatorpin if vcpu placement is auto X-Git-Tag: v1.0.0-rc1~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5378effd57591f9215fb5fc27efc6c32dae2b634;p=thirdparty%2Flibvirt.git conf: Ignore emulatorpin if vcpu placement is auto When vcpu placement is "auto", the domain process will be pinned to advisory nodeset from querying numad, While emulatorpin will override the pinning. That means both of them are to set the pinning policy for domain process, but conflicts with each other. This patch ingore emulatorpin if vcpu placement is "auto", because placement can't be simply ignored for placement could default to it. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e90bcc011f..cb80f09cc1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8880,19 +8880,27 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, goto error; } + /* Ignore emulatorpin if placement is "auto", they + * conflicts with each other, and placement can't be + * simply ignored, as 's placement defaults to it. + */ if (n) { - if (n > 1) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("only one emulatorpin is supported")); - VIR_FREE(nodes); - goto error; - } + if (def->placement_mode != VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) { + if (n > 1) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("only one emulatorpin is supported")); + VIR_FREE(nodes); + goto error; + } - def->cputune.emulatorpin = virDomainVcpuPinDefParseXML(nodes[0], ctxt, - def->maxvcpus, 1); + def->cputune.emulatorpin = virDomainVcpuPinDefParseXML(nodes[0], ctxt, + def->maxvcpus, 1); - if (!def->cputune.emulatorpin) - goto error; + if (!def->cputune.emulatorpin) + goto error; + } else { + VIR_WARN("Ignore emulatorpin for placement is 'auto'"); + } } VIR_FREE(nodes);