diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index a382d30098aad1318f2a57957a4e8fad2e49b8f2..bb67cd1e0ebe9e01dbe9d09a63d3d85fadefd38a 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -365,11 +365,11 @@ "auto", defaults to "static" if cpuset is specified, "auto" indicates the domain process will be pinned to the advisory nodeset from querying numad, and the value of attribute - cpuset will be overridden by the advisory nodeset - from numad if it's specified. If both cpuset and - placement are not specified, or if placement - is "static", but no cpuset is specified, the domain - process will be pinned to all the available physical CPUs. + cpuset will be ignored if it's specified. If both + cpuset and placement are not specified, + or if placement is "static", but no cpuset + is specified, the domain process will be pinned to all the + available physical CPUs. diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a9c5cbce21ac01df51ad45c69c97f94dd198e564..b28ae5cae2c5eb55b37a0a692edcf3ae751eb198 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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); if (tmp) { if ((def->placement_mode = @@ -7913,6 +7900,21 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps, 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. */ if (virXPathULong("string(./cputune/shares[1])", ctxt, &def->cputune.shares) < 0)