[Libvir] [PATCH] Fix xen://hostname URIs with no trailing slash

It turns out that xmlParseURI gives an error if asked to parse the string "xen://". This string arises because after a URI such as "xen://hostname" has been stripped of its server field, it becomes "xen://" on the remote end of the connection, and the failure of xmlParseURI causes the whole connection to fail. I'm not sure of the best way to fix it. The attached patch is a semi-hack which at least allows xen://hostname to work. It's not a problem for qemu because these URIs should always contain a path. Nor for test for the same reason. Not sure about OpenVZ. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

I didn't really mean to post the debugging part of that patch. But actually it's quite useful and the message only appears when configured with --enable-debug, which is fair game for lengthy informational messages. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Tue, Oct 16, 2007 at 11:37:31AM +0100, Richard W.M. Jones wrote:
I didn't really mean to post the debugging part of that patch. But actually it's quite useful and the message only appears when configured with --enable-debug, which is fair game for lengthy informational messages.
Yes in general I think keeping debuging capabilities as a compile time option guarded by defines is a good idea if they don't clutter the code too much. It can help maintainance a lot when you go back to that code after some time. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
On Tue, Oct 16, 2007 at 11:37:31AM +0100, Richard W.M. Jones wrote:
I didn't really mean to post the debugging part of that patch. But actually it's quite useful and the message only appears when configured with --enable-debug, which is fair game for lengthy informational messages.
Yes in general I think keeping debuging capabilities as a compile time option guarded by defines is a good idea if they don't clutter the code too much. It can help maintainance a lot when you go back to that code after some time.
This patch has been applied. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
participants (2)
-
Daniel Veillard
-
Richard W.M. Jones