ia64/xen-unstable

changeset 581:d746390f5bc4

bitkeeper revision 1.319.1.2 (3f0c49b9kvjGDv1bC1QhQNwfEHw9kw)

Port of web-based virtual disk manager complete.
author rac61@labyrinth.cl.cam.ac.uk
date Wed Jul 09 16:58:33 2003 +0000 (2003-07-09)
parents bd90bd0c8b23
children e5cb8bd7ebfe
files tools/control/src/org/xenoserver/web/RootBean.java tools/control/web/tmpl/vd-fv.tmpl tools/control/web/tmpl/vd-pa.tmpl tools/control/web/tmpl/vd-par.tmpl tools/control/web/tmpl/vd-pv.tmpl tools/control/web/tmpl/vd-vbdc.tmpl tools/control/web/tmpl/vd-vbdcr.tmpl tools/control/web/tmpl/vd-vbdf.tmpl tools/control/web/tmpl/vd-vbdfr.tmpl tools/control/web/tmpl/vd-vbdv.tmpl tools/control/web/tmpl/vd-vdcr.tmpl tools/control/web/tmpl/vd-vdd.tmpl tools/control/web/tmpl/vd-vddr.tmpl tools/control/web/tmpl/vd-vdr.tmpl tools/control/web/tmpl/vd-vdrr.tmpl tools/control/web/tmpl/vd-vdv.tmpl tools/control/web/tmpl/xenohead.def
line diff
     1.1 --- a/tools/control/src/org/xenoserver/web/RootBean.java	Wed Jul 09 15:58:14 2003 +0000
     1.2 +++ b/tools/control/src/org/xenoserver/web/RootBean.java	Wed Jul 09 16:58:33 2003 +0000
     1.3 @@ -14,10 +14,6 @@ import org.xenoserver.control.VirtualDis
     1.4  import org.xenoserver.control.XML;
     1.5  
     1.6  public class RootBean implements HttpSessionBindingListener {
     1.7 -    static String state_filename_out = "/var/lib/xen/vdstate.xml";
     1.8 -    static String partition_filename = "/proc/partitions";
     1.9 -    static int default_sector_size = 512;
    1.10 -
    1.11      PartitionManager pm;
    1.12      VirtualDiskManager vdm;
    1.13  
    1.14 @@ -34,140 +30,15 @@ public class RootBean implements HttpSes
    1.15      public void valueUnbound(HttpSessionBindingEvent event) {
    1.16          doFlushState();
    1.17      }
    1.18 -
    1.19 -/*
    1.20 -    public int getPartitionCount() {
    1.21 -        return pm.getPartitionCount();
    1.22 -    }
    1.23 -
    1.24 -    public Partition getPartition(int index) {
    1.25 -        return pm.getPartition(index);
    1.26 -    }
    1.27 -
    1.28 -    public String doAddPartition(String partition, String chunksize) {
    1.29 -        Partition p = pm.get_partition(partition);
    1.30 -        String result = "done";
    1.31 -        int loop;
    1.32 -        long size;
    1.33 -
    1.34 -        if (p == null) {
    1.35 -            return (" eh? what partition: " + partition);
    1.36 -        }
    1.37 -
    1.38 -        size = Library.parse_size(chunksize) / default_sector_size;
    1.39 -        if (size == 0) {
    1.40 -            return ("error: invalid chunk size");
    1.41 -        }
    1.42 -        vdm.add_xeno_partition(p, size);
    1.43 -        pm.add_xeno_partition(p);
    1.44 -
    1.45 -        return "done";
    1.46 +    
    1.47 +    public PartitionManager pm() {
    1.48 +        return pm;
    1.49      }
    1.50 -
    1.51 -    public int getVirtualDiskCount() {
    1.52 -        return vdm.getVirtualDiskCount();
    1.53 -    }
    1.54 -
    1.55 -    public VirtualDisk getVirtualDisk(int index) {
    1.56 -        return vdm.getVirtualDisk(index);
    1.57 -    }
    1.58 -
    1.59 -    public VirtualDisk getVirtualDiskKey(String key) {
    1.60 -        return vdm.get_virtual_disk_key(key);
    1.61 -    }
    1.62 -
    1.63 -    public String doCreateVirtualDisk(String name, String size, long expiry) {
    1.64 -        VirtualDisk vd;
    1.65 -        Date date = new Date();
    1.66 -        long parse_size;
    1.67 -
    1.68 -        parse_size = Library.parse_size(size) / default_sector_size;
    1.69 -        if (parse_size == 0) {
    1.70 -            return ("error: invalid size");
    1.71 -        }
    1.72 -        vd =
    1.73 -            vdm.create_virtual_disk(
    1.74 -                name,
    1.75 -                parse_size,
    1.76 -                new Date(date.getTime() + expiry));
    1.77 -
    1.78 -        return ("Virtual Disk created with key: " + vd.get_key());
    1.79 -
    1.80 +    
    1.81 +    public VirtualDiskManager vdm() {
    1.82 +        return vdm;
    1.83      }
    1.84  
    1.85 -    public String doDeleteVirtualDisk(String key) {
    1.86 -        if (key == null || key.trim().equals("")) {
    1.87 -            return ("error: no virtual disk specified");
    1.88 -        }
    1.89 -        vdm.delete_virtual_disk(key);
    1.90 -
    1.91 -        return ("okay");
    1.92 -    }
    1.93 -
    1.94 -    public String doRefreshVirtualDisk(String key, long expiry) {
    1.95 -        VirtualDisk vd = vdm.get_virtual_disk_key(key);
    1.96 -        Date date;
    1.97 -        String s = "";
    1.98 -
    1.99 -        if (vd == null) {
   1.100 -            return ("disk not found: " + key);
   1.101 -        }
   1.102 -        s = vd.get_expiry().toString();
   1.103 -        date = new Date(vd.get_expiry().getTime() + expiry);
   1.104 -        vd.set_expiry(date);
   1.105 -
   1.106 -        return ("okay " + expiry + " " + s + " " + date.toString());
   1.107 -    }
   1.108 -
   1.109 -    public int getFreeExtentCount() {
   1.110 -        VirtualDisk free = vdm.getFreeVirtualDisk();
   1.111 -        return free.getExtentCount();
   1.112 -    }
   1.113 -
   1.114 -    public Extent getFreeExtent(int index) {
   1.115 -        VirtualDisk free = vdm.getFreeVirtualDisk();
   1.116 -        return free.getExtent(index);
   1.117 -    }
   1.118 -
   1.119 -    public Enumeration getVirtualBlockDevices() {
   1.120 -        return vdm.getVirtualBlockDevices();
   1.121 -    }
   1.122 -
   1.123 -    public String doCreateVirtualBlockDevice(
   1.124 -        String vd_key,
   1.125 -        int domain,
   1.126 -        int vbd_num,
   1.127 -        String mode) {
   1.128 -        VirtualBlockDevice vbd;
   1.129 -        VirtualDisk vd;
   1.130 -
   1.131 -        vbd = vdm.create_virtual_block_device(vd_key, domain, vbd_num, mode);
   1.132 -        if (vbd != null) {
   1.133 -            String command;
   1.134 -            FileWriter fw;
   1.135 -
   1.136 -            vd = vdm.get_virtual_disk_key(vd_key);
   1.137 -            command = vd.dump_xen(vbd);
   1.138 -
   1.139 -            try {
   1.140 -                fw = new FileWriter("/proc/xeno/dom0/vhd");
   1.141 -                fw.write(command);
   1.142 -                fw.flush();
   1.143 -                fw.close();
   1.144 -            } catch (Exception e) {
   1.145 -                return (e.toString());
   1.146 -            }
   1.147 -            return command;
   1.148 -        } else {
   1.149 -            return "Error encountered";
   1.150 -        }
   1.151 -    }
   1.152 -
   1.153 -    public String doFlushVirtualBlockDevices() {
   1.154 -        vdm.flush_virtual_block_devices();
   1.155 -        return "done";
   1.156 -    }
   1.157 -*/
   1.158      public void doFlushState() {
   1.159          XML.saveState(pm, vdm, Settings.STATE_OUTPUT_FILE);
   1.160      }
     2.1 --- a/tools/control/web/tmpl/vd-fv.tmpl	Wed Jul 09 15:58:14 2003 +0000
     2.2 +++ b/tools/control/web/tmpl/vd-fv.tmpl	Wed Jul 09 16:58:33 2003 +0000
     2.3 @@ -10,25 +10,32 @@ BREADCRUMB&Virtual Disk Manager&vd.jsp
     2.4  INCLUDE&vdmenu.tmpl
     2.5  <td valign="top">
     2.6  
     2.7 +<%
     2.8 +  VirtualDisk free = root.vdm().getFreeDisk();  
     2.9 +%>
    2.10  
    2.11  <table cellpadding="0" cellspacing="0" border="0">
    2.12  <tbody>
    2.13  
    2.14  <tr><td>
    2.15 +Total available free space: <%= Library.formatSize(free.getSize() * Settings.SECTOR_SIZE,8,true) %>
    2.16 +</td></tr>
    2.17 +
    2.18 +
    2.19 +##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
    2.20 +
    2.21 +<tr><td>
    2.22  <table cellpadding="2" cellspacing="0" border="0">
    2.23  <tbody>
    2.24 -  <tr class="vdh"><td>idx</td><td>disk</td><td>offset</td><td>size </td></tr>
    2.25 +  <tr class="vdh"><td>disk</td><td>offset</td><td>size </td></tr>
    2.26  
    2.27    <%
    2.28 -    long space = 0;
    2.29 -    int count = root.getFreeExtentCount();
    2.30 -    for (int loop = 0; loop < count; loop++)
    2.31 +    Iterator i = free.extents();
    2.32 +    while (i.hasNext())
    2.33      {
    2.34 -      Extent e = root.getFreeExtent(loop);
    2.35 -      space += e.getSize();
    2.36 +      Extent e = (Extent) i.next();
    2.37    %>
    2.38    <tr class="vdt">
    2.39 -  <td              ><%= loop %></td>
    2.40    <td              ><%= e.getDisk() %></td>
    2.41    <td align="right"><%= e.getOffset() %> </td>
    2.42    <td align="right"><%= e.getSize() %> </td>
    2.43 @@ -40,13 +47,6 @@ INCLUDE&vdmenu.tmpl
    2.44  </table>
    2.45  </td></tr>
    2.46  
    2.47 -
    2.48 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
    2.49 -
    2.50 -<tr><td>
    2.51 -Total available freespace: <%= space * 512 / (1024 * 1024) %> MB
    2.52 -</td></tr>
    2.53 -
    2.54  </tbody>
    2.55  </table>
    2.56  
     3.1 --- a/tools/control/web/tmpl/vd-pa.tmpl	Wed Jul 09 15:58:14 2003 +0000
     3.2 +++ b/tools/control/web/tmpl/vd-pa.tmpl	Wed Jul 09 16:58:33 2003 +0000
     3.3 @@ -20,11 +20,11 @@ INCLUDE&vdmenu.tmpl
     3.4  <tbody>
     3.5    <tr class="vdh"><td></td><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr>
     3.6    <%
     3.7 -    int count = root.getPartitionCount();
     3.8 +    int count = root.pm().getPartitionCount();
     3.9      for (int loop = 0; loop < count; loop++)
    3.10      {
    3.11 -	Partition p = root.getPartition(loop);
    3.12 -	if (p.getIsXeno() == true)
    3.13 +	Partition p = root.pm().getPartition(loop);
    3.14 +	if (p.isXeno() == true)
    3.15          {
    3.16    %>
    3.17    <tr class="vds"><td></td>
     4.1 --- a/tools/control/web/tmpl/vd-par.tmpl	Wed Jul 09 15:58:14 2003 +0000
     4.2 +++ b/tools/control/web/tmpl/vd-par.tmpl	Wed Jul 09 16:58:33 2003 +0000
     4.3 @@ -40,7 +40,7 @@ Error: chunk size not specified.<br>
     4.4      {
     4.5  %>
     4.6  output[<%= i %>] =<br>
     4.7 -<%= root.doAddPartition(partitions[i], size) %> <br>
     4.8 +<%= new CommandPartitionAdd(partitions[i], Library.parseSize(size), false).execute() %> <br>
     4.9  <%
    4.10      }
    4.11    }
     5.1 --- a/tools/control/web/tmpl/vd-pv.tmpl	Wed Jul 09 15:58:14 2003 +0000
     5.2 +++ b/tools/control/web/tmpl/vd-pv.tmpl	Wed Jul 09 16:58:33 2003 +0000
     5.3 @@ -16,11 +16,11 @@ note: highlighted entries are currently 
     5.4  <tbody>
     5.5    <tr class="vdh"><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr>
     5.6    <%
     5.7 -    int count = root.getPartitionCount();
     5.8 +    int count = root.pm().getPartitionCount();
     5.9      for (int loop = 0; loop < count; loop++)
    5.10      {
    5.11 -      Partition p = root.getPartition(loop);
    5.12 -      if (p.getIsXeno() == true)
    5.13 +      Partition p = root.pm().getPartition(loop);
    5.14 +      if (p.isXeno() == true)
    5.15        {
    5.16    %>
    5.17    <tr class="vds">
     6.1 --- a/tools/control/web/tmpl/vd-vbdc.tmpl	Wed Jul 09 15:58:14 2003 +0000
     6.2 +++ b/tools/control/web/tmpl/vd-vbdc.tmpl	Wed Jul 09 16:58:33 2003 +0000
     6.3 @@ -16,25 +16,25 @@ INCLUDE&vdmenu.tmpl
     6.4  <tr><td>
     6.5  <table cellpadding="2" cellspacing="0" border="0">
     6.6  <tbody>
     6.7 -  <tr class="vdh"><td></td><td>vd key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
     6.8 +  <tr class="vdh"><td></td><td>vd key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td><td width="5"></td><td>size</td></tr>
     6.9  
    6.10    <%
    6.11 -    int count = root.getVirtualDiskCount();
    6.12 -    for (int loop = 0; loop < count; loop++)
    6.13 +    Iterator i = root.vdm().getVirtualDisks();
    6.14 +    while (i.hasNext())
    6.15      {
    6.16 -      VirtualDisk vd = root.getVirtualDisk(loop);
    6.17 +      VirtualDisk vd = (VirtualDisk) i.next();
    6.18    %>
    6.19      <tr class="vdt">
    6.20        <td>
    6.21 -        <input type="radio" name="vd" 
    6.22 -               <% if (loop == 0) { %> checked <% } %>
    6.23 -               value="<%= vd.getKey() %>">
    6.24 +        <input type="radio" name="vd" value="<%= vd.getKey() %>">
    6.25        </td>
    6.26        <td><%= vd.getKey() %></td>
    6.27        <td></td>
    6.28        <td><%= vd.getName() %></td>
    6.29        <td></td>
    6.30        <td><%= vd.getExpiry() %></td>
    6.31 +      <td></td>
    6.32 +      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
    6.33      </tr>
    6.34    <%
    6.35      }
     7.1 --- a/tools/control/web/tmpl/vd-vbdcr.tmpl	Wed Jul 09 15:58:14 2003 +0000
     7.2 +++ b/tools/control/web/tmpl/vd-vbdcr.tmpl	Wed Jul 09 16:58:33 2003 +0000
     7.3 @@ -46,11 +46,18 @@ Error: No virtual block device number sp
     7.4      {
     7.5        domain = Integer.decode(hsrw.getParameter("domain")).intValue();
     7.6        vbd = Integer.decode(hsrw.getParameter("vbd")).intValue();
     7.7 +      Mode mode;
     7.8 +      if (hsrw.getParameter("mode").equals("rw")) {
     7.9 +        mode = Mode.READ_WRITE;
    7.10 +      } else {
    7.11 +        mode = Mode.READ_ONLY;
    7.12 +      }
    7.13 +      
    7.14  %>
    7.15  output =<br>
    7.16 -<%= root.doCreateVirtualBlockDevice(hsrw.getParameter("vd"),
    7.17 +<%= new CommandVbdCreate(hsrw.getParameter("vd"),
    7.18                                      domain, vbd,
    7.19 -                                     hsrw.getParameter("mode"))  %>
    7.20 +                                     mode).execute()  %>
    7.21  <%
    7.22      }
    7.23      catch (NumberFormatException e)
     8.1 --- a/tools/control/web/tmpl/vd-vbdf.tmpl	Wed Jul 09 15:58:14 2003 +0000
     8.2 +++ b/tools/control/web/tmpl/vd-vbdf.tmpl	Wed Jul 09 16:58:33 2003 +0000
     8.3 @@ -20,14 +20,15 @@ INCLUDE&vdmenu.tmpl
     8.4    <tr class="vdh"><td>vd key</td><td>dom</td><td>vbd</td><td>mode</td></tr>
     8.5  
     8.6    <%
     8.7 -    for (Enumeration e = root.getVirtualBlockDevices(); e.hasMoreElements();)
     8.8 +    for (Iterator i = root.vdm().getVirtualBlockDevices(); i.hasNext();)
     8.9      {
    8.10 -      VirtualBlockDevice vbd = (VirtualBlockDevice) e.nextElement();
    8.11 +      VirtualBlockDevice vbd = (VirtualBlockDevice) i.next();
    8.12 +      VirtualDisk vd = vbd.getVirtualDisk(); 
    8.13    %>
    8.14      <tr class="vdt">
    8.15 -      <td><%= vbd.getKey() %></td>
    8.16 +      <td><%= vd.getKey() %></td>
    8.17        <td><%= vbd.getDomain() %></td>
    8.18 -      <td><%= vbd.getVBDNum() %></td>
    8.19 +      <td><%= vbd.getVbdNum() %></td>
    8.20        <td><%= vbd.getMode().toString() %></td>
    8.21      </tr>
    8.22    <%
     9.1 --- a/tools/control/web/tmpl/vd-vbdfr.tmpl	Wed Jul 09 15:58:14 2003 +0000
     9.2 +++ b/tools/control/web/tmpl/vd-vbdfr.tmpl	Wed Jul 09 16:58:33 2003 +0000
     9.3 @@ -17,7 +17,7 @@ INCLUDE&vdmenu.tmpl
     9.4  <%
     9.5    HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
     9.6  %>
     9.7 -output = <%= root.doFlushVirtualBlockDevices()  %>
     9.8 +output = <%= new CommandVbdFlush().execute()  %>
     9.9  <%
    9.10    root.doFlushState();
    9.11  %>
    10.1 --- a/tools/control/web/tmpl/vd-vbdv.tmpl	Wed Jul 09 15:58:14 2003 +0000
    10.2 +++ b/tools/control/web/tmpl/vd-vbdv.tmpl	Wed Jul 09 16:58:33 2003 +0000
    10.3 @@ -16,16 +16,16 @@ INCLUDE&vdmenu.tmpl
    10.4  
    10.5  
    10.6    <%
    10.7 -    for (Enumeration e = root.getVirtualBlockDevices(); e.hasMoreElements();)
    10.8 +    for (Iterator i = root.vdm().getVirtualBlockDevices(); i.hasNext();)
    10.9      {
   10.10 -      VirtualBlockDevice vbd = (VirtualBlockDevice) e.nextElement();
   10.11 -      VirtualDisk vd = root.getVirtualDiskKey(vbd.getKey()); 
   10.12 +      VirtualBlockDevice vbd = (VirtualBlockDevice) i.next();
   10.13 +      VirtualDisk vd = vbd.getVirtualDisk(); 
   10.14    %>
   10.15      <tr class="vdt">
   10.16        <td><%= vbd.getDomain() %></td>
   10.17 -      <td><%= vbd.getVBDNum() %></td>
   10.18 +      <td><%= vbd.getVbdNum() %></td>
   10.19        <td><%= vbd.getMode().toString() %></td>
   10.20 -      <td><%= vbd.getKey() %></td>
   10.21 +      <td><%= vd.getKey() %></td>
   10.22        <td><%= vd.getName() %></td>
   10.23      </tr>
   10.24    <%
    11.1 --- a/tools/control/web/tmpl/vd-vdcr.tmpl	Wed Jul 09 15:58:14 2003 +0000
    11.2 +++ b/tools/control/web/tmpl/vd-vdcr.tmpl	Wed Jul 09 16:58:33 2003 +0000
    11.3 @@ -60,9 +60,11 @@ Error: expiry time not specified.<br>
    11.4        {
    11.5          expiry *= 24 * 60 * 60 * 1000 * 365;
    11.6        }
    11.7 +      
    11.8 +      expiry += System.currentTimeMillis();
    11.9  %>
   11.10  output =<br>
   11.11 -<%= root.doCreateVirtualDisk( hsrw.getParameter("name"), size, expiry) %>
   11.12 +<%= new CommandVdCreate( hsrw.getParameter("name"), Library.parseSize(size), new Date(expiry)).execute() %>
   11.13  <br>
   11.14  <%
   11.15      }
    12.1 --- a/tools/control/web/tmpl/vd-vdd.tmpl	Wed Jul 09 15:58:14 2003 +0000
    12.2 +++ b/tools/control/web/tmpl/vd-vdd.tmpl	Wed Jul 09 16:58:33 2003 +0000
    12.3 @@ -16,13 +16,13 @@ INCLUDE&vdmenu.tmpl
    12.4  <tr><td>
    12.5  <table cellpadding="2" cellspacing="0" border="0">
    12.6  <tbody>
    12.7 -  <tr class="vdh"><td></td><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
    12.8 +  <tr class="vdh"><td></td><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td><td width="5"></td><td>size</td></tr>
    12.9  
   12.10    <%
   12.11 -    int count = root.getVirtualDiskCount();
   12.12 -    for (int loop = 0; loop < count; loop++)
   12.13 +    Iterator i = root.vdm().getVirtualDisks();
   12.14 +    while (i.hasNext())
   12.15      {
   12.16 -      VirtualDisk vd = root.getVirtualDisk(loop);
   12.17 +      VirtualDisk vd = (VirtualDisk) i.next();
   12.18    %>
   12.19      <tr class="vdt">
   12.20        <td><input type="checkbox" name="vd" value="<%= vd.getKey() %>"></td>
   12.21 @@ -31,6 +31,8 @@ INCLUDE&vdmenu.tmpl
   12.22        <td><%= vd.getName() %></td>
   12.23        <td></td>
   12.24        <td><%= vd.getExpiry() %></td>
   12.25 +      <td></td>
   12.26 +      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
   12.27      </tr>
   12.28    <%
   12.29      }
    13.1 --- a/tools/control/web/tmpl/vd-vddr.tmpl	Wed Jul 09 15:58:14 2003 +0000
    13.2 +++ b/tools/control/web/tmpl/vd-vddr.tmpl	Wed Jul 09 16:58:33 2003 +0000
    13.3 @@ -18,7 +18,7 @@ INCLUDE&vdmenu.tmpl
    13.4  
    13.5  vd= <%= hsrw.getParameter("vd") %>
    13.6  
    13.7 -vd= <%= root.doDeleteVirtualDisk(hsrw.getParameter("vd")) %>
    13.8 +vd= <%= new CommandVdDelete(hsrw.getParameter("vd")).execute() %>
    13.9  
   13.10  <%
   13.11    root.doFlushState();
    14.1 --- a/tools/control/web/tmpl/vd-vdr.tmpl	Wed Jul 09 15:58:14 2003 +0000
    14.2 +++ b/tools/control/web/tmpl/vd-vdr.tmpl	Wed Jul 09 16:58:33 2003 +0000
    14.3 @@ -16,13 +16,13 @@ INCLUDE&vdmenu.tmpl
    14.4  <tr><td>
    14.5  <table cellpadding="2" cellspacing="0" border="0">
    14.6  <tbody>
    14.7 -  <tr class="vdh"><td></td><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
    14.8 +  <tr class="vdh"><td></td><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td><td width="5"></td><td>size</td></tr>
    14.9  
   14.10    <%
   14.11 -    int count = root.getVirtualDiskCount();
   14.12 -    for (int loop = 0; loop < count; loop++)
   14.13 +    Iterator i = root.vdm().getVirtualDisks();
   14.14 +    while (i.hasNext())
   14.15      {
   14.16 -      VirtualDisk vd = root.getVirtualDisk(loop);
   14.17 +      VirtualDisk vd = (VirtualDisk) i.next();
   14.18    %>
   14.19      <tr class="vdt">
   14.20        <td><input type="checkbox" name="vd" value="<%= vd.getKey() %>"></td>
   14.21 @@ -31,6 +31,8 @@ INCLUDE&vdmenu.tmpl
   14.22        <td><%= vd.getName() %></td>
   14.23        <td></td>
   14.24        <td><%= vd.getExpiry() %></td>
   14.25 +      <td></td>
   14.26 +      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
   14.27      </tr>
   14.28    <%
   14.29      }
    15.1 --- a/tools/control/web/tmpl/vd-vdrr.tmpl	Wed Jul 09 15:58:14 2003 +0000
    15.2 +++ b/tools/control/web/tmpl/vd-vdrr.tmpl	Wed Jul 09 16:58:33 2003 +0000
    15.3 @@ -51,10 +51,12 @@ Error: expiry time not specified.<br>
    15.4        expiry *= 24 * 60 * 60 * 1000 * 365;
    15.5      }
    15.6  
    15.7 +	expiry += System.currentTimeMillis();
    15.8 +	
    15.9      for (int i = 0; i < vds.length; i++)
   15.10      {
   15.11  %>
   15.12 -vd = <%= root.doRefreshVirtualDisk(vds[i], expiry) %> <br>
   15.13 +vd = <%= new CommandVdRefresh(vds[i], new Date(expiry)).execute() %> <br>
   15.14  <%
   15.15      }
   15.16    }
    16.1 --- a/tools/control/web/tmpl/vd-vdv.tmpl	Wed Jul 09 15:58:14 2003 +0000
    16.2 +++ b/tools/control/web/tmpl/vd-vdv.tmpl	Wed Jul 09 16:58:33 2003 +0000
    16.3 @@ -12,13 +12,13 @@ INCLUDE&vdmenu.tmpl
    16.4  
    16.5  <table cellpadding="2" cellspacing="0" border="0">
    16.6  <tbody>
    16.7 -  <tr class="vdh"><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
    16.8 +  <tr class="vdh"><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td><td width="5"></td><td>size</td></tr>
    16.9  
   16.10    <%
   16.11 -    int count = root.getVirtualDiskCount();
   16.12 -    for (int loop = 0; loop < count; loop++)
   16.13 +    Iterator i = root.vdm().getVirtualDisks();
   16.14 +    while (i.hasNext())
   16.15      {
   16.16 -      VirtualDisk vd = root.getVirtualDisk(loop);
   16.17 +      VirtualDisk vd = (VirtualDisk) i.next();
   16.18    %>
   16.19      <tr class="vdt">
   16.20        <td><%= vd.getKey() %></td>
   16.21 @@ -26,6 +26,8 @@ INCLUDE&vdmenu.tmpl
   16.22        <td><%= vd.getName() %></td>
   16.23        <td></td>
   16.24        <td><%= vd.getExpiry() %></td>
   16.25 +      <td></td>
   16.26 +      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
   16.27      </tr>
   16.28    <%
   16.29      }
    17.1 --- a/tools/control/web/tmpl/xenohead.def	Wed Jul 09 15:58:14 2003 +0000
    17.2 +++ b/tools/control/web/tmpl/xenohead.def	Wed Jul 09 16:58:33 2003 +0000
    17.3 @@ -8,6 +8,7 @@
    17.4  <%@ page import="org.xenoserver.web.*" %>
    17.5  <%@ page import="org.xenoserver.control.*" %>
    17.6  <%@ page import="java.util.Iterator" %>
    17.7 +<%@ page import="java.util.Date" %>
    17.8  <%@ page import="javax.servlet.http.HttpServletRequestWrapper" %>
    17.9  
   17.10  <html lang="en">