[Kimchi-devel] [PATCH 7/7] Remove VMTemplate._get_scsi_disks_xml() and VMTemplate._get_iscsi_disks_xml()

Aline Manera alinefm at linux.vnet.ibm.com
Fri Oct 31 17:22:26 UTC 2014


VMTemplate._get_disks_xml() handles all type of disks so those
functions are not needed anymore.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 src/kimchi/vmtemplate.py | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 7f7a907..f9b2b42 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -37,8 +37,6 @@ from kimchi.xmlutils.qemucmdline import get_qemucmdline_xml
 
 
 class VMTemplate(object):
-    _bus_to_dev = {'ide': 'hd', 'virtio': 'vd', 'scsi': 'sd'}
-
     def __init__(self, args, scan=False):
         """
         Construct a VM Template from a widely variable amount of information.
@@ -203,39 +201,6 @@ class VMTemplate(object):
             graphics_xml = graphics_xml + spicevmc_xml
         return graphics_xml
 
-    def _get_scsi_disks_xml(self):
-        ret = ""
-        luns = [disk['volume'] for disk in self.info.get('disks', {})
-                if 'volume' in disk]
-
-        pool_name = pool_name_from_uri(self.info['storagepool'])
-        for index, lun in enumerate(luns):
-            params = {}
-            params['disk'] = 'volume' if self.fc_host_support else 'block'
-            params['type'] = 'lun'
-            params['format'] = 'raw'
-            params['bus'] = 'scsi'
-            params['index'] = index
-            params['path'] = self._get_volume_path(pool_name, lun)
-            ret += get_disk_xml(params)[1]
-
-        return ret
-
-    def _get_iscsi_disks_xml(self):
-        ret = ""
-        pool_name = pool_name_from_uri(self.info['storagepool'])
-        for i, d in enumerate(self.info['disks']):
-            params = {}
-            params['disk'] = 'block'
-            params['type'] = 'disk'
-            params['format'] = 'raw'
-            params['bus'] = self.info['disk_bus']
-            params['index'] = i
-            params['path'] = self._get_volume_path(pool_name, d.get('volume'))
-            ret += get_disk_xml(params)
-
-        return ret
-
     def to_volume_list(self, vm_uuid):
         storage_path = self._get_storage_path()
         fmt = 'raw' if self._get_storage_type() in ['logical'] else 'qcow2'
-- 
1.9.3




More information about the Kimchi-devel mailing list