Commit 8a336ba0 authored by Felipe Borges's avatar Felipe Borges 👣 Committed by Felipe Borges

vm-configurator: Update network config only when necessary

Commit 30c2d638 has introduced a regression which causes the mac
address of a domain to change every time Boxes starts.

These changes create a new network interface only when the existing
one is not already bridged.

Fixes #158
parent 77a5153e
Pipeline #10580 passed with stage
in 3 minutes and 3 seconds
......@@ -257,7 +257,6 @@ public static async void update_existing_domain (Domain domain,
warning ("Failed to update CPU config for '%s': %s",, e.message);
// First remove existing network interface device
GLib.List<GVirConfig.DomainDevice> devices = null;
DomainInterface iface = null;
DomainGraphicsSpice graphics = null;
......@@ -277,12 +276,16 @@ else if (device is DomainChannel) {
devices.prepend (device);
// If user interface device was found and removed, let's add bridge device now.
// If user interface device was found and it needs to be bridged
if (iface != null) {
var bridge = is_libvirt_bridge_net_available ();
var virtio = iface.get_model () == "virtio";
if (bridge && (iface is DomainInterfaceUser)) {
var virtio = iface.get_model () == "virtio";
devices.prepend (create_network_interface (domain, bridge, virtio));
devices.prepend (create_network_interface (domain, bridge, virtio));
} else {
devices.prepend (iface);
if (graphics != null)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment