]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Ensure error handling callback functions are called from safe context
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 30 Sep 2009 15:11:47 +0000 (16:11 +0100)
committerCole Robinson <crobinso@redhat.com>
Tue, 12 Jan 2010 15:48:33 +0000 (10:48 -0500)
commit3a80f2f7ce6bfa836ef91b1cab09e12b369c0392
treee42263187b9287072b76fc89427c68d45e63d173
parent66b3250563a7da13e7bc97e1e5d9d4ac4009c697
Ensure error handling callback functions are called from safe context

The virRaiseErrorFull() may invoke the error handler callback
functions an application has registered. This is not good
because the connection object may not be available at this
point, and the caller may be holding locks. This creates a
problem if the error handler calls back into libvirt.

The solutuon is to move invocation of the handler into the
final cleanup code in the public API entry points, where it
is guarenteed to have safe state.

* src/libvirt.c: Invoke virDispatchError() in all error paths
* src/util/virterror.c: Remove virSetConnError/virSetGlobalError,
  replacing with virDispatchError(). Move invocation of the
  error callbacks into virDispatchError() instead of the
  virRaiseErrorFull function which is not in a safe context
src/libvirt.c
src/util/virterror.c
src/util/virterror_internal.h