提交 006a532c 编写于 作者: P Peter Krempa

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
上级 552892c5
...@@ -5317,11 +5317,12 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, ...@@ -5317,11 +5317,12 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainDefPtr def; virDomainDefPtr def;
bool live;
int ret = -1; int ret = -1;
int hostcpus; int hostcpus;
virBitmapPtr cpumask = NULL; virBitmapPtr cpumask = NULL;
virBitmapPtr bitmap = NULL; virBitmapPtr bitmap = NULL;
qemuDomainObjPrivatePtr priv = NULL; virBitmapPtr autoCpuset = NULL;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1); VIR_DOMAIN_AFFECT_CONFIG, -1);
...@@ -5332,21 +5333,22 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, ...@@ -5332,21 +5333,22 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
if (virDomainGetEmulatorPinInfoEnsureACL(dom->conn, vm->def) < 0) if (virDomainGetEmulatorPinInfoEnsureACL(dom->conn, vm->def) < 0)
goto cleanup; goto cleanup;
if (!(def = virDomainObjGetOneDef(vm, flags))) if (!(def = virDomainObjGetOneDefState(vm, flags, &live)))
goto cleanup; goto cleanup;
if ((hostcpus = virHostCPUGetCount()) < 0) if ((hostcpus = virHostCPUGetCount()) < 0)
goto cleanup; goto cleanup;
priv = vm->privateData; if (live)
autoCpuset = QEMU_DOMAIN_PRIVATE(vm)->autoCpuset;
if (def->cputune.emulatorpin) { if (def->cputune.emulatorpin) {
cpumask = def->cputune.emulatorpin; cpumask = def->cputune.emulatorpin;
} else if (def->cpumask) { } else if (def->cpumask) {
cpumask = def->cpumask; cpumask = def->cpumask;
} else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO && } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
priv->autoCpuset) { autoCpuset) {
cpumask = priv->autoCpuset; cpumask = autoCpuset;
} else { } else {
if (!(bitmap = virBitmapNew(hostcpus))) if (!(bitmap = virBitmapNew(hostcpus)))
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册