[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.