[Kimchi-devel] [PATCH 2/2] Pass bridge name on NAT network creation

Ramon Medeiros ramonn at linux.vnet.ibm.com
Thu Feb 12 18:02:51 UTC 2015


Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>

To avoid issue #556: Unable to create bridge virbr0: File already exists, which
happens because libvirt uses virbr0 as default bridge to create a
network pool. When this bridge is already created, libvirt raises and
error.

To fix, it will be passed an available bridge, that will be created by
libvirt.
---
 src/kimchi/model/networks.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/kimchi/model/networks.py b/src/kimchi/model/networks.py
index dd8e66c..a3d350c 100644
--- a/src/kimchi/model/networks.py
+++ b/src/kimchi/model/networks.py
@@ -52,7 +52,8 @@ class NetworksModel(object):
             try:
                 subnet = self._get_available_address(knetwork.DefaultNetsPool)
                 params = {"name": "default", "connection": "nat",
-                          "subnet": subnet}
+                          "subnet": subnet,
+                          "bridge": self._find_bridge_available("virbr")}
                 self.create(params)
                 return conn.networkLookupByName("default")
             except Exception as e:
-- 
1.8.3.1




More information about the Kimchi-devel mailing list