From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH for-4.6 2/3] xl: fix vNUMA vcpus parsing Date: Thu, 13 Aug 2015 10:26:45 +0100 Message-ID: <55CC62D5.7010706@citrix.com> References: <1439408161-15015-1-git-send-email-wei.liu2@citrix.com> <1439408161-15015-3-git-send-email-wei.liu2@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 1ZPome-0003Sg-V6 for xen-devel@lists.xenproject.org; Thu, 13 Aug 2015 09:26:49 +0000 In-Reply-To: <1439408161-15015-3-git-send-email-wei.liu2@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: Wei Liu , Xen-devel Cc: Boris Ostrovsky , Ian Jackson , Dario Faggioli , Ian Campbell List-Id: xen-devel@lists.xenproject.org On 12/08/15 20:36, Wei Liu wrote: > Originally, if user didn't specify maxvcpus= in xl config file, the > maximum size of vcpu bitmap was always equal to maximum number of pcpus. > This might not be what user wants. > > Calculate the maximum number of vcpus before allocating vcpu bitmap. > This requires parsing the same config options twice. Extra a macro to do > that. [...] > +#define PARSE_VNUMA_SPEC(body) Just when I though libxl/xl's macro craziness couldn't get any worse... Do you want anyone else to be able to understand this code? It looks like you can parse the option into a list of (option, value) tuples and then iterate over this list twice. David