# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1208332607 25200
# Node ID c9bcc3dc50d4310e7187c1d5fdc4565c79d69cb8
# Parent dfa2a9c819bd026cc467fb3bced05211ee4f2ba9
[TEST].2# update network_by_bridge for KVM & XenFV support
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r dfa2a9c819bd -r c9bcc3dc50d4 lib/VirtLib/live.py
--- a/lib/VirtLib/live.py Tue Apr 15 15:00:01 2008 +0800
+++ b/lib/VirtLib/live.py Wed Apr 16 00:56:47 2008 -0700
@@ -301,15 +301,15 @@ def get_bridge_from_network_xml(network,
if len(bridge) > 1:
return bridge[1]
-def network_by_bridge(bridge, server):
+def network_by_bridge(bridge, server, virt="Xen"):
"""Function returns virtual network for a given
bridge"""
- networks = net_list(server)
+ networks = net_list(server, virt)
if len(networks) == 0:
return None
for network in networks:
- if bridge == get_bridge_from_network_xml(network, server):
+ if bridge == get_bridge_from_network_xml(network, server, virt):
return network
return None