ia64/xen-unstable

changeset 995:665ffe5eeb23

bitkeeper revision 1.644 (3fd05375sUdmRADraZr1edif-DcmuA)

XenoUtil.py:
Fix to xenoutil.py
author kaf24@scramble.cl.cam.ac.uk
date Fri Dec 05 09:44:21 2003 +0000 (2003-12-05)
parents c161fd976776
children 0edb87f619c4
files tools/xc/py/XenoUtil.py
line diff
     1.1 --- a/tools/xc/py/XenoUtil.py	Wed Dec 03 10:40:03 2003 +0000
     1.2 +++ b/tools/xc/py/XenoUtil.py	Fri Dec 05 09:44:21 2003 +0000
     1.3 @@ -8,17 +8,7 @@ def blkdev_name_to_number(name):
     1.4      if not re.match( '/dev/', name ):
     1.5          name = '/dev/' + name
     1.6          
     1.7 -    fd = os.popen( '/bin/ls -lL ' + name + ' 2>/dev/null' )
     1.8 -    line = fd.readline()
     1.9 -
    1.10 -    #brw-rw----    1 root     mail       8,   3 Aug 30  2001 /dev/sda3
    1.11 -    m = re.search( '^b\S+\s+\d+\s+\S+\s+\S+\s+(\d+),\s+(\d+)\s+\S+\s+\d+' +
    1.12 -                   '\s+\d+\s+' + name + '$', line )
    1.13 -
    1.14 -    if m:
    1.15 -        # hack -- we just assume device minors are 8 bits
    1.16 -        return (string.atol(m.group(1)) << 8) + string.atol(m.group(2))
    1.17 -    return None
    1.18 +    return os.stat(name).st_rdev
    1.19  
    1.20  
    1.21  # lookup_blkdev_partn_info( '/dev/sda3' )