[Libvirt-cim] [PATCH 2/2] ComputerSystemIndication: Support libvirt domain events

Eduardo Lima (Etrunko) eblima at linux.vnet.ibm.com
Mon Jan 2 11:39:58 UTC 2012


On 12/30/2011 10:26 PM, Chip Vincent wrote:

> It appears there is a bug causing a crash somewhere between
> virConnectDomainEventRegisterAny() and here. Disabling this
> section of code avoids the crashes I mentioned
> (https://www.redhat.com/archives/libvirt-cim/2011-December/msg00086.html).
> Of course, that effectively disables much more code... baby steps.
> NOTE: I have yet to get a meaningful backtrace, which suggests some
> memory or stack corruption and the functions in the backtrace are likely a
> victim. I'm looking at the list handling code now.

Threads, threads... :/

>> -        fail:
>> -                if (failure) {
>> -                        wait_for_event(FAIL_WAIT_TIME);
>> -                } else {
>> -                        free(prev_xml);
>> -                        prev_xml = cur_xml;
>> -                        prev_count = cur_count;
>>
>> -                        wait_for_event(WAIT_TIME);
>> +        CU_DEBUG("Entering CSI event loop (%s)", prefix);
>> +        while (thread->active_filters>  0) {
>> +                if (virEventRunDefaultImpl()<  0) {
>> +                        virErrorPtr err = virGetLastError();
>> +                        CU_DEBUG("Failed to run event loop: %s\n",
>> +                        err&&  err->message ? err->message : "Unknown
>> error");
>>                   }
>>           }
> I believe you need to call CBDetachThread() here so that CMPI can clean-up
> objects created during the thread's lifecycle. Otherwise, it will appear
> like
> a leak since the CIMOM and Indication Providers run indefinitely.
> 

Thanks for the insight. I felt that this call to CBDetachThread was
missing at first, but the original implementation did not include it so
I left it behind.

-- 
Eduardo de Barros Lima
Software Engineer, Open Virtualization
Linux Technology Center - IBM/Brazil
eblima at br.ibm.com




More information about the Libvirt-cim mailing list