Rewrite syslog logging output to be async signal safe
The current libvirt logging code support for outputting syslog, just uses the regular C library syslog()
function. The problem is that this function is not async signal safe, mostly because of its use of the sprintf
family of functions internally. Annoyingly libvirt does not even need printf
support here, because it has already expanded the log message string.
Secondary problems are that syslog()
only logs to a local syslog service. It might be desirable to let it log directly to a remote syslog over TCP or UDP.
The syslog protocol is very straightforward, so the use of syslog()
could easily be replaced by direct sockets calls.