[gnome-boxes] vm-configurator: Always update network config



commit 30c2d638f8dc6605a6fc958ba1b605cdc03b2d0c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Oct 19 17:58:33 2015 +0100

    vm-configurator: Always update network config
    
    Instead of only updating network config for existing domains if bridge
    networking is available and existing networking in the box is not
    already bridge network, let's always do so.
    
    This fixes the issue of VM not starting if bridge networking is no
    longer available (this has been known to happen due to setup/packaging
    issues) and existing network is set to either bridge or some other
    non-working configuration (e.g 'default' when importing from system
    libvirt).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756547

 src/vm-configurator.vala |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala
index 9549682..1492e22 100644
--- a/src/vm-configurator.vala
+++ b/src/vm-configurator.vala
@@ -245,14 +245,11 @@ private class Boxes.VMConfigurator {
             warning ("Failed to update CPU config for '%s': %s", domain.name, e.message);
         }
 
-        if (!is_libvirt_bridge_net_available ())
-            return;
-
-        // First remove user and 'network' (used by system libvirt machines) interface device
+        // First remove existing network interface device
         GLib.List<GVirConfig.DomainDevice> devices = null;
         DomainInterface iface = null;
         foreach (var device in domain.get_devices ()) {
-            if (device is DomainInterfaceUser || device is DomainInterfaceNetwork)
+            if (device is DomainInterface)
                 iface = device as DomainInterface;
             else
                 devices.prepend (device);
@@ -262,8 +259,10 @@ private class Boxes.VMConfigurator {
 
         // If user interface device was found and removed, let's add bridge device now.
         if (iface != null) {
+            var bridge = is_libvirt_bridge_net_available ();
             var virtio = iface.get_model () == "virtio";
-            add_network_interface (domain, true, virtio);
+
+            add_network_interface (domain, bridge, virtio);
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]