mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Fix possible crash in qemuProcessSetVcpuAffinities
In case when <vcpu ... cpuset=""> is not specified, the vcpupin array is not guaranteed to be allocated to def->vcpus. This would cause a crash for TCG since it does not report thread IDs for vCPUs.
This commit is contained in:
parent
0d76794366
commit
ff4c42ed7a
@ -2376,7 +2376,7 @@ qemuProcessSetVcpuAffinities(virDomainObjPtr vm)
|
|||||||
/* If any CPU has custom affinity that differs from the
|
/* If any CPU has custom affinity that differs from the
|
||||||
* VM default affinity, we must reject it
|
* VM default affinity, we must reject it
|
||||||
*/
|
*/
|
||||||
for (n = 0; n < def->vcpus; n++) {
|
for (n = 0; n < def->cputune.nvcpupin; n++) {
|
||||||
if (!virBitmapEqual(def->cpumask,
|
if (!virBitmapEqual(def->cpumask,
|
||||||
def->cputune.vcpupin[n]->cpumask)) {
|
def->cputune.vcpupin[n]->cpumask)) {
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
|
Loading…
Reference in New Issue
Block a user