diff options
author | Martin Kletzander <mkletzan@redhat.com> | 2021-12-15 16:35:41 +0100 |
---|---|---|
committer | Martin Kletzander <mkletzan@redhat.com> | 2022-01-05 14:08:39 +0100 |
commit | a873924e36b28c5b125621e35b32beb6b077bcc8 (patch) | |
tree | 14a8731d81a54e71ea4a1b06d4103d6e22730143 /src/remote | |
parent | b8630854930266a504d955de3c7ab661f0619345 (diff) | |
download | libvirt-a873924e36b28c5b125621e35b32beb6b077bcc8.tar.gz |
Exit on errors from virDaemonSetupLogging
This prevents starting any daemons with improper logging settings. This is
desirable on its own, but will be even more beneficial when more functions start
reporting errors and failing on them, coming up in following patches
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Diffstat (limited to 'src/remote')
-rw-r--r-- | src/remote/remote_daemon.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index 4e10f3ad23..8a4610da83 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -936,13 +936,14 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - virDaemonSetupLogging(DAEMON_NAME, - config->log_level, - config->log_filters, - config->log_outputs, - privileged, - verbose, - godaemon); + if (virDaemonSetupLogging(DAEMON_NAME, + config->log_level, + config->log_filters, + config->log_outputs, + privileged, + verbose, + godaemon) < 0) + exit(EXIT_FAILURE); /* Let's try to initialize global variable that holds the host's boot time. */ if (virHostBootTimeInit() < 0) { |