From: Olaf Hering Date: Tue, 11 Feb 2014 14:27:24 +0000 (+0100) Subject: xend/pvscsi: recognize also SCSI CDROM devices X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5334 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9011c2615c18b92f10cda8d78622e0c2a9e1f846;p=xen.git 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. Signed-off-by: Olaf Hering Acked-by: Matt Wilson --- diff --git a/tools/python/xen/util/vscsi_util.py b/tools/python/xen/util/vscsi_util.py index 5872e65916..a4f5ad3ce8 100644 --- a/tools/python/xen/util/vscsi_util.py +++ b/tools/python/xen/util/vscsi_util.py @@ -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)