[libvirt] [PATCH] esx: Fix CPU clock Hz to MHz conversion

Matthias Bolte matthias.bolte at googlemail.com
Sun Nov 15 16:49:42 UTC 2009


2009/11/15 Daniel Veillard <veillard at redhat.com>:
> On Sat, Nov 14, 2009 at 11:02:48PM +0100, Matthias Bolte wrote:
>> ---
>>  src/esx/esx_driver.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
>> index b84250c..5737fe9 100644
>> --- a/src/esx/esx_driver.c
>> +++ b/src/esx/esx_driver.c
>> @@ -878,7 +878,7 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo)
>>
>>      nodeinfo->memory = memorySize / 1024; /* Scale from bytes to kilobytes */
>>      nodeinfo->cpus = cpuInfo_numCpuCores;
>> -    nodeinfo->mhz = cpuInfo_hz / (1024 * 1024); /* Scale from hz to mhz */
>> +    nodeinfo->mhz = cpuInfo_hz / (1000 * 1000); /* Scale from hz to mhz */
>>      nodeinfo->nodes = numaInfo_numNodes;
>>      nodeinfo->sockets = cpuInfo_numCpuPackages;
>>      nodeinfo->cores = cpuInfo_numCpuPackages > 0
>
>  Ahhh :-) subtle !

Yes, it was found while running some stress tests with our system.
Some tests failed because the CPU clock value reported by the ESX
driver was to small due to the 1024 VS 1000 problem.

Matthias

>  ACK
>
> Daniel
>




More information about the libvir-list mailing list