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

[libvirt] [PATCH] Win32 compatibility for 0.9.11

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,




Attachment: win32-libvirt-0.9.11.patch
Description: Binary data

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