From: tierno Date: Fri, 10 Mar 2017 14:20:10 +0000 (+0100) Subject: allow exposing hyperthreading at guest using metadata topology=oneSocket:hyperthreading X-Git-Tag: v2.0.0~40 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=f1799b0c762bac3e45ea366d920437260b2a9652;p=osm%2Fopenvim.git allow exposing hyperthreading at guest using metadata topology=oneSocket:hyperthreading Change-Id: If924551bc588dd530699ea20c124ae9632388ef6 Signed-off-by: tierno --- diff --git a/host_thread.py b/host_thread.py index 97c57ba..d8bca2e 100644 --- a/host_thread.py +++ b/host_thread.py @@ -501,8 +501,12 @@ class host_thread(threading.Thread): self.tab()+'' +\ self.tab()+''+ \ self.dec_tab() +'' - if windows_os or topo=="oneSocket": - text += self.tab() + " "% vcpus + if topo == "oneSocket:hyperthreading": + if vcpus % 2 != 0: + return -1, 'Cannot expose hyperthreading with an odd number of vcpus' + text += self.tab() + " " % vcpus/2 + elif windows_os or topo == "oneSocket": + text += self.tab() + " " % vcpus else: text += self.tab() + "" text += self.tab() + "" +\