From 135c56e2b876e4cdf8d96de85b32bea3f10d81ce Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 26 Apr 2017 09:01:30 +0200 Subject: [PATCH] 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 --- src/qemu/qemu_driver.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e39de625db..1ba3e0943e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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)