ia64/xen-unstable

changeset 19344:0b5b67eba5ba

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>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Mar 12 11:33:06 2009 +0000 (2009-03-12)
parents 832f9e32832d
children a55a98b36a2a
files tools/python/xen/xend/XendNode.py
line diff
     1.1 --- a/tools/python/xen/xend/XendNode.py	Thu Mar 12 11:26:32 2009 +0000
     1.2 +++ b/tools/python/xen/xend/XendNode.py	Thu Mar 12 11:33:06 2009 +0000
     1.3 @@ -18,6 +18,7 @@
     1.4  
     1.5  import os
     1.6  import socket
     1.7 +import time
     1.8  import xen.lowlevel.xc
     1.9  
    1.10  from xen.util import Brctl
    1.11 @@ -157,7 +158,16 @@ class XendNode:
    1.12                  
    1.13          # Next discover any existing bridges and check
    1.14          # they are not already configured
    1.15 -        bridges = Brctl.get_state().keys()
    1.16 +
    1.17 +        # 'tmpbridge' is a temporary bridge created by network-bridge script.
    1.18 +        # Wait a couple of seconds for it to be renamed.
    1.19 +        for i in xrange(20):
    1.20 +            bridges = Brctl.get_state().keys()
    1.21 +            if 'tmpbridge' in bridges:
    1.22 +                time.sleep(0.1)
    1.23 +            else:
    1.24 +                break
    1.25 +            
    1.26          configured_bridges = [XendAPIStore.get(
    1.27                                    network_uuid, "network")
    1.28                                        .get_name_label()
    1.29 @@ -166,7 +176,8 @@ class XendNode:
    1.30                                  for bridge in bridges
    1.31                                  if bridge not in configured_bridges]
    1.32          for unconfigured_bridge in unconfigured_bridges:
    1.33 -            XendNetwork.create_phy(unconfigured_bridge)
    1.34 +            if unconfigured_bridge != 'tmpbridge':
    1.35 +                XendNetwork.create_phy(unconfigured_bridge)
    1.36  
    1.37          # Initialise PIFs
    1.38          # First configure ones off disk