This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] [PATCH 2/3] xend: Add multiple cpumasks support

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2/3] xend: Add multiple cpumasks support
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Mon, 14 Aug 2006 12:48:12 -0500
Cc: Ryan Harper <ryanh@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 14 Aug 2006 10:48:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1067361.DC3%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060814165701.GL1694@xxxxxxxxxx> <C1067361.DC3%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
* Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> [2006-08-14 12:37]:
> On 14/8/06 5:57 pm, "Ryan Harper" <ryanh@xxxxxxxxxx> wrote:
> > This patch modifies xend to accept and parse multiple cpumask strings
> > from the cpus parameter.  The cpus string stays the same, but it now
> > can parse either a python list of strings:
> > 
> > [ '2-5, '2-5', '2-5' ]
> > 
> > A regular string with ", " as the separator:
> > 
> > "2-5, 2-5, 2-5, 2-5"
> > 
> > or a mixture of both:
> > 
> > [ 2-5, '2-5', 2-5, '2-5' ]
> This isn't really a mixture of both, is it? It looks syntactically incorrect
> (e.g., first 2-5 is unquoted so not a string).

create.py ends up passing the whole thing as a string even if you mark
it up as a list with strings embedded which is why I can mix it.  If you
like, we can drop support for dealing with the [ ... ] form and just use
cpus = ""

> I'm not sure about the use of ', ' as a delimiter. It would be less
> confusing to strictly require the use of the list form. I would imagine it's
> then clearest used as:
> Cpus = []
> Cpus[0] = '2-5'
> Cpus[1] = '3-4'
> ...

I'd prefer to not have to use any language arrays.  I'm not sure how
this will map to the xml-based config files that Ewan was talking about,
but I suppose he will have to come up with something since we have
things like the disk parameter which is in python list format.

> Trying to read long lists of cpu constraints with spaces in will make people
> go cross-eyed!

I agree.  The point was that I'm attempting to parse as much as I can
make sense of,  not to indicate how we should tell the user to convey this
information.  I also like being able to retain the cpu=, cpus=, previous
syntax while extending it to support multiple cpumasks.  

I think the following (which I added in the example files)
is good enough without having to resort to arrays/dictionaries.

cpus = "2-5, 2-5, 2-5, 2-5"

I'm open to other field delimiters if that is a point of contention.

Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253

Xen-devel mailing list