]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Fix up connection reference counting.
authorChris Lalancette <clalance@redhat.com>
Tue, 11 Aug 2009 13:48:59 +0000 (15:48 +0200)
committerChris Lalancette <clalance@redhat.com>
Tue, 18 Aug 2009 07:26:26 +0000 (09:26 +0200)
commitcb51aa48a777ddae6997faa9f28350cb62655ffd
tree713a099b760276ae680f9a5e6bc2da3da59870a2
parente403f8d43e0f333575110c20557df3be24bcc2d3
Fix up connection reference counting.

Currently the reference counting for connections is busted.  I
first noticed it while trying to use virConnectRef; it would
eventually cause a crash in the remote_internal driver, although
that was really just a victim.  Really, we should only call the
close callbacks on the methods when the references drop to 0.  To
accomplish this, move all of the close callbacks into
virUnrefConnect (since there are lots of internal users of that
function), and arrange for virConnectClose to call that.

V2: Make sure to drop the connection lock before we call the close
    callbacks, otherwise we could deadlock the daemon
V3: Fix up a crash when we got an error from one of the drivers

Signed-off-by: Chris Lalancette <clalance@redhat.com>
src/datatypes.c
src/libvirt.c