[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] PATCH: Add persistent guest & hv logging in xenconsoled

The attached patch adds the persistent logging to the xenconsoled daemon.

  * The  --log  command line argument takes one of 4 values

      - none   - no logging   (the default)
      - hv     - log all hypervisor messages
      - guest  - log all guest messages
      - both   - log all guest & hypervisor messages

  * The --log-dir command line argument takes a path to specify where
    to store logfiles. If omitted it defaults to /var/log/xen/console

  * The hypervisor logfile is $LOGDIR/hypervisor.log

  * The guest logfile is  $LOGDIR/guest-[NAME].log

  * If receiving a SIGHUP it will close & re-open all log files to
    enable logrotate to do its magic

  * Fixes the permissions of /var/run/xenconsoled.pid

  * Adds a --pid-file command line argument to override the default
    location of pid file (this is not really related to logging, but
    since i was in that code...)

  Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

The patch was done against 3.1.0  codebase, but applies against todays
xen-unstable.hg - though I see alot of stuff pending in the staging
tree, hopefully it won't break it.

There are 2 open questions....

The first is how to configure & pass the --log arg to xenconsoled. In the
upstream xen codebase the various daemons (xenstore, xenconsoled, etc)
are all forked by the tools/misc/xend script (typically in /usr/sbin/xend).
In Fedora we're intending to ditch this script & just start each daemon
directly from the init script & thus we can use /etc/sysconfig/xend to
configure the logging args. Solaris also doesn't use that tools/misc/xend
script IIRC, having their own scripts for stopping/starting distros. So
in this patch I've not made any attempt to provide a way to actually pass
the --log arg to xenconsoled, leaving such decisions upto the distro
packagers. Any alternate ideas are welcome...

When logging hypervisor data we call xc_readconsolering to fetch the data.
Since we don't want to log the same data over & over again we have to tell
it to clear the console. So if you enable hypervisor logging in xenconsoled,
then 'xm dmesg' will no longer show you any data. Personally I don't have
any problem with this, but if there's a way to reliably consume hypervisor 
logs in an incremental manner without having to clear the data I'm open
to suggestions...

|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Attachment: xen-console-log.patch
Description: Text document

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.