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

[libvirt] [PATCH] Change/create solution and project for Visual Studio and MonoDevelop for C# bindings



Hi,
 
here are 2 patches for C# libvirt bindings.
 
These patches create a new solution/project couple for Visual Studio 2010 with also a sample code and a solution/project couple for MonoDevelop with a sample code also.
 
The sample code have been tested under .Net/Windows, Mono/Windows and Mono/Linux. And it works, the sample code consist of the using au virConnectOpenAuth and callback handling. It connect to a URI (I have made my tests with ESX hypervisor only) and list domains in a listbox.
 
So, to summarize, code work under linux or windows, the binary library name depends of a project directive (a kind of pragma). When the directive WINDOWS is declared, DllImport will try to find "libvirt-0.dll" (for windows) otherwise it looks for "libvirt.so.0" (for linux). For now, in the same manner, when the directive WINDOWS is declared, we find _strdup in "msvcrt.dll" otherwise we look in "libc.so.6".
 
I'm currently trying to remove strdup call by Custom Marshaling but it seems that .Net (or Mono anyway) doesn't allow to use custom marshaler with structure (and we need it for virConnectCredential structure). If anyone had an idea...
 
Arnaud

Attachment: 0002-Add-Visual-Studio-2010-and-MonoDevelop-solutions.patch
Description: Binary data

Attachment: 0001-Files cleanup.patch
Description: Binary data


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