Skip to contentSkip to conversation

xend/pvscsi: recognize also SCSI CDROM devices

PATCH Applied Olaf Hering 3 participants 3 messages Feb 11, 2014 – Mar 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xend/pvscsi: recognize also SCSI CDROM devices

Attaching a CDROM device with 'xm scsi-attach domU /dev/sr0 0:0:0:0' fails because for some reason the sr driver was not handled at all in the match list. With the change the above command succeeds and the device is attached.

---

Once this change gets commited, it should also be backported to the maintained trees which contains these fixes (4.3+):

89bb46e xend/pvscsi: update sysfs parser for Linux 3.0
65ddfc5 xend/pvscsi: fix usage of persistant device names for SCSI devices a6046ec xend/pvscsi: fix passing of SCSI control LUNs

 tools/python/xen/util/vscsi_util.py | 3 +++
 1 file changed, 3 insertions(+)
tools/python/xen/util/vscsi_util.py +3 -0
index 5872e65..a4f5ad3 100644
@@ -66,6 +66,9 @@ def _vscsi_get_hctl_by(phyname, scsi_devices):
     if re.match('/dev/sd[a-z]+([1-9]|1[0-5])?$', phyname):
         # sd driver
         name = re.sub('(^/dev/)|([1-9]|1[0-5])?$', '', phyname)
+    elif re.match('/dev/sr[0-9]+$', phyname):
+        # sr driver
+        name = re.sub('^/dev/', '', phyname)
     elif re.match('/dev/sg[0-9]+$', phyname):
         # sg driver
         name = re.sub('^/dev/', '', phyname)
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Olaf Hering

Attaching a CDROM device with 'xm scsi-attach domU /dev/sr0 0:0:0:0' fails because for some reason the sr driver was not handled at all in the match list. With the change the above command succeeds and the device is attached.

Quoted 31 lines

---

Once this change gets commited, it should also be backported to the maintained trees which contains these fixes (4.3+):

89bb46e xend/pvscsi: update sysfs parser for Linux 3.0
65ddfc5 xend/pvscsi: fix usage of persistant device names for SCSI devices a6046ec xend/pvscsi: fix passing of SCSI control LUNs

 tools/python/xen/util/vscsi_util.py | 3 +++
 1 file changed, 3 insertions(+)
tools/python/xen/util/vscsi_util.py +3 -0
index 5872e65..a4f5ad3 100644
@@ -66,6 +66,9 @@ def _vscsi_get_hctl_by(phyname, scsi_devices):
     if re.match('/dev/sd[a-z]+([1-9]|1[0-5])?$', phyname):
         # sd driver
         name = re.sub('(^/dev/)|([1-9]|1[0-5])?$', '', phyname)
+    elif re.match('/dev/sr[0-9]+$', phyname):
+        # sr driver
+        name = re.sub('^/dev/', '', phyname)
     elif re.match('/dev/sg[0-9]+$', phyname):
         # sg driver
         name = re.sub('^/dev/', '', phyname)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Applied
#2 lore raw
Quoted 9 lines · Matt Wilson
Quoted 6 lines · Olaf Hering

Attaching a CDROM device with 'xm scsi-attach domU /dev/sr0 0:0:0:0' fails because for some reason the sr driver was not handled at all in the match list. With the change the above command succeeds and the device is attached.

Applied.