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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fdfe912..e69d92d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5435,9 +5435,14 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
autoCpuset) {
cpumask = autoCpuset;
} else {
+#ifdef __linux__
+ if (!(bitmap = virHostCPUGetOnlineBitmap()))
+ goto cleanup;
+#else
if (!(bitmap = virBitmapNew(hostcpus)))
goto cleanup;
virBitmapSetAll(bitmap);
+#endif
cpumask = bitmap;
}
--
2.1.0