[libvirt] [PATCH] Don't log client errors in libvirtd

Eric Blake eblake at redhat.com
Tue Nov 23 19:09:16 UTC 2010


On 11/23/2010 11:53 AM, Matthias Bolte wrote:
> This reverts commit
> 
>   Log all errors at level INFO to stop polluting syslog
>   04bd0360f32ec628ecf7943b3fd1468d6eb2dde5.
> 
> and makes virRaiseErrorFull() only log errors when not inside
> libvirtd. This stops libvirtd from polluting it's own log with
> client errors that'll be reported and logged on the client
> side anyway.
> ---
>  daemon/libvirtd.c        |    2 ++
>  src/libvirt_private.syms |    2 ++
>  src/util/logging.c       |   14 ++++++++++++++
>  src/util/logging.h       |    4 ++++
>  src/util/virterror.c     |   22 ++++++++++++++++++++--
>  5 files changed, 42 insertions(+), 2 deletions(-)

Makes sense to me, and fixes the testsuite failures, but I'd recommend
that you also wait for Dan's opinion before you push it.

> 
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
> index 66f1388..0b75624 100644
> --- a/daemon/libvirtd.c
> +++ b/daemon/libvirtd.c
> @@ -3083,6 +3083,8 @@ int main(int argc, char **argv) {
>          exit(EXIT_FAILURE);
>      }
>  
> +    virLogSetDaemonMode(true);
> +

Hmm, should this line be relocated into daemonForkIntoBackground(), so
that if you manually run libvirtd in the foreground, you still get
messages, and it is only when running libvirtd -d by the system that we
enable daemon-mode logging?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101123/dc284425/attachment-0001.sig>


More information about the libvir-list mailing list