libvirt/src/admin
Martin Kletzander 9f6749dea0 util: Check for errors in virLogSetFromEnv
And make callers check the return value as well.  This helps error out early for
invalid environment variables.

That is desirable because it could lead to deadlocks.  This can happen when
resetting logging after fork() reports translated errors because gettext
functions are not reentrant.  Well, it is not limited to resetting logging after
fork(), it can be any translation at that phase, but parsing environment
variables is easy to make fail on purpose to show the result, it can also happen
just due to a typo.

Before this commit it is possible to deadlock the daemon on startup
with something like:

LIBVIRT_LOG_FILTERS='1:*' LIBVIRT_LOG_OUTPUTS=1:stdout libvirtd

where filters are used to enable more logging and hence make the race less rare
and outputs are set to invalid

Combined with the previous patches this changes
the following from:

...
<deadlock>

to:

...
libvirtd: initialisation failed

The error message is improved in future commits and is also possible thanks to
this patch.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-01-05 14:08:40 +01:00
..
admin_protocol.x admin: Introduce virAdmServerUpdateTlsFiles 2020-03-13 17:07:32 +00:00
admin_remote.c rpc: remove "spawnDaemon" parameter 2021-06-04 11:42:59 +01:00
admin_server_dispatch.c lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
admin_server_dispatch.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
admin_server.c adminConnectListServers: Cleanup 2021-11-08 14:32:32 +01:00
admin_server.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
libvirt_admin_private.syms Remove references to deleted Makefile.am 2021-04-13 11:21:00 +02:00
libvirt_admin_public.syms admin: Introduce virAdmServerUpdateTlsFiles 2020-03-13 17:07:32 +00:00
libvirt-admin.c util: Check for errors in virLogSetFromEnv 2022-01-05 14:08:40 +01:00
libvirt-admin.conf build: move admin code into admin directory 2019-10-23 14:30:58 +02:00
meson.build admin: Build only when RPC is available 2021-12-15 12:12:44 +01:00