debuggers.hg
changeset 560:07cb518caf2f
bitkeeper revision 1.289 (3f09877bT-kkJTOM1WvHevpN2wY-qw)
Prune old code
Prune old code
author | rac61@labyrinth.cl.cam.ac.uk |
---|---|
date | Mon Jul 07 14:45:15 2003 +0000 (2003-07-07) |
parents | 209c95700af8 |
children | 65cdeae1932c ae364085dd0c b912fe2f29ba |
files | .rootkeys tools/control/src/uk/ac/cam/cl/xeno/xenctl/VirtualBlockDevice.java tools/control/src/uk/ac/cam/cl/xeno/xenctl/VirtualDisk.java tools/vdmanager/src/uk/ac/cam/cl/xeno/vdmanager/VirtualDiskManager.java |
line diff
1.1 --- a/.rootkeys Mon Jul 07 14:44:50 2003 +0000 1.2 +++ b/.rootkeys Mon Jul 07 14:45:15 2003 +0000 1.3 @@ -64,8 +64,6 @@ 3ec41f7civcv4mQiYK0DeX9Zvsxhrw tools/con 1.4 3ec41f7d3-xTeoVJBJqWqxVfU-ANoQ tools/control/src/uk/ac/cam/cl/xeno/xenctl/Parser.java 1.5 3ec41f7dOVZgjP4sQS6vjuBnExdlMQ tools/control/src/uk/ac/cam/cl/xeno/xenctl/RootBean.java 1.6 3ec41f7dvPdszb0frNEkMnEdJUBVjA tools/control/src/uk/ac/cam/cl/xeno/xenctl/SystemConfigurationBean.java 1.7 -3ec41f7dlW5Buk3MO18HHtBax1Jz9g tools/control/src/uk/ac/cam/cl/xeno/xenctl/VirtualBlockDevice.java 1.8 -3ec41f7dP3VglJUTuP45rwvSAoW_pg tools/control/src/uk/ac/cam/cl/xeno/xenctl/VirtualDisk.java 1.9 3ec41f7dO6IuKGGLG4VRUhMDmkTn5g tools/control/web/WEB-INF/web.xml 1.10 3ec41f7dRAPXBA0jQUd1k6MB3xVidg tools/control/web/img/cambridge.gif 1.11 3ec41f7dvxVe1Vb3kVOLZcN5Jra2tQ tools/control/web/img/help.gif 1.12 @@ -131,7 +129,6 @@ 3f0458aaVAbFSwptQbQAnDOiZlwQ3w tools/int 1.13 3eb781fd8oRfPgH7qTh7xvgmwD6NgA tools/internal/xi_start.c 1.14 3eb781fd0Eo9K1jEFCSAVzO51i_ngg tools/internal/xi_stop.c 1.15 3eb781fd7211MZsLxJSiuy7W4KnJXg tools/internal/xi_vifinit 1.16 -3ea53c6d48QGVkviHh0jBB_h_ZqZDw tools/vdmanager/src/uk/ac/cam/cl/xeno/vdmanager/VirtualDiskManager.java 1.17 3ddb79bcbOVHh38VJzc97-JEGD4dJQ xen/Makefile 1.18 3ddb79bcCa2VbsMp7mWKlhgwLQUQGA xen/README 1.19 3ddb79bcWnTwYsQRWl_PaneJfa6p0w xen/Rules.mk
2.1 --- a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/VirtualBlockDevice.java Mon Jul 07 14:44:50 2003 +0000 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,76 +0,0 @@ 2.4 -/* 2.5 - * VirtualBlockDevice.java 2.6 - * 03.03.27 aho creation 2.7 - */ 2.8 - 2.9 -package uk.ac.cam.cl.xeno.xenctl; 2.10 - 2.11 -import java.io.PrintWriter; 2.12 - 2.13 -public class 2.14 -VirtualBlockDevice 2.15 -{ 2.16 - String key; 2.17 - int domain; 2.18 - int vbdnum; 2.19 - Mode mode; /* rw or ro */ 2.20 - 2.21 - String 2.22 - dump (boolean title) 2.23 - { 2.24 - StringBuffer sb = new StringBuffer(); 2.25 - int loop; 2.26 - 2.27 - if (title) 2.28 - { 2.29 - sb.append(" key dom vbd mode\n"); 2.30 - } 2.31 - else 2.32 - { 2.33 - sb.append(" " + key + " " + 2.34 - Library.format(domain,3,0) + " " + 2.35 - Library.format(vbdnum,3,0) + " " + 2.36 - mode.toString() + "\n"); 2.37 - } 2.38 - 2.39 - return sb.toString(); 2.40 - } 2.41 - 2.42 - void 2.43 - dump_xml (PrintWriter out) 2.44 - { 2.45 - out.println(" <virtual_block_device>"); 2.46 - out.println(" <key>" + key + "</key>"); 2.47 - out.println(" <domain>" + domain + "</domain>"); 2.48 - out.println(" <vbdnum>" + vbdnum + "</vbdnum>"); 2.49 - out.println(" <mode>" + mode + "</mode>"); 2.50 - out.println(" </virtual_block_device>"); 2.51 - 2.52 - return; 2.53 - } 2.54 - 2.55 - public String 2.56 - getKey() 2.57 - { 2.58 - return key; 2.59 - } 2.60 - 2.61 - public int 2.62 - getDomain() 2.63 - { 2.64 - return domain; 2.65 - } 2.66 - 2.67 - 2.68 - public int 2.69 - getVBDNum() 2.70 - { 2.71 - return vbdnum; 2.72 - } 2.73 - 2.74 - public Mode 2.75 - getMode() 2.76 - { 2.77 - return mode; 2.78 - } 2.79 -}
3.1 --- a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/VirtualDisk.java Mon Jul 07 14:44:50 2003 +0000 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,257 +0,0 @@ 3.4 -/* 3.5 - * VirtualDisk.java 3.6 - * 03.03.26 aho creation 3.7 - */ 3.8 - 3.9 -package uk.ac.cam.cl.xeno.xenctl; 3.10 - 3.11 -import java.util.Date; 3.12 -import java.util.Vector; 3.13 -import java.lang.Math; 3.14 -import java.io.PrintWriter; 3.15 - 3.16 -public class 3.17 -VirtualDisk 3.18 -{ 3.19 - String name; 3.20 - String key; 3.21 - Date expiry; 3.22 - Vector extents; 3.23 - 3.24 - VirtualDisk (String name, Date expiry, String key) 3.25 - { 3.26 - this.name = name; 3.27 - this.key = key; 3.28 - this.expiry = expiry; 3.29 - extents = new Vector(); 3.30 - } 3.31 - 3.32 - VirtualDisk (String name) 3.33 - { 3.34 - this (name, null, null); 3.35 - this.key = generate_key(); 3.36 - extents = new Vector(); 3.37 - 3.38 - return; 3.39 - } 3.40 - 3.41 - VirtualDisk (String name, Date expiry) 3.42 - { 3.43 - this(name, expiry, null); 3.44 - this.key = generate_key(); 3.45 - } 3.46 - 3.47 - /* 3.48 - * generate a unique key for this virtual disk. 3.49 - * for now, just generate a 10 digit number 3.50 - */ 3.51 - String 3.52 - generate_key () 3.53 - { 3.54 - return Long.toString(1000000000l + (long)(Math.random() * 8999999999l)); 3.55 - } 3.56 - 3.57 - String 3.58 - get_key () 3.59 - { 3.60 - return key; 3.61 - } 3.62 - 3.63 - Date 3.64 - get_expiry () 3.65 - { 3.66 - return expiry; 3.67 - } 3.68 - 3.69 - void 3.70 - set_expiry (Date expiry) 3.71 - { 3.72 - this.expiry = expiry; 3.73 - } 3.74 - 3.75 - public void 3.76 - add_extent (Extent extent) 3.77 - { 3.78 - extents.add(extent); 3.79 - } 3.80 - 3.81 - public Extent 3.82 - remove_extent () 3.83 - { 3.84 - Extent e; 3.85 - 3.86 - if (extents.size() > 0) 3.87 - { 3.88 - e = (Extent) extents.remove(0); 3.89 - } 3.90 - else 3.91 - { 3.92 - e = null; 3.93 - } 3.94 - 3.95 - return e; 3.96 - } 3.97 - 3.98 - String 3.99 - dump (boolean details, boolean title) 3.100 - { 3.101 - StringBuffer sb = new StringBuffer(); 3.102 - int loop; 3.103 - 3.104 - if (details) 3.105 - { 3.106 - if (title) 3.107 - { 3.108 - sb.append(" name: " + name + "\n"); 3.109 - sb.append(" key: " + key + "\n"); 3.110 - sb.append("expiry: " + expiry + "\n"); 3.111 - sb.append("\n"); 3.112 - } 3.113 - sb.append(" idx disk offset size \n"); 3.114 - for (loop = 0; loop < extents.size(); loop++) 3.115 - { 3.116 - Extent e = (Extent) extents.get(loop); 3.117 - sb.append(" " + 3.118 - Library.format(loop,3,0) + " " + 3.119 - Library.format(e.disk,6,0) + 3.120 - Library.format(e.offset,10,0) + 3.121 - Library.format(e.size,10,0) + "\n"); 3.122 - } 3.123 - } 3.124 - else 3.125 - { 3.126 - if (title) 3.127 - { 3.128 - sb.append(" key expiry name\n"); 3.129 - } 3.130 - else 3.131 - { 3.132 - sb.append(" " + key + " " + expiry.toString() + " " + name + "\n"); 3.133 - } 3.134 - } 3.135 - 3.136 - return sb.toString(); 3.137 - } 3.138 - 3.139 - String 3.140 - dump_xen () 3.141 - { 3.142 - StringBuffer sb = new StringBuffer(); 3.143 - 3.144 - sb.append("extents:" + extents.size() + " "); 3.145 - for (int loop = 0; loop < extents.size(); loop++) 3.146 - { 3.147 - Extent e = (Extent) extents.get(loop); 3.148 - sb.append("(disk:" + e.disk + " " + 3.149 - "offset:" + e.offset + " " + 3.150 - "size:" + e.size + ")"); 3.151 - } 3.152 - return sb.toString(); 3.153 - } 3.154 - 3.155 - String 3.156 - dump_xen (VirtualBlockDevice vbd) 3.157 - { 3.158 - StringBuffer sb = new StringBuffer(); 3.159 - 3.160 - sb.append("domain:" + vbd.domain + " " + 3.161 - vbd.mode.toString() + " " + 3.162 - "segment:" + vbd.vbdnum + " " + 3.163 - "extents:" + extents.size() + " "); 3.164 - for (int loop = 0; loop < extents.size(); loop++) 3.165 - { 3.166 - Extent e = (Extent) extents.get(loop); 3.167 - sb.append("(disk:" + e.disk + " " + 3.168 - "offset:" + e.offset + " " + 3.169 - "size:" + e.size + ")"); 3.170 - } 3.171 - return sb.toString(); 3.172 - } 3.173 - 3.174 - void 3.175 - dump_xml (PrintWriter out) 3.176 - { 3.177 - out.println(" <virtual_disk>"); 3.178 - out.println(" <name>" + name + "</name>"); 3.179 - out.println(" <key>" + key + "</key>"); 3.180 - if (expiry == null) 3.181 - { 3.182 - out.println(" <expiry>0</expiry>"); 3.183 - } 3.184 - else 3.185 - { 3.186 - out.println(" <expiry>" + expiry.getTime() + "</expiry>"); 3.187 - } 3.188 - out.println(" <extents>"); 3.189 - for (int loop = 0; loop < extents.size(); loop++) 3.190 - { 3.191 - Extent e = (Extent) extents.get(loop); 3.192 - out.println(" <extent>"); 3.193 - out.println(" <disk>" + e.disk + "</disk>"); 3.194 - out.println(" <size>" + e.size + "</size>"); 3.195 - out.println(" <offset>" + e.offset + "</offset>"); 3.196 - out.println(" </extent>"); 3.197 - } 3.198 - out.println(" </extents>"); 3.199 - out.println(" </virtual_disk>"); 3.200 - 3.201 - return; 3.202 - } 3.203 - 3.204 - /* 3.205 - * Add a partition as a XenoPartition. 3.206 - * Chop the partition in to extents and of size "size" sectors 3.207 - * and add them to the virtual disk. 3.208 - */ 3.209 - 3.210 - void 3.211 - add_new_partition (Partition partition, long size) 3.212 - { 3.213 - int loop; 3.214 - 3.215 - for (loop = 0; loop < partition.nr_sects / size; loop++) 3.216 - { 3.217 - Extent extent = new Extent(); 3.218 - 3.219 - extent.disk = partition.major << 8; 3.220 - extent.disk = extent.disk | (partition.minor >> 5) << 5; 3.221 - extent.size = size; 3.222 - extent.offset = partition.start_sect + (size * loop); 3.223 - 3.224 - add_extent(extent); 3.225 - } 3.226 - 3.227 - return; 3.228 - } 3.229 - 3.230 - public String 3.231 - getName() 3.232 - { 3.233 - return name; 3.234 - } 3.235 - 3.236 - public String 3.237 - getKey() 3.238 - { 3.239 - return key; 3.240 - } 3.241 - 3.242 - public String 3.243 - getExpiry() 3.244 - { 3.245 - return expiry.toString(); 3.246 - } 3.247 - 3.248 - public int 3.249 - getExtentCount() 3.250 - { 3.251 - return extents.size(); 3.252 - } 3.253 - 3.254 - public Extent 3.255 - getExtent(int index) 3.256 - { 3.257 - return (Extent) extents.get(index); 3.258 - } 3.259 - 3.260 -}
4.1 --- a/tools/vdmanager/src/uk/ac/cam/cl/xeno/vdmanager/VirtualDiskManager.java Mon Jul 07 14:44:50 2003 +0000 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,289 +0,0 @@ 4.4 -/* 4.5 - * VirtualDiskManager.java 4.6 - * 03.03.26 aho creation 4.7 - */ 4.8 - 4.9 -package uk.ac.cam.cl.xeno.vdmanager; 4.10 - 4.11 -import java.util.Enumeration; 4.12 -import java.util.Vector; 4.13 -import java.util.Hashtable; 4.14 -import java.util.Date; 4.15 -import java.io.PrintWriter; 4.16 - 4.17 -public class 4.18 -VirtualDiskManager 4.19 -{ 4.20 - VirtualDisk free_disk; 4.21 - Vector virtual_disks; 4.22 - Hashtable virtual_block_devices; 4.23 - Hashtable key_hash; 4.24 - 4.25 - VirtualDiskManager () 4.26 - { 4.27 - free_disk = new VirtualDisk("free"); 4.28 - 4.29 - virtual_disks = new Vector(10,5); 4.30 - flush_virtual_block_devices(); 4.31 - key_hash = new Hashtable(100); 4.32 - } 4.33 - 4.34 - public VirtualDisk 4.35 - get_virtual_disk_key (String key) 4.36 - { 4.37 - return ((VirtualDisk) key_hash.get(key)); 4.38 - } 4.39 - 4.40 - public void 4.41 - add_xeno_partition (Partition partition, long size) 4.42 - { 4.43 - free_disk.add_new_partition (partition, size); 4.44 - return; 4.45 - } 4.46 - 4.47 - /* 4.48 - * create a new virtual disk 4.49 - */ 4.50 - 4.51 - public VirtualDisk 4.52 - create_virtual_disk(String name, long size, Date expiry) 4.53 - { 4.54 - VirtualDisk vd = new VirtualDisk (name, expiry); 4.55 - 4.56 - while (size > 0) 4.57 - { 4.58 - Extent e; 4.59 - 4.60 - e = free_disk.remove_extent(); 4.61 - if (e == null) 4.62 - { 4.63 - return null; 4.64 - } 4.65 - size -= e.size; 4.66 - vd.add_extent(e); 4.67 - } 4.68 - 4.69 - add_virtual_disk(vd); 4.70 - 4.71 - return vd; 4.72 - } 4.73 - 4.74 - /* 4.75 - * delete a new virtual disk. extents go back into the free pool 4.76 - */ 4.77 - 4.78 - public void 4.79 - delete_virtual_disk (String key) 4.80 - { 4.81 - VirtualDisk vd; 4.82 - 4.83 - vd = (VirtualDisk) key_hash.get(key); 4.84 - if (vd != null) 4.85 - { 4.86 - Extent e; 4.87 - 4.88 - key_hash.remove(key); 4.89 - virtual_disks.remove(vd); 4.90 - 4.91 - e = vd.remove_extent(); 4.92 - while (e != null) 4.93 - { 4.94 - free_disk.add_extent(e); 4.95 - e = vd.remove_extent(); 4.96 - } 4.97 - } 4.98 - return; 4.99 - } 4.100 - 4.101 - /* 4.102 - * reset the expiry time for a virtual disk 4.103 - */ 4.104 - 4.105 - public void 4.106 - refresh_virtual_disk (String key, Date expiry) 4.107 - { 4.108 - VirtualDisk vd = (VirtualDisk) key_hash.get(key); 4.109 - if (vd != null) 4.110 - { 4.111 - vd.set_expiry(expiry); 4.112 - } 4.113 - } 4.114 - 4.115 - /* 4.116 - * create a new virtual block device 4.117 - */ 4.118 - public VirtualBlockDevice 4.119 - create_virtual_block_device (String key, int domain, int vbd_num, 4.120 - String mode) 4.121 - { 4.122 - VirtualBlockDevice vbd = new VirtualBlockDevice(); 4.123 - VirtualDisk vd = get_virtual_disk_key(key); 4.124 - 4.125 - if (vd == null) 4.126 - { 4.127 - System.err.println("create virtual block device error: unknown key " + 4.128 - "[" + key + "]"); 4.129 - return null; 4.130 - } 4.131 - 4.132 - vbd.key = key; 4.133 - vbd.domain = domain; 4.134 - vbd.vbdnum = vbd_num; 4.135 - 4.136 - if (mode.equals(Mode.READ_ONLY.toString()) || 4.137 - mode.equals("RO") || 4.138 - mode.equals("ro")) 4.139 - { 4.140 - vbd.mode = Mode.READ_ONLY; 4.141 - } 4.142 - else if (mode.equals(Mode.READ_WRITE.toString()) || 4.143 - mode.equals("RW") || 4.144 - mode.equals("rw")) 4.145 - { 4.146 - vbd.mode = Mode.READ_WRITE; 4.147 - } 4.148 - else 4.149 - { 4.150 - System.err.println("create virtual block device error: unknown mode " + 4.151 - "[" + mode + "]"); 4.152 - return null; 4.153 - } 4.154 - 4.155 - add_virtual_block_device(vbd); 4.156 - 4.157 - return vbd; 4.158 - } 4.159 - 4.160 - /* 4.161 - * delete a virtual block device 4.162 - */ 4.163 - public void 4.164 - delete_virtual_block_device (int domain, int vbd_num) 4.165 - { 4.166 - Object hash = get_vbd_hash(domain, vbd_num); 4.167 - VirtualBlockDevice vbd = (VirtualBlockDevice)virtual_block_devices.remove(hash); 4.168 - return; 4.169 - } 4.170 - 4.171 - /* 4.172 - * flush all virtual block devices 4.173 - */ 4.174 - public void 4.175 - flush_virtual_block_devices () 4.176 - { 4.177 - /* isn't automatic garbage collection wonderful? */ 4.178 - virtual_block_devices = new Hashtable(100); 4.179 - } 4.180 - 4.181 - public void 4.182 - add_virtual_disk (VirtualDisk vd) 4.183 - { 4.184 - virtual_disks.add(vd); 4.185 - key_hash.put(vd.get_key(), vd); 4.186 - } 4.187 - 4.188 - public void 4.189 - add_virtual_block_device (VirtualBlockDevice vbd) 4.190 - { 4.191 - Object hash = get_vbd_hash(vbd.domain, vbd.vbdnum); 4.192 - virtual_block_devices.put(hash, vbd); 4.193 - } 4.194 - 4.195 - Object 4.196 - get_vbd_hash (int domain, int vbd_num) 4.197 - { 4.198 - return new Integer(domain * 16 + vbd_num); 4.199 - } 4.200 - 4.201 - public void 4.202 - add_free (VirtualDisk vd) 4.203 - { 4.204 - free_disk = vd; 4.205 - } 4.206 - 4.207 - public String 4.208 - dump_virtualdisk (int segment) 4.209 - { 4.210 - if (segment < 0 || segment >= virtual_disks.size()) 4.211 - { 4.212 - return null; 4.213 - } 4.214 - else 4.215 - { 4.216 - VirtualDisk vd = (VirtualDisk) virtual_disks.get(segment); 4.217 - return (vd.dump(true, true)); 4.218 - } 4.219 - } 4.220 - 4.221 - public String 4.222 - dump_free() 4.223 - { 4.224 - return(free_disk.dump(true, false)); 4.225 - } 4.226 - 4.227 - public String 4.228 - dump_virtualdisks() 4.229 - { 4.230 - StringBuffer sb = new StringBuffer(); 4.231 - 4.232 - for (int i = 0; i < virtual_disks.size(); i++) 4.233 - { 4.234 - VirtualDisk vd = (VirtualDisk) virtual_disks.get(i); 4.235 - if (i == 0) 4.236 - { 4.237 - sb.append(vd.dump(false, true)); 4.238 - } 4.239 - sb.append(vd.dump(false, false)); 4.240 - } 4.241 - 4.242 - return sb.toString(); 4.243 - } 4.244 - 4.245 - public String 4.246 - dump_virtualblockdevices() 4.247 - { 4.248 - StringBuffer sb = new StringBuffer(); 4.249 - boolean first = true; 4.250 - 4.251 - for (Enumeration enumeration = virtual_block_devices.elements() ; 4.252 - enumeration.hasMoreElements() ;) 4.253 - { 4.254 - VirtualBlockDevice vbd = (VirtualBlockDevice) enumeration.nextElement(); 4.255 - if (first) 4.256 - { 4.257 - sb.append(vbd.dump(true)); 4.258 - first = false; 4.259 - } 4.260 - 4.261 - sb.append(vbd.dump(false)); 4.262 - } 4.263 - 4.264 - return sb.toString(); 4.265 - } 4.266 - 4.267 - public void 4.268 - dump_xml(PrintWriter out) 4.269 - { 4.270 - out.println("<free>"); 4.271 - free_disk.dump_xml(out); 4.272 - out.println("</free>"); 4.273 - out.println("<virtual_disks>"); 4.274 - for (int i = 0; i < virtual_disks.size(); i++) 4.275 - { 4.276 - VirtualDisk vd = (VirtualDisk) virtual_disks.get(i); 4.277 - vd.dump_xml(out); 4.278 - } 4.279 - out.println("</virtual_disks>"); 4.280 - out.println("<virtual_block_devices>"); 4.281 - for (Enumeration enumeration = virtual_block_devices.elements() ; 4.282 - enumeration.hasMoreElements() ;) 4.283 - { 4.284 - VirtualBlockDevice vbd = (VirtualBlockDevice) enumeration.nextElement(); 4.285 - vbd.dump_xml(out); 4.286 - } 4.287 - 4.288 - out.println("</virtual_block_devices>"); 4.289 - 4.290 - return; 4.291 - } 4.292 -}