[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH RFC 8/8] xl: introduce topology options



Namely sockets, cores and threads to describe the topology as seen
by the guest. This as an alternative to the SMT option that is also
proposed.

Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx>
---
CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 docs/man/xl.cfg.pod.5    | 18 ++++++++++++++++++
 tools/libxl/xl_cmdimpl.c |  7 +++++++
 2 files changed, 25 insertions(+)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 5e614f7..cb7ebc2 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -110,6 +110,24 @@ Configures if guests should see SMT topology instead of 
normal flat topology.
 
 Default is C<0>
 
+=item B<sockets=N>
+
+Configures number of sockets as seen by the guest.
+
+Default is C<0>
+
+=item B<cores=N>
+
+Configures number of physical cores per package as seen by the guest.
+
+Default is C<0>
+
+=item B<threads=N>
+
+Configures number of SMT threads per core as seen by the guest.
+
+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 c09f628..965d60b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1367,6 +1367,13 @@ static void parse_config_data(const char *config_source,
 
     xlu_cfg_get_defbool(config, "smt", &b_info->smt, 0);
 
+    if (!xlu_cfg_get_long(config, "sockets", &l, 0))
+        b_info->topology.sockets = l;
+    if (!xlu_cfg_get_long(config, "cores",   &l, 0))
+        b_info->topology.cores = l;
+    if (!xlu_cfg_get_long(config, "threads", &l, 0))
+        b_info->topology.threads = l;
+
     if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0))
         b_info->max_vcpus = l;
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.