mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
qemu: Report pinning for all vCPUs in qemuDomainGetVcpuPinInfo
The API documentation states that the function is returning pinning for all vCPUs, so we can actually do so if the user passes a large enough array.
This commit is contained in:
parent
e498e90469
commit
0fe41f1a8a
@ -1473,6 +1473,7 @@ virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
|
||||
int hostcpus,
|
||||
virBitmapPtr autoCpuset)
|
||||
{
|
||||
int maxvcpus = virDomainDefGetVcpusMax(def);
|
||||
virBitmapPtr allcpumap = NULL;
|
||||
size_t i;
|
||||
|
||||
@ -1484,17 +1485,10 @@ virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
|
||||
|
||||
virBitmapSetAll(allcpumap);
|
||||
|
||||
/* Clamp to actual number of vcpus */
|
||||
if (ncpumaps > virDomainDefGetVcpus(def))
|
||||
ncpumaps = virDomainDefGetVcpus(def);
|
||||
|
||||
for (i = 0; i < ncpumaps; i++) {
|
||||
for (i = 0; i < maxvcpus && i < ncpumaps; i++) {
|
||||
virDomainVcpuInfoPtr vcpu = virDomainDefGetVcpu(def, i);
|
||||
virBitmapPtr bitmap = NULL;
|
||||
|
||||
if (!vcpu->online)
|
||||
continue;
|
||||
|
||||
if (vcpu->cpumask)
|
||||
bitmap = vcpu->cpumask;
|
||||
else if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
|
||||
@ -1509,7 +1503,7 @@ virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
|
||||
}
|
||||
|
||||
virBitmapFree(allcpumap);
|
||||
return ncpumaps;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user