# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1207731406 25200
# Node ID 769e4c7af2e850055b0aa536e696f677ea204357
# Parent cc4dc206699ce32f35a68996d43c2b7fbd00abdd
[TEST].2# add net_type setting in device node for KVM
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r cc4dc206699c -r 769e4c7af2e8 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 01:53:41 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Apr 09 01:56:46 2008 -0700
@@ -488,12 +488,12 @@ class KVMXML(VirtXML):
sys.exit(1)
VirtXML.__init__(self, 'kvm', test_dom, set_uuid(), mem, vcpus)
self._os()
- self._devices(const.KVM_default_emulator, disk_file_path, disk, mac)
+ self._devices(const.KVM_default_emulator, const.KVM_default_net_type,
disk_file_path, disk, mac)
def _os(self):
self.add_sub_node('/domain/os', 'type', 'hvm')
- def _devices(self, emu, disk_img, disk_dev, net_mac):
+ def _devices(self, emu, net_type, disk_img, disk_dev, net_mac):
devices = self.get_node('/domain/devices')
self.add_sub_node(devices, 'emulator', emu)
@@ -501,9 +501,10 @@ class KVMXML(VirtXML):
self.add_sub_node(disk, 'source', file=disk_img)
self.add_sub_node(disk, 'target', dev=disk_dev)
- interface = self.add_sub_node(devices, 'interface',
type='bridge')
+ interface = self.add_sub_node(devices, 'interface', type=net_type)
self.add_sub_node(interface, 'mac', address=net_mac)
- self.set_bridge(CIM_IP)
+ if net_type == 'bridge':
+ self.set_vbridge(CIM_IP)
def set_emulator(self, emu):
return self._set_emulator(emu)