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

Re: [Libvir] [PATCH] parse URI once in src/libvirt.c, pass parsed URI to all drivers

On Tue, Oct 16, 2007 at 11:06:26AM +0100, Richard W.M. Jones wrote:
> The basic change here is that the virDrvOpen call (the internal "open" 
> call for drivers) now takes the parsed xmlURIPtr instead of the raw name 
> string.
>  typedef virDrvOpenStatus
>         (*virDrvOpen)           (virConnectPtr conn,
> -                                const char *name,
> +                     	         xmlURIPtr uri,
>                                  int flags);
> So we avoid the redundant URI parsing which was going on inside all the 
> drivers, and also the ad-hoc "does-it-look-like-a-URI" string comparisons.
> That's straightforward enough except that all of the drivers were saving 
> the name string in their private data so that they could implement the 
> virConnectGetURI call.  I've changed this so that the name is copied and 
> saved in the main virConnect structure, and virConnectGetURI will return 
> that unless the driver wants to override it.

  okay, a very needed code cleanup indeed +1

> You need another patch (coming shortly) to allow URIs like 
> xen://localhost (without the trailing slash) to work, which was IIRC the 
> original point of this discussion.

  Yup, thanks in advance,


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/

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