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

network: introduce virtnetworkd daemon

The virtnetworkd daemon will be responsible for providing the network API
driver functionality. The network driver is still loaded by the main
libvirtd daemon at this stage, so virtnetworkd must not be running at
the same time.
Reviewed-by: NChristophe de Dinechin <dinechin@redhat.com>
Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 d353d57f
...@@ -154,6 +154,9 @@ ...@@ -154,6 +154,9 @@
/src/lxc/lxc_monitor_protocol.h /src/lxc/lxc_monitor_protocol.h
/src/lxc/lxc_protocol.[ch] /src/lxc/lxc_protocol.[ch]
/src/lxc/test_libvirtd_lxc.aug /src/lxc/test_libvirtd_lxc.aug
/src/network/test_virtnetworkd.aug
/src/network/virtnetworkd.aug
/src/network/virtnetworkd.conf
/src/qemu/test_libvirtd_qemu.aug /src/qemu/test_libvirtd_qemu.aug
/src/remote/*_client_bodies.h /src/remote/*_client_bodies.h
/src/remote/*_protocol.[ch] /src/remote/*_protocol.[ch]
...@@ -175,6 +178,7 @@ ...@@ -175,6 +178,7 @@
/src/virt-aa-helper /src/virt-aa-helper
/src/virtlockd /src/virtlockd
/src/virtlogd /src/virtlogd
/src/virtnetworkd
/src/virtproxyd /src/virtproxyd
/src/virtsecretd /src/virtsecretd
/src/virt-guest-shutdown.target /src/virt-guest-shutdown.target
......
...@@ -1612,6 +1612,14 @@ exit 0 ...@@ -1612,6 +1612,14 @@ exit 0
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so %{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so
%files daemon-driver-network %files daemon-driver-network
%config(noreplace) %{_sysconfdir}/libvirt/virtnetworkd.conf
%{_datadir}/augeas/lenses/virtnetworkd.aug
%{_datadir}/augeas/lenses/tests/test_virtnetworkd.aug
%{_unitdir}/virtnetworkd.service
%{_unitdir}/virtnetworkd.socket
%{_unitdir}/virtnetworkd-ro.socket
%{_unitdir}/virtnetworkd-admin.socket
%attr(0755, root, root) %{_sbindir}/virtnetworkd
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
......
...@@ -49,6 +49,68 @@ libvirt_driver_network_impl_la_CFLAGS = \ ...@@ -49,6 +49,68 @@ libvirt_driver_network_impl_la_CFLAGS = \
libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES) libvirt_driver_network_impl_la_SOURCES = $(NETWORK_DRIVER_SOURCES)
libvirt_driver_network_impl_la_LIBADD = $(DBUS_LIBS) $(LIBXML_LIBS) libvirt_driver_network_impl_la_LIBADD = $(DBUS_LIBS) $(LIBXML_LIBS)
sbin_PROGRAMS += virtnetworkd
nodist_conf_DATA += network/virtnetworkd.conf
augeas_DATA += network/virtnetworkd.aug
augeastest_DATA += network/test_virtnetworkd.aug
CLEANFILES += network/virtnetworkd.aug
virtnetworkd_SOURCES = $(REMOTE_DAEMON_SOURCES)
virtnetworkd_CFLAGS = \
$(REMOTE_DAEMON_CFLAGS) \
-DDAEMON_NAME="\"virtnetworkd\"" \
-DMODULE_NAME="\"network\"" \
$(NULL)
virtnetworkd_LDFLAGS = $(REMOTE_DAEMON_LD_FLAGS)
virtnetworkd_LDADD = $(REMOTE_DAEMON_LD_ADD)
SYSTEMD_UNIT_FILES += \
virtnetworkd.service \
virtnetworkd.socket \
virtnetworkd-ro.socket \
virtnetworkd-admin.socket \
$(NULL)
SYSTEMD_UNIT_FILES_IN += \
network/virtnetworkd.service.in \
$(NULL)
VIRTNETWORKD_UNIT_VARS = \
$(VIRTD_UNIT_VARS) \
-e 's|[@]name[@]|Libvirt network|g' \
-e 's|[@]service[@]|virtnetworkd|g' \
-e 's|[@]sockprefix[@]|virtnetworkd|g' \
$(NULL)
virtnetworkd.service: network/virtnetworkd.service.in $(top_builddir)/config.status
$(AM_V_GEN)$(SED) $(VIRTNETWORKD_UNIT_VARS) $< > $@-t && mv $@-t $@
virtnetwork%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status
$(AM_V_GEN)$(SED) $(VIRTNETWORKD_UNIT_VARS) $< > $@-t && mv $@-t $@
network/virtnetworkd.conf: remote/libvirtd.conf.in
$(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtnetworkd/' \
$< > $@
network/virtnetworkd.aug: remote/libvirtd.aug.in
$(AM_V_GEN)$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtnetworkd/' \
-e 's/[@]DAEMON_NAME_UC[@]/Virtnetworkd/' \
$< > $@
network/test_virtnetworkd.aug: remote/test_libvirtd.aug.in \
network/virtnetworkd.conf $(AUG_GENTEST)
$(AM_V_GEN)$(AUG_GENTEST) network/virtnetworkd.conf \
$(srcdir)/remote/test_libvirtd.aug.in | \
$(SED) \
-e '/[@]CUT_ENABLE_IP[@]/,/[@]END[@]/d' \
-e 's/[@]DAEMON_NAME[@]/virtnetworkd/' \
-e 's/[@]DAEMON_NAME_UC[@]/Virtnetworkd/' \
> $@ || rm -f $@
libexec_PROGRAMS += libvirt_leaseshelper libexec_PROGRAMS += libvirt_leaseshelper
libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES) libvirt_leaseshelper_SOURCES = $(NETWORK_LEASES_HELPER_SOURCES)
libvirt_leaseshelper_LDFLAGS = \ libvirt_leaseshelper_LDFLAGS = \
......
[Unit]
Description=Virtualization network daemon
Conflicts=libvirtd.service
Requires=virtnetworkd.socket
Requires=virtnetworkd-ro.socket
Requires=virtnetworkd-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@/virtnetworkd --timeout 120
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
KillMode=process
[Install]
WantedBy=multi-user.target
Also=virtnetworkd.socket
Also=virtnetworkd-ro.socket
Also=virtnetworkd-admin.socket
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册