From: Peter Krempa Date: Wed, 14 Sep 2016 05:37:16 +0000 (+0200) Subject: qemu: driver: Don't return automatic NUMA emulator pinning data for persistentDef X-Git-Tag: v2.3.0-rc1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=006a532cc082baa28191d66d378e7e946b787e85;p=thirdparty%2Flibvirt.git qemu: driver: Don't return automatic NUMA emulator pinning data for persistentDef Calling virDomainGetEmulatorPinInfo on a live VM with automatic NUMA pinning and VIR_DOMAIN_AFFECT_CONFIG would return the automatic pinning data in some cases which is bogus. Use the autoCpuset property only when called on a live definition. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1365779 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f8fc47d379..71eb062fbe 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5317,11 +5317,12 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, { virDomainObjPtr vm = NULL; virDomainDefPtr def; + bool live; int ret = -1; int hostcpus; virBitmapPtr cpumask = NULL; virBitmapPtr bitmap = NULL; - qemuDomainObjPrivatePtr priv = NULL; + virBitmapPtr autoCpuset = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -5332,21 +5333,22 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, if (virDomainGetEmulatorPinInfoEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (!(def = virDomainObjGetOneDef(vm, flags))) + if (!(def = virDomainObjGetOneDefState(vm, flags, &live))) goto cleanup; if ((hostcpus = virHostCPUGetCount()) < 0) goto cleanup; - priv = vm->privateData; + if (live) + autoCpuset = QEMU_DOMAIN_PRIVATE(vm)->autoCpuset; if (def->cputune.emulatorpin) { cpumask = def->cputune.emulatorpin; } else if (def->cpumask) { cpumask = def->cpumask; } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO && - priv->autoCpuset) { - cpumask = priv->autoCpuset; + autoCpuset) { + cpumask = autoCpuset; } else { if (!(bitmap = virBitmapNew(hostcpus))) goto cleanup;