mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
qemu: Drop cleanup label from qemuProcessInitCpuAffinity()
We're using VIR_AUTOPTR() for everything now, plus the cleanup section was not doing anything useful anyway. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2f2254c7f4
commit
de563ebcf9
@ -2463,7 +2463,6 @@ qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet)
|
|||||||
static int
|
static int
|
||||||
qemuProcessInitCpuAffinity(virDomainObjPtr vm)
|
qemuProcessInitCpuAffinity(virDomainObjPtr vm)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
VIR_AUTOPTR(virBitmap) cpumapToSet = NULL;
|
VIR_AUTOPTR(virBitmap) cpumapToSet = NULL;
|
||||||
virDomainNumatuneMemMode mem_mode;
|
virDomainNumatuneMemMode mem_mode;
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
@ -2494,25 +2493,24 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm)
|
|||||||
priv->autoNodeset,
|
priv->autoNodeset,
|
||||||
&nodeset,
|
&nodeset,
|
||||||
-1) < 0)
|
-1) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
|
if (virNumaNodesetToCPUset(nodeset, &cpumapToSet) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
} else if (vm->def->cputune.emulatorpin) {
|
} else if (vm->def->cputune.emulatorpin) {
|
||||||
if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
|
if (virBitmapCopy(cpumapToSet, vm->def->cputune.emulatorpin) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
|
if (qemuProcessGetAllCpuAffinity(&cpumapToSet) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cpumapToSet &&
|
if (cpumapToSet &&
|
||||||
virProcessSetAffinity(vm->pid, cpumapToSet) < 0)
|
virProcessSetAffinity(vm->pid, cpumapToSet) < 0) {
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
#else /* !defined(HAVE_SCHED_GETAFFINITY) && !defined(HAVE_BSD_CPU_AFFINITY) */
|
#else /* !defined(HAVE_SCHED_GETAFFINITY) && !defined(HAVE_BSD_CPU_AFFINITY) */
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user