[Libvir] [PATCH 3/3] Python cygvirtmod.dll -> libvirtmod.dll

Daniel Veillard veillard at redhat.com
Thu Nov 29 17:30:40 UTC 2007


On Thu, Nov 29, 2007 at 04:58:42PM +0000, Richard W.M. Jones wrote:
> Cygwin likes to name DLLs as cyg<name>.dll.
> 
> This is very unhelpful for Python loadable modules because the init 
> function name will be wrong and because it requires a change to the 
> 'libvirt.py' file to load the right module name (import libvirtmod -> 
> import cygvirtmod).

  hum, I think it would also require a change to the python C file
to rename the entry point too, otherwise a simple
   try:
       import libvirtmod
   except:
       import cygvirtmod

might have done it.

> In this patch I've added a post-install hook to make a symlink so that 
> Python finds libvirtmod.dll and all is happy.

  I must admit I'm wondering a bit about ln -s reliability in a Windows
environment ... maybe the above try:/except: plus a change at the end of
python/libvir.c adding

#ifdef CYGWIN
void
initcygvirtmod(void)
{
    initlibvirtmod();
}
#endif

might be a bit more reliable,

  But if the current solution works :-) fine by me +1

Daniel


-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list