]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
libxl: Fix races in libxl event code
authorJim Fehlig <jfehlig@suse.com>
Mon, 21 Jan 2013 17:09:05 +0000 (10:09 -0700)
committerJim Fehlig <jfehlig@suse.com>
Fri, 25 Jan 2013 18:31:19 +0000 (11:31 -0700)
commite0622ca28163f2b4a5fbf40266bbc30986acee14
treee4a01a0fb6bc1e8d4e059c977b531b0e7a21de2a
parent04172610c0630201626b837a05722d40bdae2aa6
libxl: Fix races in libxl event code

The libxl driver is racy in it's interactions with libxl and libvirt's
event loop.  The event loop can invoke callbacks after libxl has
deregistered the event, and possibly access freed data associated with
the event.

This patch fixes the race by converting libxlDomainObjPrivate to a
virObjectLockable, and locking it while executing libxl upcalls and
libvirt event loop callbacks.

Note that using the virDomainObj lock is not satisfactory since it may
be desirable to hold the virDomainObj lock even when libxl events such
as reading and writing to xenstore need processed.
src/libxl/libxl_conf.h
src/libxl/libxl_driver.c