<vcpupin vcpu="1" cpuset="0,1"/>
<vcpupin vcpu="2" cpuset="2,3"/>
<vcpupin vcpu="3" cpuset="0,4"/>
+ <emulatorpin cpuset="1-3"/%gt;
<shares>2048</shares>
<period>1000000</period>
<quota>-1</quota>
of element <code>vcpu</code>. (NB: Only qemu driver support)
<span class="since">Since 0.9.0</span>
</dd>
+ <dt><code>emulatorpin</code></dt>
+ <dd>
+ The optional <code>emulatorpin</code> element specifies which of host
+ physical CPUs the "emulator", a subset of a domain not including vcpu,
+ will be pinned to. If this is ommitted, "emulator" is pinned to all
+ the physical CPUs by default. It contains one required attribute
+ <code>cpuset</code> specifying which physical CPUs to pin to.
+ </dd>
<dt><code>shares</code></dt>
<dd>
The optional <code>shares</code> element specifies the proportional
}
VIR_FREE(nodes);
+ if ((n = virXPathNodeSet("./cputune/emulatorpin", ctxt, &nodes)) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot extract emulatorpin nodes"));
+ goto error;
+ }
+
+ if (n) {
+ if (n > 1) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("only one emulatorpin is supported"));
+ VIR_FREE(nodes);
+ goto error;
+ }
+
+ if (VIR_ALLOC(def->cputune.emulatorpin) < 0) {
+ goto no_memory;
+ }
+
+ virDomainVcpuPinDefPtr emulatorpin = NULL;
+ emulatorpin = virDomainVcpuPinDefParseXML(nodes[0], ctxt,
+ def->maxvcpus, 1);
+
+ if (!emulatorpin)
+ goto error;
+
+ def->cputune.emulatorpin = emulatorpin;
+ }
+ VIR_FREE(nodes);
+
/* Extract numatune if exists. */
if ((n = virXPathNodeSet("./numatune", ctxt, &nodes)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
virBufferAsprintf(buf, ">%u</vcpu>\n", def->maxvcpus);
if (def->cputune.shares || def->cputune.vcpupin ||
- def->cputune.period || def->cputune.quota)
+ def->cputune.period || def->cputune.quota ||
+ def->cputune.emulatorpin)
virBufferAddLit(buf, " <cputune>\n");
if (def->cputune.shares)
}
}
+ if (def->cputune.emulatorpin) {
+ virBufferAsprintf(buf, " <emulatorpin ");
+
+ char *cpumask = NULL;
+ cpumask = virDomainCpuSetFormat(def->cputune.emulatorpin->cpumask,
+ VIR_DOMAIN_CPUMASK_LEN);
+ if (cpumask == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("failed to format cpuset for emulator"));
+ goto cleanup;
+ }
+
+ virBufferAsprintf(buf, "cpuset='%s'/>\n", cpumask);
+ VIR_FREE(cpumask);
+ }
+
if (def->cputune.shares || def->cputune.vcpupin ||
- def->cputune.period || def->cputune.quota)
+ def->cputune.period || def->cputune.quota ||
+ def->cputune.emulatorpin)
virBufferAddLit(buf, " </cputune>\n");
if (def->numatune.memory.nodemask ||