mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
xend: Do not create XendNetwork instance of tmpbridge
This patch prevents xend from creating a XendNetwork instance of tmpbridge (a temporary bridge used in network-bridge script). Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
This commit is contained in:
1 parent
f777559395
commit
0dc8a04b2b
1 file changed
+13
-2
@@ -18,6 +18,7 @@
|
||||
|
||||
import os
|
||||
import socket
|
||||
import time
|
||||
import xen.lowlevel.xc
|
||||
|
||||
from xen.util import Brctl
|
||||
@@ -157,7 +158,16 @@ class XendNode:
|
||||
|
||||
# Next discover any existing bridges and check
|
||||
# they are not already configured
|
||||
bridges = Brctl.get_state().keys()
|
||||
|
||||
# 'tmpbridge' is a temporary bridge created by network-bridge script.
|
||||
# Wait a couple of seconds for it to be renamed.
|
||||
for i in xrange(20):
|
||||
bridges = Brctl.get_state().keys()
|
||||
if 'tmpbridge' in bridges:
|
||||
time.sleep(0.1)
|
||||
else:
|
||||
break
|
||||
|
||||
configured_bridges = [XendAPIStore.get(
|
||||
network_uuid, "network")
|
||||
.get_name_label()
|
||||
@@ -166,7 +176,8 @@ class XendNode:
|
||||
for bridge in bridges
|
||||
if bridge not in configured_bridges]
|
||||
for unconfigured_bridge in unconfigured_bridges:
|
||||
XendNetwork.create_phy(unconfigured_bridge)
|
||||
if unconfigured_bridge != 'tmpbridge':
|
||||
XendNetwork.create_phy(unconfigured_bridge)
|
||||
|
||||
# Initialise PIFs
|
||||
# First configure ones off disk
|
||||
|
||||