The virtqemud daemon will be responsible for providing the qemu API
driver functionality. The qemu driver is still loaded by the main
libvirtd daemon at this stage, so virtqemud must not be running at
the same time.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitignore | 4 +++
libvirt.spec.in | 8 +++++
src/qemu/Makefile.inc.am | 61 +++++++++++++++++++++++++++++++++++
src/qemu/virtqemud.service.in | 24 ++++++++++++++
4 files changed, 97 insertions(+)
create mode 100644 src/qemu/virtqemud.service.in
diff --git a/.gitignore b/.gitignore
index 1c746cec44..d23ffa94f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -170,6 +170,9 @@
/src/nwfilter/virtnwfilterd.aug
/src/nwfilter/virtnwfilterd.conf
/src/qemu/test_libvirtd_qemu.aug
+/src/qemu/test_virtqemud.aug
+/src/qemu/virtqemud.aug
+/src/qemu/virtqemud.conf
/src/remote/*_client_bodies.h
/src/remote/*_protocol.[ch]
/src/remote/*_stubs.h
@@ -198,6 +201,7 @@
/src/virtnodedevd
/src/virtnwfilterd
/src/virtproxyd
+/src/virtqemud
/src/virtsecretd
/src/virtstoraged
/src/virt-guest-shutdown.target
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 06e8666bc5..7d2597e3dd 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1735,6 +1735,14 @@ exit 0
%if %{with_qemu}
%files daemon-driver-qemu
+%config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
+%{_datadir}/augeas/lenses/virtqemud.aug
+%{_datadir}/augeas/lenses/tests/test_virtqemud.aug
+%{_unitdir}/virtqemud.service
+%{_unitdir}/virtqemud.socket
+%{_unitdir}/virtqemud-ro.socket
+%{_unitdir}/virtqemud-admin.socket
+%attr(0755, root, root) %{_sbindir}/virtqemud
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am
index 12236a9e7b..c343c4d597 100644
--- a/src/qemu/Makefile.inc.am
+++ b/src/qemu/Makefile.inc.am
@@ -112,6 +112,67 @@ CLEANFILES += \
endif WITH_DTRACE_PROBES
+sbin_PROGRAMS += virtqemud
+
+nodist_conf_DATA += qemu/virtqemud.conf
+augeas_DATA += qemu/virtqemud.aug
+augeastest_DATA += qemu/test_virtqemud.aug
+CLEANFILES += qemu/virtqemud.aug
+
+virtqemud_SOURCES = $(REMOTE_DAEMON_SOURCES)
+virtqemud_CFLAGS = \
+ $(REMOTE_DAEMON_CFLAGS) \
+ -DDAEMON_NAME="\"virtqemud\"" \
+ -DMODULE_NAME="\"qemu\"" \
+ $(NULL)
+virtqemud_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS)
+virtqemud_LDADD = $(REMOTE_DAEMON_LD_ADD)
+
+SYSTEMD_UNIT_FILES += \
+ virtqemud.service \
+ virtqemud.socket \
+ virtqemud-ro.socket \
+ virtqemud-admin.socket \
+ $(NULL)
+SYSTEMD_UNIT_FILES_IN += \
+ qemu/virtqemud.service.in \
+ $(NULL)
+
+VIRTQEMUD_UNIT_VARS = \
+ $(VIRTD_UNIT_VARS) \
+ -e 's|[@]name[@]|Libvirt qemu|g' \
+ -e 's|[@]service[@]|virtqemud|g' \
+ -e 's|[@]sockprefix[@]|virtqemud|g' \
+ $(NULL)
+
+virtqemud.service: qemu/virtqemud.service.in $(top_builddir)/config.status
+ $(AM_V_GEN)sed $(VIRTQEMUD_UNIT_VARS) < $< > $@-t && mv $@-t $@
+
+virtqemu%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status
+ $(AM_V_GEN)sed $(VIRTQEMUD_UNIT_VARS) < $< > $@-t && mv $@-t $@
+
+qemu/virtqemud.conf: remote/libvirtd.conf.in
+ $(AM_V_GEN)sed \
+ -e '/:: CUT ENABLE_IP ::/,/:: END ::/d' \
+ -e 's/:: DAEMON_NAME ::/virtqemud/' \
+ < $^ > $@
+
+qemu/virtqemud.aug: remote/libvirtd.aug.in
+ $(AM_V_GEN)$(SED) \
+ -e '/:: CUT ENABLE_IP ::/,/:: END ::/d' \
+ -e 's/:: DAEMON_NAME ::/virtqemud/' \
+ -e 's/:: DAEMON_NAME_UC ::/Virtqemud/' \
+ $< > $@
+
+qemu/test_virtqemud.aug: remote/test_libvirtd.aug.in \
+ qemu/virtqemud.conf $(AUG_GENTEST)
+ $(AM_V_GEN)$(AUG_GENTEST) qemu/virtqemud.conf \
+ $(srcdir)/remote/test_libvirtd.aug.in | \
+ $(SED) -e '/:: CUT ENABLE_IP ::/,/:: END ::/d' \
+ -e 's/:: DAEMON_NAME ::/virtqemud/' \
+ -e 's/:: DAEMON_NAME_UC ::/Virtqemud/' \
+ > $@ || rm -f $@
+
conf_DATA += qemu/qemu.conf
augeas_DATA += qemu/libvirtd_qemu.aug
diff --git a/src/qemu/virtqemud.service.in b/src/qemu/virtqemud.service.in
new file mode 100644
index 0000000000..124abfe2fd
--- /dev/null
+++ b/src/qemu/virtqemud.service.in
@@ -0,0 +1,24 @@
+[Unit]
+Description=Virtualization qemu daemon
+Conflicts=libvirtd.service
+Requires=virtqemud.socket
+Requires=virtqemud-ro.socket
+Requires=virtqemud-admin.socket
+After=network.target
+After=dbus.service
+After=apparmor.service
+After=local-fs.target
+Documentation=man:libvirtd(8)
+Documentation=https://libvirt.org
+
+[Service]
+Type=notify
+ExecStart=@sbindir@/virtqemud --timeout 120
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+Also=virtqemud.socket
+Also=virtqemud-ro.socket
+Also=virtqemud-admin.socket
--
2.21.0