]> git.ipfire.org Git - thirdparty/libvirt.git/commit
driver: Introduce virDriverShouldAutostart()
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Oct 2019 14:57:04 +0000 (16:57 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 8 Oct 2019 14:42:19 +0000 (16:42 +0200)
commitee16a195d97315ba3610b3640d347d3f4a358b55
tree99062a83a072429e742335dd024f54c113ff9e07
parente0b90162c94c45a9b0cf197e45b71f26036725d8
driver: Introduce virDriverShouldAutostart()

Some of objects we manage can be autostarted on libvirtd startup
(e.g. domains, network, storage pools). The idea was that when
the host is started up these objects are started too without need
of user intervention. However, with the latest daemon split and
switch to socket activated, short lived daemons (we put --timeout
120 onto each daemon's command line) this doesn't do what we want
it to. The problem is not new though, we already had the session
daemon come and go and we circumvented this problem by
documenting it (see v4.10.0-92-g61b4e8aaf1). But now that we meet
the same problem at all fronts it's time to deal with it.

The solution implemented in this commit is to have a file (one
per each driver) that:

  1) if doesn't exist, is created and autostart is allowed for
     given driver,

  2) if it does exist, then autostart is suppressed for given
     driver.

All the files live in a location that doesn't survive host
reboots (/var/run/ for instance) and thus the file is
automatically not there on fresh host boot.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/driver.c
src/driver.h
src/libvirt_private.syms