On 03/17/2011 01:41 AM, Daniel Veillard wrote:
As pointed out, locking the buffer from the signal handler
cannot been garanteed to be safe, so to avoid any hazard
s/garanteed/guaranteed/
we prefer the trade off of dumping logs possibly messed up
by concurrent logging activity rather than risk a daemon
crash.
* src/util/logging.c: change virLogEmergencyDumpAll() to not
take any lock on the log buffer but reset buffer content variables
+ /*
+ * Since we can't lock the buffer safely from a signal
handler
+ * we mark it as empty in case of concurrent access, and proceed
+ * with the data, at worse we will output something a bit weird
+ * if another thread start logging messages at the same time.
+ * Note that virLogStr() uses virLogEnd for the computations and
+ * writes to the buffer and then only update virLogLen and virLogStart
s/then only update/only then updates/
ACK with those nits fixed.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org