From 29088889349a5034862b44f3df784305952bcb50 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Thu, 25 Nov 2021 10:30:37 +0000 Subject: [PATCH] Ensure sessions trigger a listing of the network devices (#1409) List network devices to trigger a side effect to ensure the qemu-bridge-helper will run correctly for users of the modular daemons. It is likely that this should be done for sessions to support resolving the correct virtual bridge device anyway, however that is more involved and maybe superseded by not needing a network interface should qemu agent be able to act as a communicator. Or to perform port forwarding using qemuargs to allow SSH access directly in. Fixes: #1258 --- lib/vagrant-libvirt/action/create_networks.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/vagrant-libvirt/action/create_networks.rb b/lib/vagrant-libvirt/action/create_networks.rb index 37f176a..7e2d957 100644 --- a/lib/vagrant-libvirt/action/create_networks.rb +++ b/lib/vagrant-libvirt/action/create_networks.rb @@ -30,6 +30,15 @@ module VagrantPlugins def call(env) if env[:machine].provider_config.qemu_use_session + # Get a list of all (active and inactive) Libvirt networks. This + # triggers a side effect to ensure networking is fully available + # for VMs using sessions. It is likely that this should be done + # to determine the correct virtual device for the management + # network for sessions instead of assuming the default of virbr0. + @available_networks = libvirt_networks( + env[:machine].provider.driver.system_connection + ) + @app.call(env) return end