From f1799b0c762bac3e45ea366d920437260b2a9652 Mon Sep 17 00:00:00 2001 From: tierno Date: Fri, 10 Mar 2017 15:20:10 +0100 Subject: [PATCH] allow exposing hyperthreading at guest using metadata topology=oneSocket:hyperthreading Change-Id: If924551bc588dd530699ea20c124ae9632388ef6 Signed-off-by: tierno --- host_thread.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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() + "" +\ -- 2.25.1