qemu: numa: Don't return automatic nodeset for inactive domain

qemuDomainGetNumaParameters would return the automatic nodeset even for
the persistent config if the domain was running. This is incorrect since
the automatic nodeset will be re-queried upon starting the vm.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1445325
This commit is contained in:
Peter Krempa 2017-04-26 09:01:30 +02:00
parent 1a4a4ffa3e
commit 135c56e2b8

View File

@ -9461,6 +9461,8 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
char *nodeset = NULL;
int ret = -1;
virDomainDefPtr def = NULL;
bool live = false;
virBitmapPtr autoNodeset = NULL;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG |
@ -9473,9 +9475,12 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
if (virDomainGetNumaParametersEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (!(def = virDomainObjGetOneDef(vm, flags)))
if (!(def = virDomainObjGetOneDefState(vm, flags, &live)))
goto cleanup;
if (live)
autoNodeset = priv->autoNodeset;
if ((*nparams) == 0) {
*nparams = QEMU_NB_NUMA_PARAM;
ret = 0;
@ -9496,8 +9501,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
break;
case 1: /* fill numa nodeset here */
nodeset = virDomainNumatuneFormatNodeset(def->numa,
priv->autoNodeset, -1);
nodeset = virDomainNumatuneFormatNodeset(def->numa, autoNodeset, -1);
if (!nodeset ||
virTypedParameterAssign(param, VIR_DOMAIN_NUMA_NODESET,
VIR_TYPED_PARAM_STRING, nodeset) < 0)