mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 21:15:22 +00:00
numad: Ignore cpuset if placement is auto
As explained in previous patch, numad will balance the affinity
dynamically, so reflecting the cpuset from numad at the first
time doesn't make much case, and may just could cause confusion.
(cherry picked from commit 8fb2164cff
)
This commit is contained in:
parent
3f76415724
commit
455d222457
@ -365,11 +365,11 @@
|
|||||||
"auto", defaults to "static" if <code>cpuset</code> is specified,
|
"auto", defaults to "static" if <code>cpuset</code> is specified,
|
||||||
"auto" indicates the domain process will be pinned to the advisory
|
"auto" indicates the domain process will be pinned to the advisory
|
||||||
nodeset from querying numad, and the value of attribute
|
nodeset from querying numad, and the value of attribute
|
||||||
<code>cpuset</code> will be overridden by the advisory nodeset
|
<code>cpuset</code> will be ignored if it's specified. If both
|
||||||
from numad if it's specified. If both <code>cpuset</code> and
|
<code>cpuset</code> and <code>placement</code> are not specified,
|
||||||
<code>placement</code> are not specified, or if <code>placement</code>
|
or if <code>placement</code> is "static", but no <code>cpuset</code>
|
||||||
is "static", but no <code>cpuset</code> is specified, the domain
|
is specified, the domain process will be pinned to all the
|
||||||
process will be pinned to all the available physical CPUs.
|
available physical CPUs.
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
@ -7884,19 +7884,6 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = virXPathString("string(./vcpu[1]/@cpuset)", ctxt);
|
|
||||||
if (tmp) {
|
|
||||||
char *set = tmp;
|
|
||||||
def->cpumasklen = VIR_DOMAIN_CPUMASK_LEN;
|
|
||||||
if (VIR_ALLOC_N(def->cpumask, def->cpumasklen) < 0) {
|
|
||||||
goto no_memory;
|
|
||||||
}
|
|
||||||
if (virDomainCpuSetParse(set, 0, def->cpumask,
|
|
||||||
def->cpumasklen) < 0)
|
|
||||||
goto error;
|
|
||||||
VIR_FREE(tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = virXPathString("string(./vcpu[1]/@placement)", ctxt);
|
tmp = virXPathString("string(./vcpu[1]/@placement)", ctxt);
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
if ((def->placement_mode =
|
if ((def->placement_mode =
|
||||||
@ -7913,6 +7900,21 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
|
|||||||
def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
|
def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC) {
|
||||||
|
tmp = virXPathString("string(./vcpu[1]/@cpuset)", ctxt);
|
||||||
|
if (tmp) {
|
||||||
|
char *set = tmp;
|
||||||
|
def->cpumasklen = VIR_DOMAIN_CPUMASK_LEN;
|
||||||
|
if (VIR_ALLOC_N(def->cpumask, def->cpumasklen) < 0) {
|
||||||
|
goto no_memory;
|
||||||
|
}
|
||||||
|
if (virDomainCpuSetParse(set, 0, def->cpumask,
|
||||||
|
def->cpumasklen) < 0)
|
||||||
|
goto error;
|
||||||
|
VIR_FREE(tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Extract cpu tunables. */
|
/* Extract cpu tunables. */
|
||||||
if (virXPathULong("string(./cputune/shares[1])", ctxt,
|
if (virXPathULong("string(./cputune/shares[1])", ctxt,
|
||||||
&def->cputune.shares) < 0)
|
&def->cputune.shares) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user