From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Harper Subject: Re: [PATCH 2/3] xend: Add multiple cpumasks support Date: Mon, 14 Aug 2006 12:48:12 -0500 Message-ID: <20060814174812.GO1694@us.ibm.com> References: <20060814165701.GL1694@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Ryan Harper , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org * Keir Fraser [2006-08-14 12:37]: > On 14/8/06 5:57 pm, "Ryan Harper" 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 ryanh@us.ibm.com