[libvirt] [C# bindings][Pathces] Marshaling corrections, coverage and new sample

Matthias Bolte matthias.bolte at googlemail.com
Mon Nov 29 12:31:32 UTC 2010


Okay, you're right I8 is just fine there because
DomainInterfaceStatsStruct and DomainBlockStatsStruct just contain
long long members and long long is always 64bit width. An int is
always 32bit width, so the only thing that needs special handling is
the long type in C, as it is compiler and platform dependent if it's
32bit or 64bit width.

I applied and pushed the 3 remaining patches now. I also tested them
on 32bit Windows and 64bit Linux.

Matthias

2010/11/25  <arnaud.champion at devatom.fr>:
> Hi Matthias,
>
> sorry for the response delay I've been very busy.
>
> I was also surprised that this marshaling works without IntPtr, anyway I
> have double check results against virsh unde Windows/.Net, Windows/Mono,
> Ubuntu 10.10/Mono (64 bits) and it works fine.
> Anyway, I can try to put IntPtr to be coherent. What do you think ?
>
> Regards,
>
> Arnaud
>
> --------------------------------------------------
> From: "Matthias Bolte" <matthias.bolte at googlemail.com>
> Sent: Monday, November 15, 2010 5:52 PM
> To: <arnaud.champion at devatom.fr>
> Cc: <libvir-list at redhat.com>
> Subject: Re: [libvirt] [C# bindings][Pathces] Marshaling corrections,
> coverage and new sample
>
>> 2010/11/13  <arnaud.champion at devatom.fr>:
>>>
>>> Hi there,
>>>
>>> here are some new patches for the C# bindings.
>>> These patches correct marshaling in domain statistics (block / interface
>>> /
>>> info) and error structure. These parches also add a new sample code.
>>> I have included the coverage also.
>>>
>>> regards,
>>>
>>> Arnaud
>>>
>>
>> Okay, I pushed the 0001-Correct-virGetLastError-marshaling.patch.
>>
>> The 0001-Add-sample-virDomainStats.patch depends on the
>> 0001-Correct-virDomainBlockStats-virDomainInterfaceStats-.patch.
>>
>> In 0001-Correct-virDomainBlockStats-virDomainInterfaceStats-.patch you
>> used UnmanagedType.SysUInt to marshal a ulong in NodeInfo. This fixes
>> the problem with long having different sizes on 32bit and 64bit
>> systems. But for some reason you used UnmanagedType.I8 to marshal long
>> in DomainInterfaceStatsStruct and DomainBlockStatsStruct. I think this
>> is wrong on 32bit systems and should be UnmanagedType.SysInt instead,
>> shouldn't it?
>>
>> Also this comment "// TODO virDomainMemoryStats : Currently disabled
>> in libvirt" is wrong. It's not disabled in libvirt, it's disabled in
>> QEMU.
>>
>> 0001-Forgot-comments-on-new-sample.patch is just an incremental fix
>> for 0001-Add-sample-virDomainStats.patch and I'll squash the fix into
>> it when I can push it.
>>
>> Matthias
>
>
>




More information about the libvir-list mailing list