WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] block-nbd script and example config

To: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] block-nbd script and example config
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Tue, 25 Oct 2005 14:37:02 -0500
Cc: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>, Kurt Garloff <garloff@xxxxxxx>
Delivery-date: Tue, 25 Oct 2005 19:34:11 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <A95E2296287EAD4EB592B5DEEFCE0E9D32E551@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <A95E2296287EAD4EB592B5DEEFCE0E9D32E551@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
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






_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel