[gnome-boxes/dont-always-recreate-network-iface: 13/13] 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: 13/13] vm-configurator: Update network config only when necessary
- Date: Wed, 21 Feb 2018 15:21:24 +0000 (UTC)
commit c5efe39f3bc8a237d58463386b830350438685d2
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 | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 38207a87..9baf599c 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,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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]