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

[Xen-devel] Re: [PATCH 2/4] libxl: implementing legacy xm cpuid parser



Andre Przywara wrote:
> ...
To see the direction I am going to I attached the first draft version of my upcoming multicore patch. This uses the interface provided by libxl_cpuid_parse_config(). IMHO this is a very readable and maintainable approach, and it can be overridden by cpuid lines (or forced again later by being called after the cpuid= parsing).
Now actually attached.

Regards,
Andre.

--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany
Tel: +49 351 448-3567-12
commit a228ae7ec9f585959aebb9987861fc6482e142f1
Author: Andre Przywara <andre.przywara@xxxxxxx>
Date:   Fri Sep 17 14:22:04 2010 +0200

    first version of multicore patch

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2c90c2b..e633c7b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1012,6 +1012,17 @@ skip_vfb:
         }
     }
 
+    if (!xlu_cfg_get_long (config, "nr_cores", &l)) {
+        char str[32];
+
+        snprintf(str, 32, "proccount=%ld", l);
+        libxl_cpuid_parse_config(&b_info->cpuid, str);
+        snprintf(str, 32, "nc=%ld", l - 1);
+        libxl_cpuid_parse_config(&b_info->cpuid, str);
+        libxl_cpuid_parse_config(&b_info->cpuid, "htt=1");
+        libxl_cpuid_parse_config(&b_info->cpuid, "cmplegcay=1");
+    }
+
     switch (xlu_cfg_get_type(config, "cpuid")) {
     case XLU_CFG_LIST:
         if (!xlu_cfg_get_list(config, "cpuid", &cpuids, 0)) {
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

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