libvirt/src/rpc
Michal Privoznik a42b46dd7d virnetdaemon: Wait for "daemon-stop" thread to finish before quitting
When the host is shutting down then we get PrepareForShutdown
signal on DBus to which we react by creating a thread which
runs virStateStop() and thus qemuStateStop(). But if scheduling
the thread is delayed just a but it may happen that we receive
SIGTERM (sent by systemd) to which we respond by quitting our
event loop and cleaning up everything (including drivers). And
only after that the thread gets to run only to find qemu_driver
being NULL.

What we can do is to delay exiting event loop and join the thread
that's executing virStateStop(). If the join doesn't happen in
given timeout (currently 30 seconds) then libvirtd shuts down
forcefully anyways (see virNetDaemonRun()).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1895359
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1739564

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-11-24 17:52:54 +01:00
..
gendispatch.pl gendispatch: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
genprotocol.pl src: remove all traces of Cygwin support 2020-01-29 14:51:40 +00:00
meson.build src/rpc/virnetdaemon: convert to use GLib DBus 2020-09-17 18:20:32 +02:00
virkeepalive.c rpc: use G_GNUC_UNUSED 2019-10-15 11:25:24 +02:00
virkeepalive.h src/rpc: use #pragma once in headers 2019-06-19 17:12:30 +02:00
virkeepaliveprotocol.x
virnetclient.c rpc: Fix virt-ssh-helper detection 2020-10-27 10:30:18 +01:00
virnetclient.h rpc: use new virt-ssh-helper binary for remote tunnelling 2020-09-09 16:46:22 +01:00
virnetclientprogram.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetclientprogram.h src/rpc: use #pragma once in headers 2019-06-19 17:12:30 +02:00
virnetclientstream.c rpc: use G_GNUC_UNUSED 2019-10-15 11:25:24 +02:00
virnetclientstream.h src/rpc: use #pragma once in headers 2019-06-19 17:12:30 +02:00
virnetdaemon.c virnetdaemon: Wait for "daemon-stop" thread to finish before quitting 2020-11-24 17:52:54 +01:00
virnetdaemon.h virnetdaemon: Wait for "daemon-stop" thread to finish before quitting 2020-11-24 17:52:54 +01:00
virnetlibsshsession.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetlibsshsession.h rpc: Make some functions void 2020-05-05 13:08:48 +02:00
virnetmessage.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetmessage.h Use G_GNUC_WARN_UNUSED_RESULT instead of ATTRIBUTE_RETURN_CHECK 2019-10-15 11:25:22 +02:00
virnetprotocol.x src: convert all code to use virsocket.h 2020-01-29 14:51:40 +00:00
virnetsaslcontext.c rpc: remove use of the term 'whitelist' from RPC code 2020-06-26 15:36:40 +01:00
virnetsaslcontext.h rpc: remove use of the term 'whitelist' from RPC code 2020-06-26 15:36:40 +01:00
virnetserver.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetserver.h rpc: add shutdown facilities to netserver 2020-09-07 09:33:59 +03:00
virnetserverclient.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetserverclient.h remote_daemon_stream: Fix @client locking in daemonStreamFilter() 2019-11-19 16:09:53 +01:00
virnetserverprogram.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetserverprogram.h src/rpc: use #pragma once in headers 2019-06-19 17:12:30 +02:00
virnetserverservice.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetserverservice.h rpc: remove unused API for creating services from FDs 2019-07-12 16:55:40 +01:00
virnetsocket.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetsocket.h remote: introduce virt-ssh-helper binary 2020-09-09 16:46:22 +01:00
virnetsshsession.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnetsshsession.h rpc: Make some functions void 2020-05-05 13:08:48 +02:00
virnettlscontext.c rpc: use g_new0 instead of VIR_ALLOC 2020-10-01 17:32:15 +02:00
virnettlscontext.h rpc: remove use of the term 'whitelist' from RPC code 2020-06-26 15:36:40 +01:00