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

Re: [Xen-devel] [PATCH] libxl: use xc_topologyinfo to figure out how many CPUs we actually have



On Wed, 2012-05-09 at 12:03 +0100, Darrio Faggioli wrote:
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -2903,7 +2903,8 @@ libxl_cputopology *libxl_get_cpu_topolog
>      }
>  
>      for (i = 0; i < max_cpus; i++) {
> -#define V(map, i) (map[i] == INVALID_TOPOLOGY_ID) ? \
> +#define V(map, i) (i > tinfo.max_cpu_index || \
> +    map[i] == INVALID_TOPOLOGY_ID) ? \

This ensures that cpus entries above max_cpu_index are
INVALID_TOPOLOGY_ID but do you also want to size the return array using
tinfo.max_cpu_index too? And also return that in *nr instead of?

(I don't know the answer, either of max-possible- and max-online-cpus is
a reasonable size for this array)

>      LIBXL_CPUTOPOLOGY_INVALID_ENTRY : map[i]
>          ret[i].core = V(coremap, i);
>          ret[i].socket = V(socketmap, i);



_______________________________________________
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®.