From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: block-nbd script and example config Date: Tue, 25 Oct 2005 14:37:02 -0500 Message-ID: <435E895E.3040608@us.ibm.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: 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: Ian Pratt Cc: Xen development list , Kurt Garloff List-Id: xen-devel@lists.xenproject.org Ian Pratt wrote: >Let's think a little about what we'd like this to look like. > >Taking a similar approach to network devices, we'd end up with something >that looks like this: > > disks = [ 'export=phy:/dev/sda1, target=/dev/sda1, options=rw', > 'export=phy:/dev/vg/my_usr, target=/dev/sdb1, options=ro' ] > > Yup. Here's another example: disks = [ 'export=file:/home/anthony/images/Fedora Core 4.img, target=/dev/sda1, options=rw', This is going to become difficult to parse (we could split with ',' here but then what if we have commas in files). We could support an escaping mechanism but then it would require triple escapes like: disks = [ 'export=file:/home/anthony/image/Fedora Core 4\\\, x86-64.img, target=/dev/sda1, options=rw' ] Or regular expression syntax: disks = [ r'export=file:/home/anthony/image/Fedora Core 4\, x86-64.img, target=/dev/sda1, options=rw' ] >I'm wandering whether the following although slightly ugly might be >better from a python POV (we'd change network devices acordingly too: > > disks = [ { 'export':'phy:/dev/sda1', 'target':'/dev/sda1', >'options':'rw' }, > { 'export':'phy:/dev/vg/my_usr', 'target':'/dev/sdb1', >'options':'ro' } ] > > I thought of this too. I think it's just too much to ask from users though. If you know python, it's understandable, but if you don't, I think it reads like gibberish. >Is this just too ugly and would we be better off going with my first >proposal? Or should we just leave things alone for 3.0? > > Yeah, perhaps we should just leave things alone for 3.0. We can revisit when someone comes up with a clever syntax that solves the above problems. Regards, Anthony Liguori >Ian > > > > > >