1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: vcpupin: Don't overwrite errors from functions setting pinning

Both errors from the cgroups code and from the affinity code would be
overwritten by the API. Report the more specific error.
This commit is contained in:
Peter Krempa 2016-02-12 06:54:41 +01:00
parent 9268b9ad48
commit 471741309d

View File

@ -5066,20 +5066,12 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_VCPU, vcpu,
false, &cgroup_vcpu) < 0)
goto endjob;
if (qemuSetupCgroupCpusetCpus(cgroup_vcpu, pcpumap) < 0) {
virReportError(VIR_ERR_OPERATION_INVALID,
_("failed to set cpuset.cpus in cgroup"
" for vcpu %d"), vcpu);
if (qemuSetupCgroupCpusetCpus(cgroup_vcpu, pcpumap) < 0)
goto endjob;
}
} else {
if (virProcessSetAffinity(qemuDomainGetVcpuPid(vm, vcpu),
pcpumap) < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to set cpu affinity for vcpu %d"),
vcpu);
pcpumap) < 0)
goto endjob;
}
}
virBitmapFree(vcpuinfolive->cpumask);