[Libvirt-cim] [PATCH] [TEST] create a virtual storage pool in vxml.py

Guo Lian Yun yunguol at cn.ibm.com
Tue Apr 29 08:35:28 UTC 2008


# HG changeset patch
# User Guolian Yun <yunguol at cn.ibm.com>
# Date 1209458122 25200
# Node ID 144b49e7504511817693b3f3e78c7905e8aed140
# Parent  2b83c1992dfc44573ba0c00729e36311355807ad
[TEST] create a virtual storage pool in vxml.py

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 2b83c1992dfc -r 144b49e75045 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Sun Apr 27 19:22:03 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py	Tue Apr 29 01:35:22 2008 -0700
@@ -44,6 +44,7 @@ from CimTest.Globals import logger, CIM_
 from CimTest.Globals import logger, CIM_IP, CIM_PORT, CIM_NS, CIM_USER, CIM_PASS
 from CimTest.ReturnCodes import SKIP
 from XenKvmLib.classes import virt_types, get_typed_class
+from XenKvmLib.const import CIM_REV
 
 class XMLClass:
     xml_string = ""
@@ -536,6 +537,15 @@ class KVMXML(VirtXML):
         self.add_sub_node(interface, 'mac', address=net_mac)
         if net_type == 'bridge':
             self.set_vbridge(CIM_IP)    
+
+        if CIM_REV > 496:
+            pool = self.add_sub_node(devices, 'pool', type='disk')
+            self.add_sub_node(pool, 'name', 'test')
+            source = self.add_sub_node(pool, 'source')
+            self.add_sub_node(source, 'device', path='/dev/sda')
+            self.add_sub_node(source, 'dir', path='/dev')
+            target = self.add_sub_node(pool, 'target')
+            self.add_sub_node(target, 'path', '/dev')
     
     def set_emulator(self, emu):
         return self._set_emulator(emu)




More information about the Libvirt-cim mailing list