[libvirt] [PATCH] Win32 compatibility for 0.9.11

Marcel Müller marcel-mueller at gmx.de
Sat Apr 7 18:23:29 UTC 2012


Hello everyone,

 

I tried to build libvirt-0.9.11 for Windows using the MSYS Build Script
provided by Matthias Bolte and noticed that there were two problems which
made libvirt unusable.

1)      Whenever a TCP Connection is opened, libvirt will fail with “failed
to set close-on-exec” (I’m using “xen+tcp” here).

2)      The lib will crash most of the time, because it tries to access a
null pointer.

 

I fixed both issues with a little patch:

1)      On Win32 platforms virSetInherit always returns -1, therefore
failing any call which tries to set “close-on-exec”. I don’t know if there’s
a Win32 equivalent of “close-on-exec”, so I just set this to return 0
instead.

2)      Libvirt crashes, because TlsGetValue seems to return a NULL value
sometimes. Not sure right now, if this is ok in a way or if it indicates
another problem somewhere... (This might be the case, as I’m experience
crashes as soon as libvirt is used in a multithreading application, though I
had this with an old version as well. Will discuss that in another mail).

 

As this is my first mail to a mailing list, please don’t hesitate to tell
me, what I did wrong!

By the way, should I attach the binaries for 0.9.11 in case anyone is
looking for those without the need to compile them? 

 

Best Regards,
Marcel

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120407/a232caa5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win32-libvirt-0.9.11.patch
Type: application/octet-stream
Size: 696 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120407/a232caa5/attachment-0001.obj>


More information about the libvir-list mailing list