Merge pull request #1520 from NuxRo/kvm-numa-cpu-reporting

CPU socket count reporting correctionCPU socket count reporting correction
From https://github.com/MissionCriticalCloud/cosmic-plugin-hypervisor-kvm/pull/16

* pr/1520:
  Remove empty spaces causing the build to fail
  CPU socket count reporting correction

Signed-off-by: Will Stevens <williamstevens@gmail.com>
This commit is contained in:
Will Stevens 2016-05-13 17:02:09 -04:00
commit 7be8585787
1 changed files with 7 additions and 0 deletions

View File

@ -2622,7 +2622,14 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
final NodeInfo hosts = conn.nodeInfo();
speed = getCpuSpeed(hosts);
/*
* Some CPUs report a single socket and multiple NUMA cells.
* We need to multiply them to get the correct socket count.
*/
cpuSockets = hosts.sockets;
if (hosts.nodes > 0) {
cpuSockets = hosts.sockets * hosts.nodes;
}
cpus = hosts.cpus;
ram = hosts.memory * 1024L;
final LibvirtCapXMLParser parser = new LibvirtCapXMLParser();