From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
after apply this patch.
you can find a usb scsi targe, and create a scsi pool on this usb
scsi target. and then create a VM on the lun of this pool.
This patch is just for scsi test.
Do not need to merge this patch.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/model/host.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
index 7b151f2..feee1c3 100644
--- a/src/kimchi/model/host.py
+++ b/src/kimchi/model/host.py
@@ -244,6 +244,14 @@ class DevicesModel(object):
def _get_devices_fc_host(self):
conn = self.conn.get()
# Libvirt < 1.0.5 does not support fc_host capability
+ ret = []
+ scsi_hosts = conn.listDevices('scsi_host', 0)
+ for host in scsi_hosts:
+ xml = conn.nodeDeviceLookupByName(host).XMLDesc(0)
+ path = '/device/path'
+ if 'usb' in xmlutils.xpath_get_text(xml, path)[0]:
+ ret.append(host)
+ return ret
if not CapabilitiesModel().fc_host_support:
ret = []
scsi_hosts = conn.listDevices('scsi_host', 0)
--
1.8.5.3