[Libvir] PATCH: Do proper URI parsing for QEMU driver

Richard W.M. Jones rjones at redhat.com
Thu Sep 20 22:23:19 UTC 2007


Daniel P. Berrange wrote:
> The QEMU driver doesn't cope with URI parameters appended to the end of a
> path since it is just doing strcmp on the URI. This patch makes it use
> libxml's URI parsing code

Looks good apart from a mistake in freeing the URI here, where you 
probably meant to jump to the 'decline' label:

+    if (uri == NULL || uri->scheme == NULL || uri->path == NULL)
+        return VIR_DRV_OPEN_DECLINED;

and similarly you need to free the uri before here:

      return VIR_DRV_OPEN_SUCCESS;

and then:

+ decline:
+    xmlFreeURI(uri);
    ^^^ if (uri) ^^^ needed

I didn't apply the other one yet because my machine's up the spout, so 
feel free to commit both if you want.

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070920/a707b286/attachment-0001.bin>


More information about the libvir-list mailing list