On Thu, 2015-02-12 at 19:44 +0000, Wei Liu wrote: > Transform the user supplied vNUMA configuration into libxl internal > representations, and finally libxc representations. Check validity of > the configuration along the line. > > Signed-off-by: Wei Liu <wei.l...@citrix.com> > Cc: Ian Campbell <ian.campb...@citrix.com> > Cc: Ian Jackson <ian.jack...@eu.citrix.com> > Cc: Dario Faggioli <dario.faggi...@citrix.com> > Cc: Elena Ufimtseva <ufimts...@gmail.com> > Acked-by: Ian Campbell <ian.campb...@citrix.com>
> --- a/tools/libxl/libxl_dom.c > +++ b/tools/libxl/libxl_dom.c > +static int set_vnuma_info(libxl__gc *gc, uint32_t domid, > + const libxl_domain_build_info *info, > + const libxl__domain_build_state *state) > +{ > + int rc = 0; > + int i, nr_vdistance; > + unsigned int *vcpu_to_vnode, *vnode_to_pnode, *vdistance = NULL; > + > + vcpu_to_vnode = libxl__calloc(gc, info->max_vcpus, > + sizeof(unsigned int)); > + vnode_to_pnode = libxl__calloc(gc, info->num_vnuma_nodes, > + sizeof(unsigned int)); > + > + nr_vdistance = info->num_vnuma_nodes * info->num_vnuma_nodes; > + vdistance = libxl__calloc(gc, nr_vdistance, sizeof(unsigned int)); > + > + for (i = 0; i < info->num_vnuma_nodes; i++) { > + libxl_vnode_info *v = &info->vnuma_nodes[i]; > + int bit; > + > + /* vnode to pnode mapping */ > + vnode_to_pnode[i] = v->pnode; > + > + /* vcpu to vnode mapping */ > + libxl_for_each_set_bit(bit, v->vcpus) > + vcpu_to_vnode[bit] = i; > + 'bit' made the reader (or at least it made me) think that we're dealing with something that have to do with actual bits, while it's just an index, as usual. For that reason, I'd have gone for 'j' (as 'i' is being used already). However, that's certainly a minor thing, so with or without this change: Reviewed-by: Dario Faggioli <dario.faggi...@citrix.com> Regards, Dario
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel