Currently when the vcpu placement is static
and cpuset is not specified, CPU Affinity
under virsh emulatorpin shows 0..CPUMAX. This
patchset will result in display of only online
CPU's under CPU Affinity on linux.
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
src/qemu/qemu_driver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a82e58b..5456596 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5435,6 +5435,9 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
} else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO
&&
autoCpuset) {
cpumask = autoCpuset;
+ } else if (vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC
&&
+ virHostCPUGetOnlineBitmap()) {
+ cpumask = virHostCPUGetOnlineBitmap();
} else {
if (!(bitmap = virBitmapNew(hostcpus)))
goto cleanup;
@@ -5449,6 +5452,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
cleanup:
virDomainObjEndAPI(&vm);
virBitmapFree(bitmap);
+ virBitmapFree(cpumask);
return ret;
}
--
2.1.0