diff mbox

[RFC,6/8] xl: introduce smt option

Message ID 1456174934-22973-7-git-send-email-joao.m.martins@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joao Martins Feb. 22, 2016, 9:02 p.m. UTC
This options changes how "vcpus" are seen by dividing
them in the number of SMT threads supported by the host.
This should be used together with "cpus" so that the topology
matches.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5    | 6 ++++++
 tools/libxl/xl_cmdimpl.c | 2 ++
 2 files changed, 8 insertions(+)
diff mbox

Patch

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 40690bd..5e614f7 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -104,6 +104,12 @@  Put the guest's vcpus into the named cpu pool.
 
 Start the guest with N vcpus initially online.
 
+=item B<smt=BOOLEAN>
+
+Configures if guests should see SMT topology instead of normal flat topology.
+
+Default is C<0>
+
 =item B<maxvcpus=M>
 
 Allow the guest to bring up a maximum of M vcpus. At start of day if
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d07ccb2..c09f628 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1365,6 +1365,8 @@  static void parse_config_data(const char *config_source,
             libxl_bitmap_set((&b_info->avail_vcpus), l);
     }
 
+    xlu_cfg_get_defbool(config, "smt", &b_info->smt, 0);
+
     if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0))
         b_info->max_vcpus = l;