[virt-tools-list] [PATCH 2/2] Set bridged network as default for virtuozzo hypervisor

Mikhail Feoktistov mfeoktistov at virtuozzo.com
Thu Apr 14 08:54:11 UTC 2016


After clean installation virtuozzo hypervisor doesn't have
network with "default" name.
Intead of this it has "Bridged" network.
In this patch we set "Bridged" network as default network.
---
 virtManager/netlist.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/virtManager/netlist.py b/virtManager/netlist.py
index 0507203..3c310f3 100644
--- a/virtManager/netlist.py
+++ b/virtManager/netlist.py
@@ -146,8 +146,12 @@ class vmmNetworkList(vmmGObjectUI):
             if not net.is_active():
                 label += " (%s)" % _("Inactive")
 
-            if net.get_name() == "default":
-                default_label = label
+            if self.conn.is_vz():
+                if net.get_name() == "Bridged":
+                    default_label = label
+            else:
+                if net.get_name() == "default":
+                    default_label = label
 
             rows.append(self._build_source_row(
                 nettype, net.get_name(), label, True,
@@ -272,11 +276,16 @@ class vmmNetworkList(vmmGObjectUI):
             for row in rows:
                 model.append(row)
 
+        # For virtuozzo hypervisor default network has
+        # priority over default bridge
         # If there is a bridge device, default to that
         # If not, use 'default' network
         # If not present, use first list entry
         # If list empty, use no network devices
-        label = default_bridge or default_net
+        if self.conn.is_vz():
+            label = default_net or default_bridge
+        else:
+            label = default_bridge or default_net
 
         default = 0
         if not len(model):
-- 
2.5.5




More information about the virt-tools-list mailing list