support lxc:/// and ignore weird bridges (like openvswitch)
This commit is contained in:
parent
10cbb52ae7
commit
d48b12c27c
|
@ -253,8 +253,12 @@ let
|
|||
|
||||
${optionalString config.virtualisation.libvirtd.enable ''
|
||||
# Enslave dynamically added interfaces which may be lost on nixos-rebuild
|
||||
for dom in $(${pkgs.libvirt}/bin/virsh list --name); do
|
||||
${pkgs.libvirt}/bin/virsh dumpxml "$dom" | ${pkgs.xmlstarlet}/bin/xmlstarlet sel -t -m "//domain/devices/interface[@type='bridge']" -v "concat('ip link set ',target/@dev,' master ',source/@bridge)" | ${pkgs.bash}/bin/bash
|
||||
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" | \
|
||||
${pkgs.xmlstarlet}/bin/xmlstarlet sel -t -m "//domain/devices/interface[@type='bridge'][target/@dev][source/@bridge]" -v "concat('ip link set ',target/@dev,' master ',source/@bridge)" | \
|
||||
${pkgs.bash}/bin/bash
|
||||
done
|
||||
done
|
||||
''}
|
||||
|
||||
|
|
Loading…
Reference in a new issue