If bridge name hasn't been recorded in XendConfig then try and work it out using Brctl.

This is needed when a VIF is created without specifying a bridge.

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
Tom Wilkie committed 2007-04-25 13:55:18 +01:00
1 parent 1f79e130d5
commit 9ad27d5eda
1 file changed
+10 -1
+10 -1
View File
@@ -2246,9 +2246,18 @@ class XendDomainInfo:
if not config.has_key('network'):
try:
bridge = config.get('bridge', None)
if bridge is None:
from xen.util import Brctl
if_to_br = dict([(i,b)
for (b,ifs) in Brctl.get_state().items()
for i in ifs])
vifname = "vif%s.%s" % (self.getDomid(),
config.get('id'))
bridge = if_to_br.get(vifname, None)
config['network'] = \
XendNode.instance().bridge_to_network(
config.get('bridge')).uuid
config.get('bridge')).get_uuid()
except Exception:
log.exception('bridge_to_network')
# Ignore this for now -- it may happen if the device
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.