From: Ian Campbell Subject: Re: [PATCH V5 03/32] xl / libxl: push VCPU affinity pinning down to libxl Date: Fri, 16 May 2014 10:51:10 +0100 Message-ID: <1400233870.8259.9.camel@kazak.uk.xensource.com> References: <1400018054-26038-1-git-send-email-wei.liu2@citrix.com> <1400018054-26038-4-git-send-email-wei.liu2@citrix.com> <1400172319.883.29.camel@kazak.uk.xensource.com> <20140515170650.GB10525@zion.uk.xensource.com> <20140515171955.GE10525@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140515171955.GE10525@zion.uk.xensource.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: Wei Liu Cc: Dario Faggioli , ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2014-05-15 at 18:19 +0100, Wei Liu wrote: > On Thu, May 15, 2014 at 06:06:50PM +0100, Wei Liu wrote: > [...] > > > > @@ -833,11 +823,30 @@ static void parse_config_data(const char *config_source, > > > > exit(1); > > > > } > > > > libxl_bitmap_set(&b_info->cpumap, i); > > > > - if (n_cpus < b_info->max_vcpus) > > > > - vcpu_to_pcpu[n_cpus] = i; > > > > + if (n_cpus < b_info->max_vcpus) { > > > > + kvl = xrealloc(kvl, sizeof(char *) * (len * 2 + 2)); > > > > > > Can't you get the length of the input list and just allocate the right > > > size to start with? > > > > > > > That introduces extra overhead. Say if you have 32 VCPU but only want to > > pin a few. > > > > I misread this one. I think you're right. But how can I can the length > of this list? Could not find an appropriate API. I guess I need to do it > myself? xlu_cfg_get_list takes int *entries_r. Ian.