mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Merge
This commit is contained in:
commit
4b7d8cd407
3 files changed
+112
-36
No files matched your search
@@ -23,8 +23,15 @@ def blkdev_name_to_number(name):
|
||||
except Exception, ex:
|
||||
pass
|
||||
|
||||
if re.match( '/dev/sd[a-p]([1-9]|1[0-5])?', n):
|
||||
return 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:] or 0)
|
||||
scsi_major = [ 8, 65, 66, 67, 68, 69, 70, 71, 128, 129, 130, 131, 132, 133, 134, 135 ]
|
||||
if re.match( '/dev/sd[a-z]([1-9]|1[0-5])?$', n):
|
||||
major = scsi_major[(ord(n[7:8]) - ord('a')) / 16]
|
||||
minor = ((ord(n[7:8]) - ord('a')) % 16) * 16 + int(n[8:] or 0)
|
||||
return major * 256 + minor
|
||||
if re.match( '/dev/sd[a-i][a-z]([1-9]|1[0-5])?$', n):
|
||||
major = scsi_major[((ord(n[7:8]) - ord('a') + 1) * 26 + (ord(n[8:9]) - ord('a'))) / 16 ]
|
||||
minor = (((ord(n[7:8]) - ord('a') + 1 ) * 26 + (ord(n[8:9]) - ord('a'))) % 16) * 16 + int(n[9:] or 0)
|
||||
return major * 256 + minor
|
||||
|
||||
if re.match( '/dev/hd[a-t]([1-9]|[1-5][0-9]|6[0-3])?', n):
|
||||
ide_majors = [ 3, 22, 33, 34, 56, 57, 88, 89, 90, 91 ]
|
||||
|
||||