提交 bb1021e3 编写于 作者: D Daniel P. Berrangé

qemu: introduce virtqemud daemon

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.
Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 12e30d1e
......@@ -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
......@@ -199,6 +202,7 @@
/src/virtnodedevd
/src/virtnwfilterd
/src/virtproxyd
/src/virtqemud
/src/virtsecretd
/src/virtstoraged
/src/virt-guest-shutdown.target
......
......@@ -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
......
......@@ -112,6 +112,68 @@ 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
......
[Unit]
Description=Virtualization qemu daemon
Conflicts=libvirtd.service
Requires=virtqemud.socket
Requires=virtqemud-ro.socket
Requires=virtqemud-admin.socket
Wants=systemd-machined.service
Before=libvirt-guests.service
After=network.target
After=dbus.service
After=apparmor.service
After=local-fs.target
After=remote-fs.target
After=systemd-logind.service
After=systemd-machined.service
Documentation=man:libvirtd(8)
Documentation=https://libvirt.org
[Service]
Type=notify
ExecStart=@sbindir@/virtqemud --timeout 120
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent).
# eg if we want to support 4096 guests, we'll typically need 8192 FDs
# If changing this, also consider virtlogd.service & virtlockd.service
# limits which are also related to number of guests
LimitNOFILE=8192
# The cgroups pids controller can limit the number of tasks started by
# the daemon, which can limit the number of domains for some hypervisors.
# A conservative default of 8 tasks per guest results in a TasksMax of
# 32k to support 4096 guests.
TasksMax=32768
[Install]
WantedBy=multi-user.target
Also=virtqemud.socket
Also=virtqemud-ro.socket
Also=virtqemud-admin.socket
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册