diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-02-17 17:55:54 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-02-17 17:55:54 +0000 |
commit | 86eb2b78d607bcd80bcc2d5bb3a0183863386021 (patch) | |
tree | 459376720ece0eb0e628d74b130296e1110edfc8 /tools/xc/py | |
parent | cc52cc88bfd5ae9a5327e2dce1892a19b167315a (diff) | |
download | xen-86eb2b78d607bcd80bcc2d5bb3a0183863386021.tar.gz xen-86eb2b78d607bcd80bcc2d5bb3a0183863386021.tar.bz2 xen-86eb2b78d607bcd80bcc2d5bb3a0183863386021.zip |
bitkeeper revision 1.730 (403255aarVxNJS1lCbHzxzUP9v-rRA)
XenoUtil.py:
Forward port from 1.2 to allocate VD space from fastest part of the disc first.
Diffstat (limited to 'tools/xc/py')
-rw-r--r-- | tools/xc/py/XenoUtil.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/xc/py/XenoUtil.py b/tools/xc/py/XenoUtil.py index e3b49bd99a..06a623e9bb 100644 --- a/tools/xc/py/XenoUtil.py +++ b/tools/xc/py/XenoUtil.py @@ -276,12 +276,14 @@ def vd_format(partition, extent_size_mb): else: new_id = 0 - for i in range(part_info['nr_sectors'] / extent_size): + num_extents = part_info['nr_sectors'] / extent_size + + for i in range(num_extents): sql ="""INSERT INTO vdisk_extents(vdisk_extent_no, vdisk_id, part_id, part_extent_no) VALUES ("""+ str(new_id + i) + ", 0, "\ + str(blkdev_name_to_number(partition))\ - + ", " + str(i) + ")" + + ", " + str(num_extents - (i + 1)) + ")" cu.execute(sql) cx.commit() |