aboutsummaryrefslogtreecommitdiffstats
path: root/tools/control
diff options
context:
space:
mode:
authorsos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>2003-07-10 08:45:03 +0000
committersos22@labyrinth.cl.cam.ac.uk <sos22@labyrinth.cl.cam.ac.uk>2003-07-10 08:45:03 +0000
commit92b531dd8adaee5a568f830f465431d9862d2177 (patch)
tree042a21df6befb7fb6f40ac5deae0fdf91493d74a /tools/control
parentff4863e038ae9c223f13f59fabbae7f46c2a3a3b (diff)
parent84c2a732dece7e1cb5a3026c1f12b03e80b99b95 (diff)
downloadxen-92b531dd8adaee5a568f830f465431d9862d2177.tar.gz
xen-92b531dd8adaee5a568f830f465431d9862d2177.tar.bz2
xen-92b531dd8adaee5a568f830f465431d9862d2177.zip
bitkeeper revision 1.325 (3f0d278fx62UemAA1unbHTgIGvOJ4Q)
Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/rac61/xeno.bk into labyrinth.cl.cam.ac.uk:/auto/groups/xeno/users/sos22/xeno.bk
Diffstat (limited to 'tools/control')
-rw-r--r--tools/control/Makefile24
-rw-r--r--tools/control/build-web.xml (renamed from tools/control/build-xen.xml)13
-rw-r--r--tools/control/src/org/xenoserver/control/Command.java13
-rw-r--r--tools/control/src/org/xenoserver/web/RootBean.java45
-rw-r--r--tools/control/src/org/xenoserver/web/SystemConfigurationBean.java20
-rw-r--r--tools/control/src/uk/ac/cam/cl/xeno/xenctl/RootBean.java239
-rw-r--r--tools/control/src/uk/ac/cam/cl/xeno/xenctl/SystemConfigurationBean.java30
-rw-r--r--tools/control/web/tmpl/dom-del.tmpl16
-rw-r--r--tools/control/web/tmpl/dom-delr.tmpl5
-rw-r--r--tools/control/web/tmpl/dom-lis.tmpl16
-rw-r--r--tools/control/web/tmpl/dom-new.tmpl18
-rw-r--r--tools/control/web/tmpl/dom-newr.tmpl21
-rw-r--r--tools/control/web/tmpl/dom-sta.tmpl15
-rw-r--r--tools/control/web/tmpl/dom-star.tmpl5
-rw-r--r--tools/control/web/tmpl/dom-stp.tmpl15
-rw-r--r--tools/control/web/tmpl/dom-stpr.tmpl3
-rw-r--r--tools/control/web/tmpl/dom.tmpl2
-rw-r--r--tools/control/web/tmpl/makefile21
-rw-r--r--tools/control/web/tmpl/newdom.tmpl172
-rw-r--r--tools/control/web/tmpl/vd-fv.tmpl28
-rw-r--r--tools/control/web/tmpl/vd-pa.tmpl6
-rw-r--r--tools/control/web/tmpl/vd-par.tmpl2
-rw-r--r--tools/control/web/tmpl/vd-pv.tmpl6
-rw-r--r--tools/control/web/tmpl/vd-vbdc.tmpl14
-rw-r--r--tools/control/web/tmpl/vd-vbdcr.tmpl11
-rw-r--r--tools/control/web/tmpl/vd-vbdf.tmpl9
-rw-r--r--tools/control/web/tmpl/vd-vbdfr.tmpl2
-rw-r--r--tools/control/web/tmpl/vd-vbdv.tmpl10
-rw-r--r--tools/control/web/tmpl/vd-vdcr.tmpl4
-rw-r--r--tools/control/web/tmpl/vd-vdd.tmpl10
-rw-r--r--tools/control/web/tmpl/vd-vddr.tmpl2
-rw-r--r--tools/control/web/tmpl/vd-vdr.tmpl10
-rw-r--r--tools/control/web/tmpl/vd-vdrr.tmpl4
-rw-r--r--tools/control/web/tmpl/vd-vdv.tmpl10
-rw-r--r--tools/control/web/tmpl/xenohead.def13
35 files changed, 272 insertions, 562 deletions
diff --git a/tools/control/Makefile b/tools/control/Makefile
index b8ac064450..c302e55b06 100644
--- a/tools/control/Makefile
+++ b/tools/control/Makefile
@@ -1,8 +1,8 @@
-default: cmdline
+default: cmdline web
-install: install-cmdline
+install: install-cmdline install-web
-clean: clean-cmdline
+clean: clean-cmdline clean-web
@@ -19,17 +19,15 @@ clean-cmdline:
-xenctl: FORCE
- (cd web/tmpl; make)
- ant -buildfile build-xen.xml dist
+web: FORCE
+ ant -buildfile build-web.xml dist
-install-xenctl: xenctl
- -ant -buildfile build-xen.xml remove
- ant -buildfile build-xen.xml install
+install-web: xenctl
+ ant -buildfile build-web.xml remove || true
+ ant -buildfile build-web.xml install
-clean-xenctl:
- (cd web/tmpl; make clean)
- ant -buildfile build-xen.xml clean
- rm -f xenctl.jar
+clean-web:
+ ant -buildfile build-web.xml clean
+ rm -f xenctl-web.jar
FORCE:
diff --git a/tools/control/build-xen.xml b/tools/control/build-web.xml
index 7f7a9b3dfb..1973eef888 100644
--- a/tools/control/build-xen.xml
+++ b/tools/control/build-web.xml
@@ -30,7 +30,7 @@
set to the current working directory.
-->
-<project name="My Project" default="compile" basedir=".">
+<project name="xenctl web interface" default="compile" basedir=".">
@@ -112,9 +112,9 @@
<property name="app.name" value="myapp"/>
<property name="app.path" value="/${app.name}"/>
<property name="app.version" value="0.1-dev"/>
- <property name="build.home" value="${basedir}/build"/>
+ <property name="build.home" value="${basedir}/build-web"/>
<property name="catalina.home" value="../../../.."/> <!-- UPDATE THIS! -->
- <property name="dist.home" value="${basedir}/dist"/>
+ <property name="dist.home" value="${basedir}/dist-web"/>
<property name="docs.home" value="${basedir}/docs"/>
<!-- <property name="manager.url" value="http://localhost:8080/manager"/> -->
<property name="src.home" value="${basedir}/src"/>
@@ -261,6 +261,7 @@
description="Delete old build and dist directories">
<delete dir="${build.home}"/>
<delete dir="${dist.home}"/>
+ <exec executable="make" dir="${web.home}/tmpl"><arg value="clean"/></exec>
</target>
@@ -287,6 +288,8 @@
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
<classpath refid="compile.classpath"/>
+ <include name="org/xenoserver/control/**"/>
+ <include name="org/xenoserver/web/**"/>
</javac>
<!-- Copy application resources -->
@@ -314,7 +317,7 @@
-->
- <target name="dist" depends="compile,javadoc"
+ <target name="dist" depends="compile"
description="Create binary distribution">
<!-- Copy documentation subdirectories -->
@@ -432,6 +435,8 @@
<mkdir dir="${build.home}/WEB-INF"/>
<mkdir dir="${build.home}/WEB-INF/classes"/>
+ <!-- create templates -->
+ <exec executable="make" dir="${web.home}/tmpl"/>
<!-- Copy static content of this web application -->
<copy todir="${build.home}">
diff --git a/tools/control/src/org/xenoserver/control/Command.java b/tools/control/src/org/xenoserver/control/Command.java
index c2759b0ea9..682b43bab5 100644
--- a/tools/control/src/org/xenoserver/control/Command.java
+++ b/tools/control/src/org/xenoserver/control/Command.java
@@ -14,6 +14,19 @@ public abstract class Command {
* @throws CommandFailedException if the command could not be completed.
*/
public abstract String execute() throws CommandFailedException;
+
+ /**
+ * Wraps execute() suitable for the web interface: all exceptions are
+ * converted into output strings.
+ * @return Output string, whether command succeeded or not.
+ */
+ public String executeWeb() {
+ try {
+ return execute();
+ } catch (CommandFailedException e) {
+ return e.getMessage();
+ }
+ }
/**
* Construct a string to report the execution of a command.
diff --git a/tools/control/src/org/xenoserver/web/RootBean.java b/tools/control/src/org/xenoserver/web/RootBean.java
new file mode 100644
index 0000000000..858ee9e3ad
--- /dev/null
+++ b/tools/control/src/org/xenoserver/web/RootBean.java
@@ -0,0 +1,45 @@
+/*
+ * RootBean.java
+ * 03.05.05 aho creation
+ */
+
+package org.xenoserver.web;
+
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+
+import org.xenoserver.control.PartitionManager;
+import org.xenoserver.control.Settings;
+import org.xenoserver.control.VirtualDiskManager;
+import org.xenoserver.control.XML;
+
+public class RootBean implements HttpSessionBindingListener {
+ PartitionManager pm;
+ VirtualDiskManager vdm;
+
+ public RootBean() {
+ valueBound(null);
+ }
+
+ public void valueBound(HttpSessionBindingEvent event) {
+ pm = PartitionManager.IT;
+ vdm = VirtualDiskManager.IT;
+ XML.loadState(pm, vdm, Settings.STATE_INPUT_FILE);
+ }
+
+ public void valueUnbound(HttpSessionBindingEvent event) {
+ doFlushState();
+ }
+
+ public PartitionManager pm() {
+ return pm;
+ }
+
+ public VirtualDiskManager vdm() {
+ return vdm;
+ }
+
+ public void doFlushState() {
+ XML.saveState(pm, vdm, Settings.STATE_OUTPUT_FILE);
+ }
+}
diff --git a/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java b/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java
new file mode 100644
index 0000000000..1b67152895
--- /dev/null
+++ b/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java
@@ -0,0 +1,20 @@
+/*
+ * SystemConfigurationBean.java
+ * 03.05.06 aho creation
+ */
+
+package org.xenoserver.web;
+
+import org.xenoserver.control.Defaults;
+
+public class SystemConfigurationBean {
+ private Defaults defaults;
+
+ public SystemConfigurationBean() {
+ defaults = new Defaults();
+ }
+
+ public Defaults getDefaults() {
+ return defaults;
+ }
+}
diff --git a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/RootBean.java b/tools/control/src/uk/ac/cam/cl/xeno/xenctl/RootBean.java
deleted file mode 100644
index 668f922129..0000000000
--- a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/RootBean.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * RootBean.java
- * 03.05.05 aho creation
- */
-
-package uk.ac.cam.cl.xeno.xenctl;
-
-import java.io.FileWriter;
-import java.util.Date;
-import java.util.Enumeration;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-
-public class
-RootBean
- implements HttpSessionBindingListener
-{
- static String state_filename_in = "/var/lib/xen/vdstate.xml";
- static String state_filename_out = "/var/lib/xen/vdstate.xml";
- static String partition_filename = "/proc/partitions";
- static int default_sector_size = 512;
-
- PartitionManager pm;
- VirtualDiskManager vdm;
-
- int counter = 0;
-
- public
- RootBean ()
- {
- valueBound(null);
- }
-
- public void
- valueBound (HttpSessionBindingEvent event)
- {
- pm = new PartitionManager(partition_filename);
- vdm = new VirtualDiskManager();
- XML.load_state(pm, vdm, state_filename_in);
- }
-
- public void
- valueUnbound (HttpSessionBindingEvent event)
- {
- doFlushState();
- }
-
- public int
- getDebugCounter()
- {
- return counter++;
- }
-
- /*************************************************************************/
-
- public int
- getPartitionCount()
- {
- return pm.getPartitionCount();
- }
-
- public Partition
- getPartition(int index)
- {
- return pm.getPartition(index);
- }
-
- public String
- doAddPartition(String partition, String chunksize )
- {
- Partition p = pm.get_partition(partition);
- String result="done";
- int loop;
- long size;
-
- if (p == null)
- {
- return (" eh? what partition: " + partition);
- }
-
- size = Library.parse_size(chunksize) / default_sector_size;
- if (size == 0)
- {
- return ("error: invalid chunk size");
- }
- vdm.add_xeno_partition(p, size);
- pm.add_xeno_partition(p);
-
- /* return pm.dump(true); */
- return "done";
- }
-
- /*************************************************************************/
-
- public int
- getVirtualDiskCount ()
- {
- return vdm.getVirtualDiskCount();
- }
-
- public VirtualDisk
- getVirtualDisk (int index)
- {
- return vdm.getVirtualDisk(index);
- }
-
- public VirtualDisk
- getVirtualDiskKey (String key)
- {
- return vdm.get_virtual_disk_key(key);
- }
-
- public String
- doCreateVirtualDisk (String name, String size, long expiry)
- {
- VirtualDisk vd;
- Date date = new Date();
- long parse_size;
-
-
- parse_size = Library.parse_size(size)/default_sector_size;
- if (parse_size == 0)
- {
- return ("error: invalid size");
- }
- vd = vdm.create_virtual_disk(name, parse_size,
- new Date(date.getTime() + expiry));
-
- return ("Virtual Disk created with key: " + vd.get_key());
-
- }
-
- public String
- doDeleteVirtualDisk (String key)
- {
- if (key == null ||
- key.trim().equals(""))
- {
- return ("error: no virtual disk specified");
- }
- vdm.delete_virtual_disk(key);
-
- return ("okay");
- }
-
- public String
- doRefreshVirtualDisk (String key, long expiry)
- {
- VirtualDisk vd = vdm.get_virtual_disk_key(key);
- Date date;
- String s = "";
-
- if (vd == null)
- {
- return ("disk not found: " + key);
- }
- s = vd.get_expiry().toString();
- date = new Date(vd.get_expiry().getTime() + expiry);
- vd.set_expiry(date);
-
- return ("okay " + expiry + " " + s + " " + date.toString());
- }
-
- /*************************************************************************/
-
- public int
- getFreeExtentCount ()
- {
- VirtualDisk free = vdm.getFreeVirtualDisk();
- return free.getExtentCount();
- }
-
- public Extent
- getFreeExtent (int index)
- {
- VirtualDisk free = vdm.getFreeVirtualDisk();
- return free.getExtent(index);
- }
-
- /*************************************************************************/
-
- public Enumeration
- getVirtualBlockDevices ()
- {
- return vdm.getVirtualBlockDevices();
- }
-
- public String
- doCreateVirtualBlockDevice (String vd_key, int domain,
- int vbd_num, String mode)
- {
- VirtualBlockDevice vbd;
- VirtualDisk vd;
-
- vbd = vdm.create_virtual_block_device(vd_key, domain, vbd_num, mode);
- if (vbd != null)
- {
- String command;
- FileWriter fw;
-
- vd = vdm.get_virtual_disk_key(vd_key);
- command = vd.dump_xen(vbd);
-
- try
- {
- fw = new FileWriter("/proc/xeno/dom0/vhd");
- fw.write(command);
- fw.flush();
- fw.close();
- }
- catch (Exception e)
- {
- return (e.toString());
- }
- return command;
- }
- else
- {
- return "Error encountered";
- }
- }
-
- public String
- doFlushVirtualBlockDevices()
- {
- vdm.flush_virtual_block_devices();
- return "done";
- }
-
- /*************************************************************************/
-
-
- public void
- doFlushState ()
- {
- XML.dump_state(pm, vdm, state_filename_out);
- }
-
-}
diff --git a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/SystemConfigurationBean.java b/tools/control/src/uk/ac/cam/cl/xeno/xenctl/SystemConfigurationBean.java
deleted file mode 100644
index 7c2605d8ce..0000000000
--- a/tools/control/src/uk/ac/cam/cl/xeno/xenctl/SystemConfigurationBean.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SystemConfigurationBean.java
- * 03.05.06 aho creation
- */
-
-package uk.ac.cam.cl.xeno.xenctl;
-
-import java.io.*;
-import java.lang.Process;
-import java.lang.Runtime;
-import uk.ac.cam.cl.xeno.domctl.Defaults;
-
-public class
-SystemConfigurationBean
-{
- Defaults defaults;
-
- public
- SystemConfigurationBean ()
- {
- defaults = new Defaults();
- }
-
- public Defaults
- getDefaults ()
- {
- return defaults;
- }
-
-}
diff --git a/tools/control/web/tmpl/dom-del.tmpl b/tools/control/web/tmpl/dom-del.tmpl
index 1c71fba836..b6a9810c4e 100644
--- a/tools/control/web/tmpl/dom-del.tmpl
+++ b/tools/control/web/tmpl/dom-del.tmpl
@@ -15,9 +15,15 @@ INCLUDE&dommenu.tmpl
<tbody>
<tr><td>
<%
- CommandList command_list = new CommandList();
- Defaults d = sc.getDefaults();
- Domain domains[] = command_list.executeCommand(d);
+ CommandDomainList list = new CommandDomainList(sc.getDefaults());
+ String output = list.executeWeb();
+ Domain domains[] = list.domains();
+ if (output != null)
+ {
+%>
+<%= output %>
+<%
+ } else {
%>
<table cellpadding="2" cellspacing="0" border="0">
@@ -45,6 +51,10 @@ INCLUDE&dommenu.tmpl
</table>
</td></tr>
+<%
+ }
+%>
+
##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
<tr><td>
diff --git a/tools/control/web/tmpl/dom-delr.tmpl b/tools/control/web/tmpl/dom-delr.tmpl
index 04218eb72b..9dad9de69e 100644
--- a/tools/control/web/tmpl/dom-delr.tmpl
+++ b/tools/control/web/tmpl/dom-delr.tmpl
@@ -17,7 +17,6 @@ INCLUDE&dommenu.tmpl
<%
HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
Defaults d = sc.getDefaults();
- CommandDestroy command_destroy = new CommandDestroy();
String domains[] = hsrw.getParameterValues("dom");
boolean force = hsrw.getParameter("force").equals("true");
@@ -34,8 +33,8 @@ Error: no domain specified.<br>
{
%>
result <%= domains[i] %> =
- <%= command_destroy.executeCommand(d, Integer.parseInt(domains[i]),
- force) %> <br>
+ <%= new CommandDomainDestroy(d, Integer.parseInt(domains[i]),
+ force).executeWeb() %> <br>
<%
}
}
diff --git a/tools/control/web/tmpl/dom-lis.tmpl b/tools/control/web/tmpl/dom-lis.tmpl
index 7a479a0f87..5ff61e1ab3 100644
--- a/tools/control/web/tmpl/dom-lis.tmpl
+++ b/tools/control/web/tmpl/dom-lis.tmpl
@@ -11,9 +11,15 @@ INCLUDE&dommenu.tmpl
<td valign="top">
<%
- CommandList command_list = new CommandList();
- Defaults d = sc.getDefaults();
- Domain domains[] = command_list.executeCommand(d);
+ CommandDomainList list = new CommandDomainList(sc.getDefaults());
+ String output = list.executeWeb();
+ Domain domains[] = list.domains();
+ if (output != null)
+ {
+%>
+<%= output %>
+<%
+ } else {
%>
<table cellpadding="2" cellspacing="0" border="0">
@@ -38,7 +44,9 @@ INCLUDE&dommenu.tmpl
%>
</tbody>
</table>
-
+<%
+ }
+%>
</td>
</tbody>
diff --git a/tools/control/web/tmpl/dom-new.tmpl b/tools/control/web/tmpl/dom-new.tmpl
index b442b72537..6025225e10 100644
--- a/tools/control/web/tmpl/dom-new.tmpl
+++ b/tools/control/web/tmpl/dom-new.tmpl
@@ -95,19 +95,19 @@ INCLUDE&dommenu.tmpl
<td></td> <td></td>
<td class="block" align="right">IP address</td>
<td></td>
- <td> <input type="text" size="15" name="ip" value="<%= d.NWIP %>"> </td>
+ <td> <input type="text" size="15" name="ip" value="<%= d.nwIP %>"> </td>
</tr>
<tr>
<td></td> <td></td>
<td class="block" align="right">Gateway</td>
<td></td>
- <td> <input type="text" size="15" name="gw" value="<%= d.NWGW %>"> </td>
+ <td> <input type="text" size="15" name="gw" value="<%= d.nwGateway %>"> </td>
</tr>
<tr>
<td></td> <td></td>
<td class="block" align="right">Netmask</td>
<td></td>
- <td> <input type="text" size="15" name="mask" value="<%= d.NWMask %>"> </td>
+ <td> <input type="text" size="15" name="mask" value="<%= d.nwMask %>"> </td>
</tr>
##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
@@ -121,11 +121,11 @@ INCLUDE&dommenu.tmpl
<tr>
<td></td>
- <td align="right">NFS<input type="radio" name="root" value="nfs"></td>
+ <td align="right">NFS<input type="radio" checked name="root" value="nfs"></td>
<td align="right">path</td>
<td></td>
<td>
- <input type="text" size="40" name="nfsroot" value="<%= d.NWNFSRoot %>">
+ <input type="text" size="40" name="nfsroot" value="<%= d.nwNFSRoot %>">
</td>
</tr>
<tr>
@@ -133,7 +133,7 @@ INCLUDE&dommenu.tmpl
<td align="right">server</td>
<td></td>
<td>
- <input type="text" size="15" name="nfsserver" value="<%= d.NWNFSServer%>">
+ <input type="text" size="15" name="nfsserver" value="<%= d.nwNFSServer%>">
</td>
</tr>
##WHITESPACE##
@@ -143,13 +143,13 @@ INCLUDE&dommenu.tmpl
<td align="right">path</td>
<td></td>
<td>
- <input type="text" size="40" name="rd" value="/usr/isolinux/initrd.gz">
+ <input type="text" size="40" name="rd" value="<%= d.domainInitRD %>">
</td>
</tr>
##WHITESPACE##
<tr>
<td></td>
- <td align="right">physical disk<input type="radio" checked name="root" value="pdisk"></td>
+ <td align="right">physical disk<input type="radio" name="root" value="pdisk"></td>
<td align="right">path</td>
<td></td>
<td><input type="text" size="40" name="pdisk" value="/dev/sda8"></td>
@@ -172,7 +172,7 @@ INCLUDE&dommenu.tmpl
<td></td>
<td colspan=2 align="right"></td>
<td></td>
- <td> <input type="text" size="40" name="args" value="ro"> </td>
+ <td> <input type="text" size="40" name="args" value="<%= d.args %>"> </td>
</tr>
diff --git a/tools/control/web/tmpl/dom-newr.tmpl b/tools/control/web/tmpl/dom-newr.tmpl
index 2800eac702..f762d3269a 100644
--- a/tools/control/web/tmpl/dom-newr.tmpl
+++ b/tools/control/web/tmpl/dom-newr.tmpl
@@ -16,7 +16,6 @@ INCLUDE&dommenu.tmpl
<%
HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
Defaults d = sc.getDefaults();
- CommandNew command_new = new CommandNew();
String root_device = hsrw.getParameter("root");
String nfsroot = null;
@@ -73,8 +72,9 @@ nw_host = <%= hsrw.getParameter("hostname") %>
<br>
root = <%= disk %>
<br>
-output = <br><%=
- command_new.executeCommand(d,
+output = <br>
+<%
+ CommandDomainNew command_new = new CommandDomainNew(d,
hsrw.getParameter("name"),
Integer.parseInt(hsrw.getParameter("size")),
hsrw.getParameter("image"),
@@ -87,7 +87,20 @@ output = <br><%=
hsrw.getParameter("gw"),
hsrw.getParameter("mask"),
nfsserver,
- hsrw.getParameter("hostname"))
+ hsrw.getParameter("hostname"));
+ String oneline = command_new.executeWeb();
+ if ( oneline != null ) {
+%>
+<%= oneline %><br>
+<%
+ } else {
+ String[] output = command_new.output();
+ for (int i = 0; i < output.length; i++) {
+%>
+<%= output[i] %><br>
+<%
+ }
+ }
%>
</td>
diff --git a/tools/control/web/tmpl/dom-sta.tmpl b/tools/control/web/tmpl/dom-sta.tmpl
index 06fda1a96a..48fa3ca3be 100644
--- a/tools/control/web/tmpl/dom-sta.tmpl
+++ b/tools/control/web/tmpl/dom-sta.tmpl
@@ -15,9 +15,15 @@ INCLUDE&dommenu.tmpl
<tbody>
<tr><td>
<%
- CommandList command_list = new CommandList();
- Defaults d = sc.getDefaults();
- Domain domains[] = command_list.executeCommand(d);
+ CommandDomainList list = new CommandDomainList(sc.getDefaults());
+ String output = list.executeWeb();
+ Domain domains[] = list.domains();
+ if (output != null)
+ {
+%>
+<%= output %>
+<%
+ } else {
%>
<table cellpadding="2" cellspacing="0" border="0">
@@ -44,6 +50,9 @@ INCLUDE&dommenu.tmpl
</tbody>
</table>
</td></tr>
+<%
+ }
+%>
##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
diff --git a/tools/control/web/tmpl/dom-star.tmpl b/tools/control/web/tmpl/dom-star.tmpl
index 2c3b56ef3d..b9110cfca8 100644
--- a/tools/control/web/tmpl/dom-star.tmpl
+++ b/tools/control/web/tmpl/dom-star.tmpl
@@ -17,7 +17,6 @@ INCLUDE&dommenu.tmpl
<%
HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
Defaults d = sc.getDefaults();
- CommandStart command_start = new CommandStart();
String domains[] = hsrw.getParameterValues("dom");
@@ -32,8 +31,8 @@ Error: no domain specified.<br>
for (int i = 0; i < domains.length; i++)
{
%>
-result <%= domains[i] %> =<br>
-<%= command_start.executeCommand(d, Integer.parseInt(domains[i])) %> <br>
+result <%= domains[i] %> =
+<%= new CommandDomainStart(d, Integer.parseInt(domains[i])).executeWeb() %><br>
<%
}
}
diff --git a/tools/control/web/tmpl/dom-stp.tmpl b/tools/control/web/tmpl/dom-stp.tmpl
index 8587a5a594..6e9b34989c 100644
--- a/tools/control/web/tmpl/dom-stp.tmpl
+++ b/tools/control/web/tmpl/dom-stp.tmpl
@@ -15,9 +15,15 @@ INCLUDE&dommenu.tmpl
<tbody>
<tr><td>
<%
- CommandList command_list = new CommandList();
- Defaults d = sc.getDefaults();
- Domain domains[] = command_list.executeCommand(d);
+ CommandDomainList list = new CommandDomainList(sc.getDefaults());
+ String output = list.executeWeb();
+ Domain domains[] = list.domains();
+ if (output != null)
+ {
+%>
+<%= output %>
+<%
+ } else {
%>
<table cellpadding="2" cellspacing="0" border="0">
@@ -44,6 +50,9 @@ INCLUDE&dommenu.tmpl
</tbody>
</table>
</td></tr>
+<%
+ }
+%>
##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
diff --git a/tools/control/web/tmpl/dom-stpr.tmpl b/tools/control/web/tmpl/dom-stpr.tmpl
index a2eb6b23a6..148afb83a1 100644
--- a/tools/control/web/tmpl/dom-stpr.tmpl
+++ b/tools/control/web/tmpl/dom-stpr.tmpl
@@ -17,7 +17,6 @@ INCLUDE&dommenu.tmpl
<%
HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
Defaults d = sc.getDefaults();
- CommandStop command_stop = new CommandStop();
String domains[] = hsrw.getParameterValues("dom");
@@ -33,7 +32,7 @@ Error: no domain specified.<br>
{
%>
result <%= domains[i] %> =
- <%= command_stop.executeCommand(d, Integer.parseInt(domains[i])) %> <br>
+<%= new CommandDomainStop(d, Integer.parseInt(domains[i])).executeWeb() %><br>
<%
}
}
diff --git a/tools/control/web/tmpl/dom.tmpl b/tools/control/web/tmpl/dom.tmpl
index 6e602c979f..f107cd5e10 100644
--- a/tools/control/web/tmpl/dom.tmpl
+++ b/tools/control/web/tmpl/dom.tmpl
@@ -16,7 +16,7 @@ INCLUDE&dommenu.tmpl
<tr><td nowrap="nowrap">Domain Manager</td></tr>
<tr><td></td></tr>
<!--
- <tr><td><%= d.XIToolsDir %></td></tr>
+ <tr><td><%= d.xiToolsDir %></td></tr>
-->
</tbody>
</table>
diff --git a/tools/control/web/tmpl/makefile b/tools/control/web/tmpl/makefile
index a9e2a1c392..9e8ee2eca0 100644
--- a/tools/control/web/tmpl/makefile
+++ b/tools/control/web/tmpl/makefile
@@ -1,5 +1,5 @@
src0 = xenostyle.css
-src1 = index.jsp newdom.jsp about.jsp help.jsp vd.jsp \
+src1 = index.jsp about.jsp help.jsp vd.jsp \
vd-pv.jsp vd-pa.jsp vd-vdv.jsp vd-vdc.jsp vd-vdd.jsp vd-vdr.jsp \
vd-fv.jsp vd-vbdv.jsp vd-vbdc.jsp vd-vbdd.jsp vd-vbdf.jsp \
vd-par.jsp vd-vdcr.jsp vd-vddr.jsp vd-vdrr.jsp \
@@ -7,7 +7,8 @@ src1 = index.jsp newdom.jsp about.jsp help.jsp vd.jsp \
dom.jsp dom-lis.jsp dom-new.jsp dom-newr.jsp dom-sta.jsp dom-star.jsp \
dom-stp.jsp dom-stpr.jsp dom-del.jsp dom-delr.jsp
target = ..
-target1 = $(target)/index.jsp $(target)/newdom.jsp $(target)/vd.jsp \
+target0 = $(target)/xenostyle.css
+target1 = $(target)/index.jsp $(target)/vd.jsp \
$(target)/vd-pv.jsp $(target)/vd-pa.jsp $(target)/vd-vdv.jsp \
$(target)/vd-vdc.jsp $(target)/vd-vdd.jsp $(target)/vd-vdr.jsp \
$(target)/vd-fv.jsp $(target)/vd-vbdv.jsp $(target)/vd-vbdc.jsp \
@@ -22,14 +23,18 @@ target1 = $(target)/index.jsp $(target)/newdom.jsp $(target)/vd.jsp \
.SUFFIXES: .tmpl .jsp
-.tmpl.jsp:
- ./install.pl $*
+all: $(target1) $(target0)
-all: $(src0) $(src1)
+$(target)/index.jsp: index.tmpl
./install.pl -s -home index
- mv *.jsp $(target)
+ mv index.jsp $(target)
+
+$(target)/%.jsp: %.tmpl
+ ./install.pl $*
+ mv $*.jsp $(target)
+
+$(target0): $(src0)
cp -f $(src0) $(target)
clean:
- rm -f $(target1)
- rm -f $(target)/$(src0)
+ rm -f $(target1) $(target0)
diff --git a/tools/control/web/tmpl/newdom.tmpl b/tools/control/web/tmpl/newdom.tmpl
deleted file mode 100644
index 47af39f4a8..0000000000
--- a/tools/control/web/tmpl/newdom.tmpl
+++ /dev/null
@@ -1,172 +0,0 @@
-New Domain
-SECTION&XenoServers
-
-<!-- content -->
-<img src="pixel.gif" class="block" width="1" height="12">
-
-<form>
-<table cellpadding="0" cellspacing="0" border="0">
-<tbody>
-<tr>
- <td width="50"></td>
- <td></td>
- <td></td>
- <td width="7"></td>
- <td></td>
-</tr>
-
-<tr>
- <td></td>
- <td class="block" colspan=4><b>Create A New Domain</b></td>
-</tr>
-
-##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
-
-<tr>
- <td></td>
- <td class="block" colspan=4>Memory Size</td>
-</tr>
-<tr>
- <td></td> <td></td> <td></td> <td></td>
- <td> <input type="text" size="5" value="64"> MB </td>
-</tr>
-
-##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
-
-<tr>
- <td></td>
- <td class="block" colspan=4>Kernel Image</td>
-</tr>
-<tr>
- <td></td>
- <td colspan=2 align="right">path</td>
- <td></td>
- <td> <input type="text" size="40" value="/usr/src/xeno/install/xenolinux.gz"> </td>
-</tr>
-
-##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
-
-<tr>
- <td></td>
- <td class="block" colspan=4>IP Config</td>
-</tr>
-<tr>
- <td></td> <td></td>
- <td class="block" align="right">IP address</td>
- <td></td>
- <td> <input type="text" size="15" value="128.232.35.202"> </td>
-</tr>
-<tr>
- <td></td> <td></td>
- <td class="block" align="right">Gateway</td>
- <td></td>
- <td> <input type="text" size="15" value="128.232.32.1"> </td>
-</tr>
-<tr>
- <td></td> <td></td>
- <td class="block" align="right">Netmask</td>
- <td></td>
- <td> <input type="text" size="15" value="255.255.240.0"> </td>
-</tr>
-<tr>
- <td></td> <td></td>
- <td class="block" align="right">New Name</td>
- <td></td>
- <td> <input type="text" size="15"> </td>
-</tr>
-
-##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
-
-<tr>
- <td></td>
- <td class="block" colspan=2>Root File System</td>
-</tr>
-
-##WHITESPACE##
-
-<tr>
- <td></td>
- <td align="right">NFS<input type="radio" name="root" value="nfs"></td>
- <td align="right">path</td>
- <td></td>
- <td><input type="text" size="40" value="/usr/groups/xeno/srgboot/mousetrap/root0"></td>
-</tr>
-<tr>
- <td></td> <td></td>
- <td align="right">server</td>
- <td></td>
- <td><input type="text" size="15" value="128.232.32.20"></td>
-</tr>
- ##WHITESPACE##
-<tr>
- <td></td>
- <td align="right">ramdisk<input type="radio" name="root" value="ram"></td>
- <td align="right">path</td>
- <td></td>
- <td><input type="text" size="40" value="/usr/isolinux/initrd.gz"></td>
-</tr>
- ##WHITESPACE##
-<tr>
- <td></td>
- <td align="right">raw partition<input type="radio" name="root" value="raw"></td>
- <td align="right">path</td>
- <td></td>
- <td><input type="text" size="40" value="/dev/xsda8"></td>
-</tr>
- ##WHITESPACE##
-<tr>
- <td></td>
- <td align="right">virtual disk<input type="radio" checked name="root" value="virtual"></td>
- <td align="right">path</td>
- <td></td>
- <td><input type="text" size="40" value="/dev/xvda0"></td>
-</tr>
-
-##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
-
-<tr>
- <td></td>
- <td class="block" colspan=4>Extra Arguments</td>
-</tr>
-<tr>
- <td></td>
- <td colspan=2 align="right"></td>
- <td></td>
- <td> <input type="text" size="40"> </td>
-</tr>
-
-
-##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
-
-<tr>
- <td></td>
- <td><input type="submit" value="refresh"></td>
-</tr>
-
-##WHITESPACE##
-
-<tr>
- <td></td>
- <td colspan=4>
- <textarea cols="60" rows="5" name="commandline">
-When you press refresh, the sample command line shows
-up here. The user has the option of editing it before
-pressing execute below. e.g.
-./newdom 16000 image 128.232.35.202 ip=128.232.35.202:128.232.32.20:128.232.32.1:255.255.240.0::eth0:off root=/dev/xsda9 ro
-</textarea>
-</td></tr>
-
-##WHITESPACE##
-
-<tr>
- <td></td>
- <td><input type="submit" value="execute"></td>
-</tr>
-
-</tbody>
-</table>
-</form>
-
-
-
-<!-- end content -->
diff --git a/tools/control/web/tmpl/vd-fv.tmpl b/tools/control/web/tmpl/vd-fv.tmpl
index e8b41a2bb5..fa9ee1f838 100644
--- a/tools/control/web/tmpl/vd-fv.tmpl
+++ b/tools/control/web/tmpl/vd-fv.tmpl
@@ -10,25 +10,32 @@ BREADCRUMB&Virtual Disk Manager&vd.jsp
INCLUDE&vdmenu.tmpl
<td valign="top">
+<%
+ VirtualDisk free = root.vdm().getFreeDisk();
+%>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td>
+Total available free space: <%= Library.formatSize(free.getSize() * Settings.SECTOR_SIZE,8,true) %>
+</td></tr>
+
+
+##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
+
+<tr><td>
<table cellpadding="2" cellspacing="0" border="0">
<tbody>
- <tr class="vdh"><td>idx</td><td>disk</td><td>offset</td><td>size </td></tr>
+ <tr class="vdh"><td>disk</td><td>offset</td><td>size </td></tr>
<%
- long space = 0;
- int count = root.getFreeExtentCount();
- for (int loop = 0; loop < count; loop++)
+ Iterator i = free.extents();
+ while (i.hasNext())
{
- Extent e = root.getFreeExtent(loop);
- space += e.getSize();
+ Extent e = (Extent) i.next();
%>
<tr class="vdt">
- <td ><%= loop %></td>
<td ><%= e.getDisk() %></td>
<td align="right"><%= e.getOffset() %> </td>
<td align="right"><%= e.getSize() %> </td>
@@ -40,13 +47,6 @@ INCLUDE&vdmenu.tmpl
</table>
</td></tr>
-
-##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
-
-<tr><td>
-Total available freespace: <%= space * 512 / (1024 * 1024) %> MB
-</td></tr>
-
</tbody>
</table>
diff --git a/tools/control/web/tmpl/vd-pa.tmpl b/tools/control/web/tmpl/vd-pa.tmpl
index e71a6bf195..9b8ec98c60 100644
--- a/tools/control/web/tmpl/vd-pa.tmpl
+++ b/tools/control/web/tmpl/vd-pa.tmpl
@@ -20,11 +20,11 @@ INCLUDE&vdmenu.tmpl
<tbody>
<tr class="vdh"><td></td><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr>
<%
- int count = root.getPartitionCount();
+ int count = root.pm().getPartitionCount();
for (int loop = 0; loop < count; loop++)
{
- Partition p = root.getPartition(loop);
- if (p.getIsXeno() == true)
+ Partition p = root.pm().getPartition(loop);
+ if (p.isXeno() == true)
{
%>
<tr class="vds"><td></td>
diff --git a/tools/control/web/tmpl/vd-par.tmpl b/tools/control/web/tmpl/vd-par.tmpl
index b72e99b814..a88602441a 100644
--- a/tools/control/web/tmpl/vd-par.tmpl
+++ b/tools/control/web/tmpl/vd-par.tmpl
@@ -40,7 +40,7 @@ Error: chunk size not specified.<br>
{
%>
output[<%= i %>] =<br>
-<%= root.doAddPartition(partitions[i], size) %> <br>
+<%= new CommandPartitionAdd(partitions[i], Library.parseSize(size), false).execute() %> <br>
<%
}
}
diff --git a/tools/control/web/tmpl/vd-pv.tmpl b/tools/control/web/tmpl/vd-pv.tmpl
index 8195f82964..4647f337a5 100644
--- a/tools/control/web/tmpl/vd-pv.tmpl
+++ b/tools/control/web/tmpl/vd-pv.tmpl
@@ -16,11 +16,11 @@ note: highlighted entries are currently being used as xeno partitions.
<tbody>
<tr class="vdh"><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr>
<%
- int count = root.getPartitionCount();
+ int count = root.pm().getPartitionCount();
for (int loop = 0; loop < count; loop++)
{
- Partition p = root.getPartition(loop);
- if (p.getIsXeno() == true)
+ Partition p = root.pm().getPartition(loop);
+ if (p.isXeno() == true)
{
%>
<tr class="vds">
diff --git a/tools/control/web/tmpl/vd-vbdc.tmpl b/tools/control/web/tmpl/vd-vbdc.tmpl
index e6952182b8..f6b560badc 100644
--- a/tools/control/web/tmpl/vd-vbdc.tmpl
+++ b/tools/control/web/tmpl/vd-vbdc.tmpl
@@ -16,25 +16,25 @@ INCLUDE&vdmenu.tmpl
<tr><td>
<table cellpadding="2" cellspacing="0" border="0">
<tbody>
- <tr class="vdh"><td></td><td>vd key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
+ <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>
<%
- int count = root.getVirtualDiskCount();
- for (int loop = 0; loop < count; loop++)
+ Iterator i = root.vdm().getVirtualDisks();
+ while (i.hasNext())
{
- VirtualDisk vd = root.getVirtualDisk(loop);
+ VirtualDisk vd = (VirtualDisk) i.next();
%>
<tr class="vdt">
<td>
- <input type="radio" name="vd"
- <% if (loop == 0) { %> checked <% } %>
- value="<%= vd.getKey() %>">
+ <input type="radio" name="vd" value="<%= vd.getKey() %>">
</td>
<td><%= vd.getKey() %></td>
<td></td>
<td><%= vd.getName() %></td>
<td></td>
<td><%= vd.getExpiry() %></td>
+ <td></td>
+ <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
</tr>
<%
}
diff --git a/tools/control/web/tmpl/vd-vbdcr.tmpl b/tools/control/web/tmpl/vd-vbdcr.tmpl
index 656be575fc..05bd41992b 100644
--- a/tools/control/web/tmpl/vd-vbdcr.tmpl
+++ b/tools/control/web/tmpl/vd-vbdcr.tmpl
@@ -46,11 +46,18 @@ Error: No virtual block device number specified.<br>
{
domain = Integer.decode(hsrw.getParameter("domain")).intValue();
vbd = Integer.decode(hsrw.getParameter("vbd")).intValue();
+ Mode mode;
+ if (hsrw.getParameter("mode").equals("rw")) {
+ mode = Mode.READ_WRITE;
+ } else {
+ mode = Mode.READ_ONLY;
+ }
+
%>
output =<br>
-<%= root.doCreateVirtualBlockDevice(hsrw.getParameter("vd"),
+<%= new CommandVbdCreate(hsrw.getParameter("vd"),
domain, vbd,
- hsrw.getParameter("mode")) %>
+ mode).execute() %>
<%
}
catch (NumberFormatException e)
diff --git a/tools/control/web/tmpl/vd-vbdf.tmpl b/tools/control/web/tmpl/vd-vbdf.tmpl
index 0dbcc8d93d..eb46b158d6 100644
--- a/tools/control/web/tmpl/vd-vbdf.tmpl
+++ b/tools/control/web/tmpl/vd-vbdf.tmpl
@@ -20,14 +20,15 @@ INCLUDE&vdmenu.tmpl
<tr class="vdh"><td>vd key</td><td>dom</td><td>vbd</td><td>mode</td></tr>
<%
- for (Enumeration e = root.getVirtualBlockDevices(); e.hasMoreElements();)
+ for (Iterator i = root.vdm().getVirtualBlockDevices(); i.hasNext();)
{
- VirtualBlockDevice vbd = (VirtualBlockDevice) e.nextElement();
+ VirtualBlockDevice vbd = (VirtualBlockDevice) i.next();
+ VirtualDisk vd = vbd.getVirtualDisk();
%>
<tr class="vdt">
- <td><%= vbd.getKey() %></td>
+ <td><%= vd.getKey() %></td>
<td><%= vbd.getDomain() %></td>
- <td><%= vbd.getVBDNum() %></td>
+ <td><%= vbd.getVbdNum() %></td>
<td><%= vbd.getMode().toString() %></td>
</tr>
<%
diff --git a/tools/control/web/tmpl/vd-vbdfr.tmpl b/tools/control/web/tmpl/vd-vbdfr.tmpl
index 566f4cb038..0d172923bd 100644
--- a/tools/control/web/tmpl/vd-vbdfr.tmpl
+++ b/tools/control/web/tmpl/vd-vbdfr.tmpl
@@ -17,7 +17,7 @@ INCLUDE&vdmenu.tmpl
<%
HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
%>
-output = <%= root.doFlushVirtualBlockDevices() %>
+output = <%= new CommandVbdFlush().execute() %>
<%
root.doFlushState();
%>
diff --git a/tools/control/web/tmpl/vd-vbdv.tmpl b/tools/control/web/tmpl/vd-vbdv.tmpl
index 306372e2bb..6a0a03947c 100644
--- a/tools/control/web/tmpl/vd-vbdv.tmpl
+++ b/tools/control/web/tmpl/vd-vbdv.tmpl
@@ -16,16 +16,16 @@ INCLUDE&vdmenu.tmpl
<%
- for (Enumeration e = root.getVirtualBlockDevices(); e.hasMoreElements();)
+ for (Iterator i = root.vdm().getVirtualBlockDevices(); i.hasNext();)
{
- VirtualBlockDevice vbd = (VirtualBlockDevice) e.nextElement();
- VirtualDisk vd = root.getVirtualDiskKey(vbd.getKey());
+ VirtualBlockDevice vbd = (VirtualBlockDevice) i.next();
+ VirtualDisk vd = vbd.getVirtualDisk();
%>
<tr class="vdt">
<td><%= vbd.getDomain() %></td>
- <td><%= vbd.getVBDNum() %></td>
+ <td><%= vbd.getVbdNum() %></td>
<td><%= vbd.getMode().toString() %></td>
- <td><%= vbd.getKey() %></td>
+ <td><%= vd.getKey() %></td>
<td><%= vd.getName() %></td>
</tr>
<%
diff --git a/tools/control/web/tmpl/vd-vdcr.tmpl b/tools/control/web/tmpl/vd-vdcr.tmpl
index 08e63b2e90..9550407a1b 100644
--- a/tools/control/web/tmpl/vd-vdcr.tmpl
+++ b/tools/control/web/tmpl/vd-vdcr.tmpl
@@ -60,9 +60,11 @@ Error: expiry time not specified.<br>
{
expiry *= 24 * 60 * 60 * 1000 * 365;
}
+
+ expiry += System.currentTimeMillis();
%>
output =<br>
-<%= root.doCreateVirtualDisk( hsrw.getParameter("name"), size, expiry) %>
+<%= new CommandVdCreate( hsrw.getParameter("name"), Library.parseSize(size), new Date(expiry)).execute() %>
<br>
<%
}
diff --git a/tools/control/web/tmpl/vd-vdd.tmpl b/tools/control/web/tmpl/vd-vdd.tmpl
index 920899b1b2..3b50e1450c 100644
--- a/tools/control/web/tmpl/vd-vdd.tmpl
+++ b/tools/control/web/tmpl/vd-vdd.tmpl
@@ -16,13 +16,13 @@ INCLUDE&vdmenu.tmpl
<tr><td>
<table cellpadding="2" cellspacing="0" border="0">
<tbody>
- <tr class="vdh"><td></td><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
+ <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>
<%
- int count = root.getVirtualDiskCount();
- for (int loop = 0; loop < count; loop++)
+ Iterator i = root.vdm().getVirtualDisks();
+ while (i.hasNext())
{
- VirtualDisk vd = root.getVirtualDisk(loop);
+ VirtualDisk vd = (VirtualDisk) i.next();
%>
<tr class="vdt">
<td><input type="checkbox" name="vd" value="<%= vd.getKey() %>"></td>
@@ -31,6 +31,8 @@ INCLUDE&vdmenu.tmpl
<td><%= vd.getName() %></td>
<td></td>
<td><%= vd.getExpiry() %></td>
+ <td></td>
+ <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
</tr>
<%
}
diff --git a/tools/control/web/tmpl/vd-vddr.tmpl b/tools/control/web/tmpl/vd-vddr.tmpl
index 13925ebb8b..355c111e81 100644
--- a/tools/control/web/tmpl/vd-vddr.tmpl
+++ b/tools/control/web/tmpl/vd-vddr.tmpl
@@ -18,7 +18,7 @@ INCLUDE&vdmenu.tmpl
vd= <%= hsrw.getParameter("vd") %>
-vd= <%= root.doDeleteVirtualDisk(hsrw.getParameter("vd")) %>
+vd= <%= new CommandVdDelete(hsrw.getParameter("vd")).execute() %>
<%
root.doFlushState();
diff --git a/tools/control/web/tmpl/vd-vdr.tmpl b/tools/control/web/tmpl/vd-vdr.tmpl
index 551d230ceb..df9c20abf6 100644
--- a/tools/control/web/tmpl/vd-vdr.tmpl
+++ b/tools/control/web/tmpl/vd-vdr.tmpl
@@ -16,13 +16,13 @@ INCLUDE&vdmenu.tmpl
<tr><td>
<table cellpadding="2" cellspacing="0" border="0">
<tbody>
- <tr class="vdh"><td></td><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
+ <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>
<%
- int count = root.getVirtualDiskCount();
- for (int loop = 0; loop < count; loop++)
+ Iterator i = root.vdm().getVirtualDisks();
+ while (i.hasNext())
{
- VirtualDisk vd = root.getVirtualDisk(loop);
+ VirtualDisk vd = (VirtualDisk) i.next();
%>
<tr class="vdt">
<td><input type="checkbox" name="vd" value="<%= vd.getKey() %>"></td>
@@ -31,6 +31,8 @@ INCLUDE&vdmenu.tmpl
<td><%= vd.getName() %></td>
<td></td>
<td><%= vd.getExpiry() %></td>
+ <td></td>
+ <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
</tr>
<%
}
diff --git a/tools/control/web/tmpl/vd-vdrr.tmpl b/tools/control/web/tmpl/vd-vdrr.tmpl
index 068b283056..bca0dccf87 100644
--- a/tools/control/web/tmpl/vd-vdrr.tmpl
+++ b/tools/control/web/tmpl/vd-vdrr.tmpl
@@ -51,10 +51,12 @@ Error: expiry time not specified.<br>
expiry *= 24 * 60 * 60 * 1000 * 365;
}
+ expiry += System.currentTimeMillis();
+
for (int i = 0; i < vds.length; i++)
{
%>
-vd = <%= root.doRefreshVirtualDisk(vds[i], expiry) %> <br>
+vd = <%= new CommandVdRefresh(vds[i], new Date(expiry)).execute() %> <br>
<%
}
}
diff --git a/tools/control/web/tmpl/vd-vdv.tmpl b/tools/control/web/tmpl/vd-vdv.tmpl
index e03cd6959f..78a6f9b774 100644
--- a/tools/control/web/tmpl/vd-vdv.tmpl
+++ b/tools/control/web/tmpl/vd-vdv.tmpl
@@ -12,13 +12,13 @@ INCLUDE&vdmenu.tmpl
<table cellpadding="2" cellspacing="0" border="0">
<tbody>
- <tr class="vdh"><td>key</td><td width="5"></td><td>name</td><td width="5"></td><td>expiry</td></tr>
+ <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>
<%
- int count = root.getVirtualDiskCount();
- for (int loop = 0; loop < count; loop++)
+ Iterator i = root.vdm().getVirtualDisks();
+ while (i.hasNext())
{
- VirtualDisk vd = root.getVirtualDisk(loop);
+ VirtualDisk vd = (VirtualDisk) i.next();
%>
<tr class="vdt">
<td><%= vd.getKey() %></td>
@@ -26,6 +26,8 @@ INCLUDE&vdmenu.tmpl
<td><%= vd.getName() %></td>
<td></td>
<td><%= vd.getExpiry() %></td>
+ <td></td>
+ <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
</tr>
<%
}
diff --git a/tools/control/web/tmpl/xenohead.def b/tools/control/web/tmpl/xenohead.def
index 843244a0ae..12b957a1df 100644
--- a/tools/control/web/tmpl/xenohead.def
+++ b/tools/control/web/tmpl/xenohead.def
@@ -1,13 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<jsp:useBean id="root" scope="application"
- class="uk.ac.cam.cl.xeno.xenctl.RootBean" />
+ class="org.xenoserver.web.RootBean" />
<jsp:useBean id="sc" scope="application"
- class="uk.ac.cam.cl.xeno.xenctl.SystemConfigurationBean" />
+ class="org.xenoserver.web.SystemConfigurationBean" />
<%@ page session="false" %>
-<%@ page import="uk.ac.cam.cl.xeno.xenctl.*" %>
-<%@ page import="uk.ac.cam.cl.xeno.domctl.*" %>
-<%@ page import="java.util.Enumeration" %>
+<%@ page import="org.xenoserver.web.*" %>
+<%@ page import="org.xenoserver.control.*" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.Date" %>
<%@ page import="javax.servlet.http.HttpServletRequestWrapper" %>
<html lang="en">
@@ -20,7 +21,7 @@
<head>
-<title>##SECTION## ##SECTIONBREAK## ##TITLE## <%= root.getDebugCounter() %></title>
+<title>##SECTION## ##SECTIONBREAK## ##TITLE##</title>
<link rel="stylesheet" type="text/css" href="xenostyle.css">