Daniel P. Berrange wrote:
On Fri, Jul 20, 2007 at 10:58:24AM -0400, Daniel Veillard wrote:Hum, we say it's an uri, but we interpret is differently if it's not absolute this could lead to confusion. But I'm not sure being a purist here would help that much from an user POV.I agree - the fact that the 'uri' to virConnectOpen doesn't technically have to always be a URI (eg, NULL, or Xen, or xen) is a major cause of pain virt-manager since we have to special case parsing of it, rather than just handing off to a generic URI parser module. We should mandate wellformed URIs for the migrate API, where wellformed is defined to be whatever libxml is able to parse :-)
I'd be a bit happier if libxml2 could parse a bare string like "hostname" and "hostname:1234" more like my browser does. At the moment this is what it does:
hostname ---> scheme=(null) server=(null) port=0 path=hostname query_raw=(null) hostname:1234 ---> scheme=hostname server=(null) port=0 path=(null) query_raw=(null)
(Original program attached).I'm sure there's some smartypants standards reason for it, but it's counterintuitive to me.
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
#include <libxml/uri.h> #include <stdio.h> void print_uri (const char *str, xmlURIPtr uri) { printf ("%s ---> scheme=%s server=%s port=%d path=%s query_raw=%s\n", str, uri->scheme, uri->server, uri->port, uri->path, uri->query_raw); } main () { char *str = "hostname"; xmlURIPtr uri = xmlParseURI (str); print_uri (str, uri); str = "hostname:1234"; uri = xmlParseURI (str); print_uri (str, uri); }
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature