[gnome-boxes/dont-always-recreate-network-iface: 2/2] vm-configurator: Update network config only when necessary
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/dont-always-recreate-network-iface: 2/2] vm-configurator: Update network config only when necessary
- Date: Tue, 13 Feb 2018 15:39:32 +0000 (UTC)
commit 73eac2a2a2358e6c4fe093e8bc91e3dac068ea55
Author: Felipe Borges <felipeborges gnome org>
Date: Tue Feb 13 16:30:01 2018 +0100
vm-configurator: Update network config only when necessary
Commit 30c2d638f 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
src/vm-configurator.vala | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 38207a87..f58b173d 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -257,7 +257,6 @@ public static async void update_existing_domain (Domain domain,
warning ("Failed to update CPU config for '%s': %s", domain.name, e.message);
}
- // First remove existing network interface device
GLib.List<GVirConfig.DomainDevice> devices = null;
DomainInterface iface = null;
DomainGraphicsSpice graphics = null;
@@ -277,12 +276,15 @@ 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";
- devices.prepend (create_network_interface (domain, bridge, virtio));
+ if (bridge)
+ devices.prepend (create_network_interface (domain, bridge, virtio));
+ else
+ devices.prepend (iface);
}
if (graphics != null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]