mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-26 11:06:44 +03:00
nixos/scripted-networking: fix bridge setup when libvirtd uses socket activation
This commit is contained in:
parent
d8664c78b1
commit
687aa06c70
1 changed files with 12 additions and 6 deletions
|
@ -291,6 +291,11 @@ let
|
|||
|
||||
${optionalString config.virtualisation.libvirtd.enable ''
|
||||
# Enslave dynamically added interfaces which may be lost on nixos-rebuild
|
||||
#
|
||||
# if `libvirtd.service` is not running, do not use `virsh` which would try activate it via 'libvirtd.socket' and thus start it out-of-order.
|
||||
# `libvirtd.service` will set up bridge interfaces when it will start normally.
|
||||
#
|
||||
if ${pkgs.systemd}/bin/systemctl --quiet is-active 'libvirtd.service'; then
|
||||
for uri in qemu:///system lxc:///; do
|
||||
for dom in $(${pkgs.libvirt}/bin/virsh -c $uri list --name); do
|
||||
${pkgs.libvirt}/bin/virsh -c $uri dumpxml "$dom" | \
|
||||
|
@ -298,6 +303,7 @@ let
|
|||
${pkgs.bash}/bin/bash
|
||||
done
|
||||
done
|
||||
fi
|
||||
''}
|
||||
|
||||
# Enable stp on the interface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue