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

Re: [Xen-devel] [RFC] support more qdisk types



Jim Fehlig writes ("Re: [Xen-devel] [RFC] support more qdisk types"):
> I think my previous problem was related to quoting in a disk spec containing
> several ceph monitors. According to $qemu-src/hw/block/rbd.c, ':' is used to
> delimit option=value tuples. I was escaping the colon between a ceph monitor
> server and port with a single '\'. E.g.
> 
> disk = [ "vdev=xvdb, backendtype=qdisk,
> target=rbd:libvirt-pool/new-libvirt-image:auth_supported=none:mon_host=192.168.0.100\:6789;192.168.0.101\:6789;192.168.0.102\:6789"
> ]

I'm not a huge fan of this embedding of a protocol in `target:' for
direct consumption by qemu, but I guess it's a useful escape hatch for
getting something through to qemu which libxl itself doesn't know
about.

But, anyway:

> What I didn't realize was that libxl omitted the entire colon when
> writing the string to xenstore

I think it is a bug that your string above was not rejected.  The bug
is in libxlu_cfg.c, where the \-dequoting is done.  It has if()
branches for various characters that might follow \, but if a
not-understood character is found, it (and the preceding \) are simply
discarded.  Such things should be rejected (using a call to
xlu__cfgl_lexicalerror).

> Using double backslash worked. E.g.
> 
> disk = [ "vdev=xvdb, backendtype=qdisk,
> target=rbd:libvirt-pool/new-libvirt-image:auth_supported=none:mon_host=192.168.0.100\\:6789;192.168.0.101\\:6789;192.168.0.102\\:6789"
> ]

Right.

> In the end, maybe all that's needed is a few more examples in
> xl-disk-configuration. Perhaps a paragraph under "Special Syntax" of 'target'
> doc, along with example config like the above?

This backslash unescaping is in fact a feature of all strings in xl
configuration files.  (The syntax is borrowed from Python.)

And you are right that it doesn't seem to be documented.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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