Summary: | app-emulation/libvirt - wrong dependency at service-unit libvirtd.service | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Stefan Schmid <schmidicom> |
Component: | Current packages | Assignee: | Matthias Maier <tamiko> |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | virtualization |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Stefan Schmid
2019-08-16 06:11:17 UTC
-(In reply to Stefan Schmid from comment #0) > It doesn't help if the network management tool has been started but the > network itself is not set up yet. > > In my case the NetworkManager creates a network bridge which is needed for > the VM of libvirt. But without correct dependency the VM starts before the > NetworkManager can do its job. > > In the service-unit "libvirtd.service" should "After=network.target" > replaced by "After=network-online.target" We install the systemd service exactly as shipped by upstream. The "After=network.target" dependency seems to be correct - strictly speaking libvirt (and guests) do not need immediate internet access. May I suggest two solutions for your special configuration case: - You can override the service unit by creating, say, /etc/systemd/system/libvirtd.service.d/99not-too-early.conf with something like (untested) [Unit] After=network-online.target Alternatively: - I personally use systemd-networkd for the static bits of my network configuration which happens to be precisely a bridge for libvirt: /etc/systemd/network/br0.netdev: [NetDev] Name=br0 Kind=bridge MACAddress=<something> /etc/systemd/network/br0.netdev: [Match] Name=br0 [Link] RequiredForOnline=yes [Network] Address=<something> ConfigureWithoutCarrier=yes IPForward=yes Never encountered any issues or race conditions with that. I hope that helped you with your configuration :-) I'm already using the override as a workaround. I just thought that for others this would avoid a similar problem. (In reply to Stefan Schmid from comment #2) > I'm already using the override as a workaround. > I just thought that for others this would avoid a similar problem. No worries, thanks a lot for the bug report. It is just that we have to be a bit conservative with configuration changes of that kind. (Switching the default configuration in such a way has the potential to break a fair number of installations.) If libvirt should ever get its own entry in the Gentoo-Wiki, would that be something that should be mentioned there? PS: Thanks for responding to this bug report and explanation. |