
On Sat, Feb 10, 2018 at 09:02:59AM +0100, Michal Privoznik wrote:
After 759b4d1b0fe5f we are getting hostname in virLogOnceInit(). Problem with this approach is in the NSS module because the module calls some internal APIs which occasionally want to log something. This results in virLogInitialize() to be called which in turn ends up calling virGetHostnameQuiet() and effectively the control gets to NSS plugin again which calls some internal APIs which occasionally want to log something. You can see the deadlock now.
One way out from this is to turn logging into no-op. Which kind of makes sense - the NSS module shouldn't log anything. To achieve this, the virLogVMessage() function is provided with separate no-op implementation if DISABLE_LOGGING_FOR_NSS macro is set.
It shouldn't log anything in normal usage, but I could see the ability to turn on logging as useful if debugging something in the NSS module. So don't think we should compile it out. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|