From: Matt Coleman Date: Tue, 15 Sep 2020 22:27:16 +0000 (-0400) Subject: hyperv: fix the number of threads per core X-Git-Tag: v6.8.0-rc1~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e18d3b833b9daa7bb18b9550a2cf4d140303d86;p=thirdparty%2Flibvirt.git hyperv: fix the number of threads per core The operands were reversed, producing an incorrect result. Co-authored-by: Sri Ramanujam Signed-off-by: Matt Coleman Reviewed-by: Michal Privoznik --- diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 20d372b274..9b181ebfff 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -310,7 +310,7 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) } info->cores = processorList->data.common->NumberOfCores; - info->threads = info->cores / processorList->data.common->NumberOfLogicalProcessors; + info->threads = processorList->data.common->NumberOfLogicalProcessors / info->cores; info->cpus = info->sockets * info->cores; result = 0;