[Libvir] Remote daemon & virDomainFree interaction

Daniel P. Berrange berrange at redhat.com
Tue Jul 24 01:38:40 UTC 2007


In looking at a problem with domain object cleanup in virt-manager I came 
across a problem in the remote driver, well the internal driver API itself
actually. Specifically the implmenetation of virDomainFree() never calls
into the driver API - it simply uses virFreeDomain() release the memory
associated with the virDomainPtr object. 

Couple this with the remote driver though, and virDomainPtr objects in the
remote daemon never get released, because the virDomainFree call is never
propagated over the wire to the server.

Its quite easy to see this in practice. Simply add a printf to the impl
of virDomainLookupByName which prints out the ref count. Then run either
virsh or virt-manager for a while

  Get info QEMUGuest1 69 c7a5fdbd-edaf-9455-926a-d65c16db1809
  Get info QEMUGuest1 70 c7a5fdbd-edaf-9455-926a-d65c16db1809
  Get info QEMUGuest1 71 c7a5fdbd-edaf-9455-926a-d65c16db1809

We need to make virDomainFree call into the driver API, and also make sure
that the remote driver implements it.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 




More information about the libvir-list mailing list