]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: Fix race between destruction of objects
authorJim Fehlig <jfehlig@suse.com>
Mon, 21 Jan 2013 17:22:07 +0000 (10:22 -0700)
committerJim Fehlig <jfehlig@suse.com>
Fri, 25 Jan 2013 18:31:35 +0000 (11:31 -0700)
commit889ce7460c706a8528bce444827261b288280490
treee19ed3f7d97bd967e37905c28d0e4957a9208f3a
parente0622ca28163f2b4a5fbf40266bbc30986acee14
libxl: Fix race between destruction of objects

It is possible to destroy and cleanup a VM, resulting in freeing the
libxlDomainObjPrivate object and associated libxl ctx, before all fds and
timeouts have been deregistered and destroyed.

Fix this race by incrementing the reference count on libxlDomainObjPrivate
for each fd and timeout registration.  Only when all fds and timeouts are
deregistered and destroyed will the libxlDomainObjPrivate be destroyed.
src/libxl/libxl_driver.c