vz: introduce virtvzd daemon

The virtvzd daemon will be responsible for providing the vz API
driver functionality. The vz driver is still loaded by the main
libvirtd daemon at this stage, so virtvzd must not be running at
the same time.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-03-16 17:05:24 +00:00
parent b90e2c3923
commit b28fd43a5e
3 changed files with 92 additions and 0 deletions

4
.gitignore vendored
View File

@ -217,7 +217,11 @@
/src/virtsecretd
/src/virtstoraged
/src/virtvboxd
/src/virtvzd
/src/virt-guest-shutdown.target
/src/vz/test_virtvzd.aug
/src/vz/virtvzd.aug
/src/vz/virtvzd.conf
/tests/*.log
/tests/*.pid
/tests/*.trs

View File

@ -37,4 +37,67 @@ libvirt_driver_vz_impl_la_LIBADD = \
$(PARALLELS_SDK_LIBS) \
$(LIBNL_LIBS) \
$(NULL)
sbin_PROGRAMS += virtvzd
nodist_conf_DATA += vz/virtvzd.conf
augeas_DATA += vz/virtvzd.aug
augeastest_DATA += vz/test_virtvzd.aug
CLEANFILES += vz/virtvzd.aug
virtvzd_SOURCES = $(REMOTE_DAEMON_SOURCES)
virtvzd_CFLAGS = \
$(REMOTE_DAEMON_CFLAGS) \
-DDAEMON_NAME="\"virtvzd\"" \
-DMODULE_NAME="\"vz\"" \
$(NULL)
virtvzd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS)
virtvzd_LDADD = $(REMOTE_DAEMON_LD_ADD)
SYSTEMD_UNIT_FILES += \
virtvzd.service \
virtvzd.socket \
virtvzd-ro.socket \
virtvzd-admin.socket \
$(NULL)
SYSTEMD_UNIT_FILES_IN += \
vz/virtvzd.service.in \
$(NULL)
VIRTVZD_UNIT_VARS = \
$(VIRTD_UNIT_VARS) \
-e 's|[@]name[@]|Libvirt vz|g' \
-e 's|[@]service[@]|virtvzd|g' \
-e 's|[@]sockprefix[@]|virtvzd|g' \
$(NULL)
virtvzd.service: vz/virtvzd.service.in $(top_builddir)/config.status
$(AM_V_GEN)$(SED) $(VIRTVZD_UNIT_VARS) $< > $@-t && mv $@-t $@
virtvz%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status
$(AM_V_GEN)$(SED) $(VIRTVZD_UNIT_VARS) $< > $@-t && mv $@-t $@
vz/virtvzd.conf: remote/libvirtd.conf.in
$(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtvzd/' \
$< > $@
vz/virtvzd.aug: remote/libvirtd.aug.in
$(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtvzd/' \
-e 's/[@]DAEMON_NAME_UC[@]/Virtvzd/' \
$< > $@
vz/test_virtvzd.aug: remote/test_libvirtd.aug.in \
vz/virtvzd.conf $(AUG_GENTEST)
$(AM_V_GEN)$(AUG_GENTEST) vz/virtvzd.conf \
$(srcdir)/remote/test_libvirtd.aug.in | \
$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtvzd/' \
-e 's/[@]DAEMON_NAME_UC[@]/Virtvzd/' \
> $@ || rm -f $@
endif WITH_VZ

25
src/vz/virtvzd.service.in Normal file
View File

@ -0,0 +1,25 @@
[Unit]
Description=Virtualization vz daemon
Conflicts=libvirtd.service
Requires=virtvzd.socket
Requires=virtvzd-ro.socket
Requires=virtvzd-admin.socket
After=network.target
After=dbus.service
After=apparmor.service
After=local-fs.target
After=remote-fs.target
Documentation=man:libvirtd(8)
Documentation=https://libvirt.org
[Service]
Type=notify
ExecStart=@sbindir@/virtvzd --timeout 120
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
Also=virtvzd.socket
Also=virtvzd-ro.socket
Also=virtvzd-admin.socket