libvirt: Fix network autostart
@@ -25,16 +25,20 @@ mkdir /dev.container && {
mount --rbind /host/sys /sys
+# We create the network on a file basis to not
+# have to wait for libvirtd to come up
if [[ -n "$LIBVIRTD_DEFAULT_NETWORK_DEVICE" ]]; then
-cat > /etc/libvirt/qemu/networks/autostart/default.xml <<EOX
+ mkdir -p /etc/libvirt/qemu/networks/autostart
+ cat > /etc/libvirt/qemu/networks/default.xml <<EOX
<!-- Generated by libvirtd.sh container script -->
<network>
<name>default</name>
- <forward>
+ <forward mode="bridge">
<interface dev="$LIBVIRTD_DEFAULT_NETWORK_DEVICE" />
</forward>
</network>
EOX
+ ln -s /etc/libvirt/qemu/networks/default.xml /etc/libvirt/qemu/networks/autostart/default.xml
fi
/usr/sbin/virtlogd &
