[libvirt] RFC move logging initialization earlier in libvirtd

Daniel P. Berrange berrange at redhat.com
Wed Nov 11 07:47:27 UTC 2009

On Tue, Nov 10, 2009 at 01:58:52PM -0500, Dave Allan wrote:
> Daniel P. Berrange wrote:
> >On Tue, Nov 10, 2009 at 11:32:29AM -0500, Dave Allan wrote:
> >>I noticed yesterday that logging gets initialized fairly far into the 
> >>libvirtd startup process, so messages generated during server startup 
> >>don't get logged to the same sinks that will be used for the rest of the 
> >>life of the daemon.  I'd like to explore moving the logging startup to 
> >>an earlier point.  Has this idea been explored previously?
> >
> >Is this still true with latest GIT ?
> >
> >When i re-arranged the libvirtd startup code last week I think I may
> >have accidentely fixed the issue. Previously the libvirt drivers would
> >get initialized in the qemudInitialize() call, and this was done before
> >loading the libvirtd config file and thus before logging was setup.
> >With latest code, driver initialization is moved out of qemudInitialize
> >and is absolutely the last thing libvirtd does during startup. There's
> >not really any way to move the logging configuration further forward
> >than it is now
> >
> >Daniel
> I just confirmed that it is the case with the latest git.  I'm trying to 
> finish up the udev code today, so I'm not going to look into it now, but 
> I did check to see that the udev register function is called before the 
> first call to virLogDefineOutput.  Maybe that's not the right test, though.

The register function will always be the very first thing to be called in
libvirt, before everything else. That is ok though, because the register
funtions only ever add the driver to the driver table, they don't actually
do any initialization. Only later on does the 'virDrvStateInitialize'
function get invoked to do the real work, and logging is enabled by that

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvir-list mailing list