[libvirt] [PATCH] Free object after *Destroy in python bindings

Cole Robinson crobinso at redhat.com
Mon May 19 20:21:55 UTC 2008


Cole Robinson wrote:
> The patch below fixes an issue in the python bindings with the
> vir*Destroy methods. After the object is successfully destroyed,
> the payload is cleared, using 'self._o = None'. This unfortunately
> screws up virt object reference counts, as the payload should be 
> free'd using the appropriate vir*Free function.
> 

Hmm, I might be wrong about this. Reading the virDomainDestroy
description in libvirt.c, destroy is supposed to free the
domain object if the operation is successful. The qemu driver
currently does not do this. In fact, from what I gather, none
of the drivers do this.

If the virDomainDestroy comment is correct, then the original
python statement is sufficient, but the drivers need to have
a few virDomainFree's added.

Anybody have more info on this?

Thanks,
Cole




More information about the libvir-list mailing list