ia64/xen-unstable

changeset 5955:706733e1ecdf

* support proper scsi disk name
* xvd now has an official lanana assigned major, use it

Signed-off-by: Jeremy Katz <katzj@redhat.com>
author smh22@firebug.cl.cam.ac.uk
date Tue Aug 02 09:29:56 2005 +0000 (2005-08-02)
parents a75db157d12f
children 0301cccd14f1
files tools/python/xen/util/blkif.py
line diff
     1.1 --- a/tools/python/xen/util/blkif.py	Tue Aug 02 09:26:30 2005 +0000
     1.2 +++ b/tools/python/xen/util/blkif.py	Tue Aug 02 09:29:56 2005 +0000
     1.3 @@ -24,8 +24,8 @@ def blkdev_name_to_number(name):
     1.4          log.debug("exception looking up device number for %s: %s", name, ex)
     1.5          pass
     1.6  
     1.7 -    if re.match( '/dev/sd[a-p]([0-9]|1[0-5])', n):
     1.8 -        return 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:])
     1.9 +    if re.match( '/dev/sd[a-p]([1-9]|1[0-5])?', n):
    1.10 +        return 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:] or 0)
    1.11  
    1.12      if re.match( '/dev/hd[a-t]([1-9]|[1-5][0-9]|6[0-3])?', n):
    1.13          ide_majors = [ 3, 22, 33, 34, 56, 57, 88, 89, 90, 91 ]
    1.14 @@ -33,6 +33,9 @@ def blkdev_name_to_number(name):
    1.15          minor = ((ord(n[7:8]) - ord('a')) % 2) * 64 + int(n[8:] or 0)
    1.16          return major * 256 + minor
    1.17  
    1.18 +    if re.match( '/dev/xvd[a-p]([1-9]|1[0-5])?', n):
    1.19 +        return 202 * 256 + 16 * (ord(n[8:9]) - ord('a')) + int(n[9:] or 0)
    1.20 +
    1.21      # see if this is a hex device number
    1.22      if re.match( '^(0x)?[0-9a-fA-F]+$', name ):
    1.23          return string.atoi(name,16)