ia64/xen-unstable

changeset 1097:0dbf77a9ac59

bitkeeper revision 1.730 (403255aarVxNJS1lCbHzxzUP9v-rRA)

XenoUtil.py:
Forward port from 1.2 to allocate VD space from fastest part of the disc first.
author kaf24@scramble.cl.cam.ac.uk
date Tue Feb 17 17:55:54 2004 +0000 (2004-02-17)
parents 287a2edef6f0
children 099594bb1c15
files tools/xc/py/XenoUtil.py
line diff
     1.1 --- a/tools/xc/py/XenoUtil.py	Mon Feb 16 15:18:11 2004 +0000
     1.2 +++ b/tools/xc/py/XenoUtil.py	Tue Feb 17 17:55:54 2004 +0000
     1.3 @@ -276,12 +276,14 @@ def vd_format(partition, extent_size_mb)
     1.4          else:
     1.5              new_id = 0
     1.6  
     1.7 -        for i in range(part_info['nr_sectors'] / extent_size):
     1.8 +        num_extents = part_info['nr_sectors'] / extent_size
     1.9 +
    1.10 +        for i in range(num_extents):
    1.11              sql ="""INSERT INTO vdisk_extents(vdisk_extent_no, vdisk_id,
    1.12                                                part_id, part_extent_no)
    1.13                      VALUES ("""+ str(new_id + i) + ", 0, "\
    1.14                                 + str(blkdev_name_to_number(partition))\
    1.15 -                               + ", " + str(i) + ")"
    1.16 +                               + ", " + str(num_extents - (i + 1)) + ")"
    1.17              cu.execute(sql)
    1.18  
    1.19      cx.commit()