]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
hyperv: fix the number of threads per core
authorMatt Coleman <mcoleman@datto.com>
Tue, 15 Sep 2020 22:27:16 +0000 (18:27 -0400)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 16 Sep 2020 08:14:42 +0000 (10:14 +0200)
The operands were reversed, producing an incorrect result.

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/hyperv/hyperv_driver.c

index 20d372b27404f07a97f5cf0a9179d2cc134de758..9b181ebfff82f13c114ae5c72506d8a1742217c4 100644 (file)
@@ -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;