# HG changeset patch
# User anantyog(a)linux.vnet.ibm.com
# Date 1247490357 25200
# Node ID 624d673032ea550914dc569d993081d510321e6c
# Parent f8a983f28ce47c137c4ecf14bbd8c81d936abc3f
[Test] Patch to enable bridge type network in cimtest
This patch enables creating a bridge type network pool and also defining
a domain with bridge interface in cimtest.
Signed-off-by: Yogananth Subramanian <anantyog(a)linux.vnet.ibm.com>
diff -r f8a983f28ce4 -r 624d673032ea suites/libvirt-cim/lib/XenKvmLib/common_util.py
--- a/suites/libvirt-cim/lib/XenKvmLib/common_util.py Fri Jul 10 00:47:59 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/common_util.py Mon Jul 13 06:05:57 2009 -0700
@@ -40,7 +40,8 @@
domain_list, virt2uri, net_destroy
from XenKvmLib.vxml import PoolXML, NetXML
from VirtLib import utils
-from XenKvmLib.const import default_pool_name, default_network_name
+from XenKvmLib.const import default_pool_name, default_network_name,\
+ default_bridge_name
disk_file = '/etc/libvirt/diskpool.conf'
exports_file = '/etc/exports'
@@ -381,7 +382,8 @@
return PASS
def create_netpool_conf(server, virt, use_existing=False,
- net_name=default_network_name):
+ net_name=default_network_name,
+ bridge_name=default_bridge_name):
status = PASS
test_network = None
try:
@@ -400,7 +402,8 @@
net_name)
return FAIL, "Unknown"
- netxml = NetXML(server, virt=virt, networkname=net_name)
+ netxml = NetXML(server, virt=virt, networkname=net_name,
+ bridgename=bridge_name)
ret = netxml.create_vnet()
if not ret:
logger.error("Failed to create Virtual Network '%s'",
diff -r f8a983f28ce4 -r 624d673032ea suites/libvirt-cim/lib/XenKvmLib/vsms.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vsms.py Fri Jul 10 00:47:59 2009 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vsms.py Mon Jul 13 06:05:57 2009 -0700
@@ -164,7 +164,10 @@
self.ResourceType = RASD_TYPE_NET_ETHER
if virt_net != None :
- self.PoolID = "NetworkPool/%s" % virt_net
+ if type == 'network':
+ self.PoolID = "NetworkPool/%s" % virt_net
+ elif type == 'bridge':
+ self.NetworkName = virt_net
if mac != None:
self.InstanceID = '%s/%s' % (name, mac)