The only change was making the struct into a union per your comments.
Can you let me now if this solves you NPE? It passes my tests.
-- bk
On 01/27/2010 08:40 PM, Bryan Kearney wrote:
Alright.. let me give it a try. I was not seeing the NPE in the tests
I
ran.
-- bk
On 01/25/2010 01:15 PM, frederic.dangtran(a)orange-ftgroup.com wrote:
>
> On Jan 18, 2010, at 3:44 PM, Bryan Kearney wrote:
>
>> I have just released 0.4.1 of libvirt java. There are 2 main items in
>> this release:
>>
>> - Better null checking in for Scheduled Parameters which should fix
>> the issues reported on the list.
>> - Error Callbacks to provide better handling of errors encountered by
>> libvirt (virConnSetErrorFunc and virSetErrorFunc).
>>
>> You can access the latest version via the following means:
>>
>> Source Code:
http://www.libvirt.org/git/?p=libvirt-java.git;a=summary
>> Bundled Source (tarball and SRPM):
http://libvirt.org/sources/java/
>> Maven:
http://libvirt.org/maven2/
>> RPMS are making their way through F-11 and F12 build systems
>>
>> Thank you!
>>
>> -- bk
>>
>> --
>> libvir-list mailing list
>> libvir-list(a)redhat.com <mailto:libvir-list@redhat.com>
>>
https://www.redhat.com/mailman/listinfo/libvir-list
>
> Thanks for the update, Bryan, but the problem still persists. In my
> setup (Xen hosts): Domain.getSchedulerParameters() still raises a NPE.
>
> In libvirt.h, _virSchedParameter is defined as follows using a union for
> the value:
>
> struct _virSchedParameter {
> char field[VIR_DOMAIN_SCHED_FIELD_LENGTH]; /* parameter name */
> int type; /* parameter type */
> union {
> int i; /* data for integer case */
> unsigned int ui; /* data for unsigned integer case */
> long long int l; /* data for long long integer case */
> unsigned long long int ul; /* data for unsigned long long integer case */
> double d; /* data for double case */
> char b; /* data for char case */
> } value; /* parameter value */
> };
>
> I believe the Java mapping of virSchedParameterValue should be a Union
> instead of a Structure:
> public class virSchedParameterValue extends Union {...}
>
> Regards,
> Frederic
>
> ------------------
> Orange Labs
> 38-40 rue du General Leclerc
> 92794 Issy Moulineaux Cedex 9
> FRANCE
>
>
>
>
>
> *********************************
> This message and any attachments (the "message") are confidential and
> intended solely for the addressees.
> Any unauthorised use or dissemination is prohibited.
> Messages are susceptible to alteration.
> France Telecom Group shall not be liable for the message if altered,
> changed or falsified.
> If you are not the intended addressee of this message, please cancel
> it immediately and inform the sender.
> ********************************
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list