From: Wei Liu Subject: Re: [PATCH] xl: fix vcpus to vnode assignement in config file Date: Fri, 17 Jul 2015 18:19:16 +0100 Message-ID: <20150717171916.GX12455@zion.uk.xensource.com> References: <20150717155749.4264.74048.stgit@Solace.station> <20150717160802.GQ12455@zion.uk.xensource.com> <1437153356.23656.38.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZG9I9-0004SA-Ga for xen-devel@lists.xenproject.org; Fri, 17 Jul 2015 17:19:21 +0000 Content-Disposition: inline In-Reply-To: <1437153356.23656.38.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: xen-devel@lists.xenproject.org, Wei Liu , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Fri, Jul 17, 2015 at 07:15:56PM +0200, Dario Faggioli wrote: > On Fri, 2015-07-17 at 17:08 +0100, Wei Liu wrote: > > On Fri, Jul 17, 2015 at 05:57:49PM +0200, Dario Faggioli wrote: > > > > Signed-off-by: Dario Faggioli > > > --- > > > Cc: Wei Liu > > > Cc: Ian Jackson > > > Cc: Ian Campbell > > > > With two issues mentioned below fixed: > > > > Acked-by: Wei Liu > > > Thanks. > > > > --- a/tools/libxl/xl_cmdimpl.c > > > +++ b/tools/libxl/xl_cmdimpl.c > > > @@ -1076,9 +1076,7 @@ static void parse_vnuma_config(const XLU_Config *config, > > > /* Temporary storage for parsed vcpus information to avoid > > > * parsing config twice. This array has num_vnuma elements. > > > */ > > > > Delete this comment as well. > > > Can I ask why? I think it's still accurate, actually... > Actually you're right. Keep it. For some reason my ability to concentrate is very bad today. :-/ > > > - struct vcpu_range_parsed { > > > - unsigned long start, end; > > > - } *vcpu_range_parsed; > > > + libxl_bitmap *vcpu_parsed; > > > > > @@ -1095,7 +1093,14 @@ static void parse_vnuma_config(const XLU_Config *config, > > > > > > b_info->num_vnuma_nodes = num_vnuma; > > > b_info->vnuma_nodes = xcalloc(num_vnuma, sizeof(libxl_vnode_info)); > > > - vcpu_range_parsed = xcalloc(num_vnuma, sizeof(*vcpu_range_parsed)); > > > + vcpu_parsed = xcalloc(num_vnuma, sizeof(libxl_bitmap)); > > > + for (i = 0; i < num_vnuma; i++) { > > > + libxl_bitmap_init(&vcpu_parsed[i]); > > > + if (libxl_cpu_bitmap_alloc(ctx, &vcpu_parsed[i], b_info->max_vcpus)) { > > > + fprintf(stderr, "libxl_node_bitmap_alloc failed.\n"); > > > + exit(1); > > > + } > > > + } > > > > > > for (i = 0; i < b_info->num_vnuma_nodes; i++) { > > > libxl_vnode_info *p = &b_info->vnuma_nodes[i]; > > > @@ -1165,12 +1170,14 @@ static void parse_vnuma_config(const XLU_Config *config, > > > split_string_into_string_list(value, ",", &cpu_spec_list); > > > len = libxl_string_list_length(&cpu_spec_list); > > > > > > - for (j = 0; j < len; j++) > > > + for (j = 0; j < len; j++) { > > > parse_range(cpu_spec_list[j], &s, &e); > > > + for (; s <=e; s++) { > > > > Space before e. > > > Bha! Sure, sorry for this. > > Regards, > Dario > -- > <> (Raistlin Majere) > ----------------------------------------------------------------- > Dario Faggioli, Ph.D, http://about.me/dario.faggioli > Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)