Daniel Veillard wrote:
On Tue, Nov 27, 2007 at 12:28:26PM -0700, Dan Smith wrote:
> This refactors all of the necessary functions in libvirt-cim for the new
> API. Things only got cleaner, I think. I also found a substantial number
> of memory leaks in the process, which are fundamentally fixed by the new
> API which I think is a validation of it as "the right thing to do". All
> required changes should have been easily spotted by the compiler, but some
> testing would be good.
>
> Tip: To find the leaks, note every time we convert a variable from
> char * to const char * and don't remove a subsequent free() call :)
>
Hum, for normal code we usually rely on valgrind to find leaks in
the code, for example by instrumenting test program using the code
as part of soem regression tests, but with the way CIM providers are
used it looks harder to do this.
You can start the CIMOM with valgrind (e.g. "valgrind cimserver" or
"valgrind sfcbd"), but the output is really hard to read.
Or would it be possible to design a minimal C(++) program loading
the /usr/lib*/cmpi/ shared libraries exercising them locally ?
Mhh, I suppose in that case we would write another tiny CIMOM.
Maybe this exists already, an in general how can we design
regression
tests for libvirt-cim sounds something worth spending time on :-)
absolutely
Ideas, opinion, or tools pointer anyone ?
Daniel
--
Regards
Heidi Eckhart
Software Engineer
Linux Technology Center - Open Hypervisor
heidieck(a)linux.vnet.ibm.com
**************************************************
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294