diff options
-rw-r--r-- | .rootkeys | 9 | ||||
-rw-r--r-- | BitKeeper/etc/ignore | 6 | ||||
-rw-r--r-- | tools/control/README-web (renamed from tools/control/README-xenctl) | 2 | ||||
-rw-r--r-- | tools/control/web/tmpl/index.tmpl | 1 | ||||
-rw-r--r-- | tools/control/web/tmpl/makefile | 9 | ||||
-rw-r--r-- | tools/control/web/tmpl/pd-g.tmpl | 99 | ||||
-rw-r--r-- | tools/control/web/tmpl/pd-gr.tmpl | 77 | ||||
-rw-r--r-- | tools/control/web/tmpl/pd-l.tmpl | 90 | ||||
-rw-r--r-- | tools/control/web/tmpl/pd-r.tmpl | 104 | ||||
-rw-r--r-- | tools/control/web/tmpl/pd-rr.tmpl | 50 | ||||
-rw-r--r-- | tools/control/web/tmpl/pd.tmpl | 24 | ||||
-rw-r--r-- | tools/control/web/tmpl/pdmenu.tmpl | 26 | ||||
-rw-r--r-- | tools/control/web/tmpl/xenohead.def | 1 |
13 files changed, 493 insertions, 5 deletions
@@ -7,7 +7,7 @@ 3e6377d6eiFjF1hHIS6JEIOFk62xSA tools/balloon/README 3e6377dbGcgnisKw16DPCaND7oGO3Q tools/balloon/balloon.c 3eb781edFwm_pW9FwnQACIe68viLOw tools/control/Makefile -3eca6a96a31IwaKtkEa4jmzwTWlm8Q tools/control/README-xenctl +3eca6a96a31IwaKtkEa4jmzwTWlm8Q tools/control/README-web 3eb781fceEYkUi1XHKf2V0KX7si2JA tools/control/build-cmdline.xml 3ec41f7cWCxQ8pdH8ZWqhhv-38qQ1w tools/control/build-web.xml 3ec41f7ca6IBXDSe0HVcMPp3PPloOQ tools/control/build.properties @@ -95,6 +95,13 @@ 3ec41f7eTqbaFqMGU7lJG09vlEt0TQ tools/control/web/tmpl/index.tmpl 3ec41f7ed6_QZ1mg0vuA9Xu1wu1plw tools/control/web/tmpl/install.pl 3ec41f7emmAnjM4gsW6JWkqsjfi4Rg tools/control/web/tmpl/makefile +3f0d3c5bP8omJUhjEmXpsRvOZH3igw tools/control/web/tmpl/pd-g.tmpl +3f0d3c5bpmNu22iZ8mb-9hzOZUWEZw tools/control/web/tmpl/pd-gr.tmpl +3f0d3c5b1oQA8A-Y4AK0akN9k2T1KQ tools/control/web/tmpl/pd-l.tmpl +3f0d3c5bkJgUEumHh-qAL3ZB1xApSw tools/control/web/tmpl/pd-r.tmpl +3f0d3c5bOEOuHzB1HdWY9GvlYj7H-w tools/control/web/tmpl/pd-rr.tmpl +3f0d3c5cb9-AClRfExuRwJi45LcYuA tools/control/web/tmpl/pd.tmpl +3f0d3c5cQqQ23OpQJx-sNE0-EclRlA tools/control/web/tmpl/pdmenu.tmpl 3ec41f7eoDHD2raa4x6dBINr4QLO3A tools/control/web/tmpl/vd-fv.tmpl 3ec41f7eawycxV05Ow3LfZtOlHZJPA tools/control/web/tmpl/vd-pa.tmpl 3ec41f7ef4mVT4vwOEL40MKIzS4EeA tools/control/web/tmpl/vd-par.tmpl diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index 71eac81846..d37d791d56 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -457,3 +457,9 @@ xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_block.c~ xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c.bak xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c~ xenolinux-2.4.21-sparse/include/linux/blk.h~ +tools/control/web/pd-g.jsp +tools/control/web/pd-gr.jsp +tools/control/web/pd-l.jsp +tools/control/web/pd-r.jsp +tools/control/web/pd-rr.jsp +tools/control/web/pd.jsp diff --git a/tools/control/README-xenctl b/tools/control/README-web index 3ff9173ab2..f9cbe98bb9 100644 --- a/tools/control/README-xenctl +++ b/tools/control/README-web @@ -40,6 +40,6 @@ for development: ## edit xeno.bk/tools/control/build.properties # change manger.url to your xenoserver: mousetrap-0.xeno.cl.cam.ac.uk # change build.home to your xeno.bk full path - ## to "make install" in xeno.bk/tools/control instead of copying the war file + ## to "make install-web" in xeno.bk/tools/control instead of copying the war file cp $CATALINA_HOME/conf/tomcat-users.xml $CATALINA_HOME/conf/tomcat-users.orig sed -e 's/<tomcat-users>/<tomcat-users>\
<role rolename="standard"\/>\
<role rolename="manager"\/>\
<user username="hobbes" password="tiger" roles="standard,manager"\/>/' $CATALINA_HOME/conf/tomcat-users.orig > $CATALINA_HOME/conf/tomcat-users.xml diff --git a/tools/control/web/tmpl/index.tmpl b/tools/control/web/tmpl/index.tmpl index d1e158ff48..594d87cb96 100644 --- a/tools/control/web/tmpl/index.tmpl +++ b/tools/control/web/tmpl/index.tmpl @@ -45,6 +45,7 @@ COPYRIGHT&Computer Laboratory, University of Cambridge <td nowrap="nowrap"> <a href="dom.jsp" class="homemenu">Domain Manager</a><br> <a href="vd.jsp" class="homemenu">Virtual Disk Manager</a><br> + <a href="pd.jsp" class="homemenu">Physical Disk Manager</a><br> </td> </tr> diff --git a/tools/control/web/tmpl/makefile b/tools/control/web/tmpl/makefile index 9e8ee2eca0..8e5e019832 100644 --- a/tools/control/web/tmpl/makefile +++ b/tools/control/web/tmpl/makefile @@ -5,7 +5,8 @@ src1 = index.jsp about.jsp help.jsp vd.jsp \ vd-par.jsp vd-vdcr.jsp vd-vddr.jsp vd-vdrr.jsp \ vd-vbdcr.jsp vd-vbdfr.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 + dom-stp.jsp dom-stpr.jsp dom-del.jsp dom-delr.jsp \ + pd.jsp pd-g.jsp pd-gr.jsp pd-l.jsp pd-r.jsp pd-rr.jsp target = .. target0 = $(target)/xenostyle.css target1 = $(target)/index.jsp $(target)/vd.jsp \ @@ -19,7 +20,9 @@ target1 = $(target)/index.jsp $(target)/vd.jsp \ $(target)/dom.jsp $(target)/dom-lis.jsp $(target)/dom-new.jsp \ $(target)/dom-newr.jsp $(target)/dom-sta.jsp $(target)/dom-star.jsp \ $(target)/dom-stp.jsp $(target)/dom-stpr.jsp \ - $(target)/dom-del.jsp $(target)/dom-delr.jsp + $(target)/dom-del.jsp $(target)/dom-delr.jsp \ + $(target)/pd.jsp $(target)/pd-g.jsp $(target)/pd-gr.jsp \ + $(target)/pd-l.jsp $(target)/pd-r.jsp $(target)/pd-rr.jsp .SUFFIXES: .tmpl .jsp @@ -29,7 +32,7 @@ $(target)/index.jsp: index.tmpl ./install.pl -s -home index mv index.jsp $(target) -$(target)/%.jsp: %.tmpl +$(target)/%.jsp: %.tmpl xenofoot.def xenohead.def ./install.pl $* mv $*.jsp $(target) diff --git a/tools/control/web/tmpl/pd-g.tmpl b/tools/control/web/tmpl/pd-g.tmpl new file mode 100644 index 0000000000..824252a5c3 --- /dev/null +++ b/tools/control/web/tmpl/pd-g.tmpl @@ -0,0 +1,99 @@ +Grant Access +SECTION&XenoServers +BREADCRUMB&Physical Disk Manager&pd.jsp + +<!-- content --> +<img src="pixel.gif" class="block" width="1" height="12"> + +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +INCLUDE&pdmenu.tmpl +<td valign="top"> + +<form method="post" action="pd-gr.jsp"> +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> + +<tr><td> + +<table cellpadding="2" cellspacing="0" border="0"> +<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.pm().getPartitionCount(); + for (int loop = 0; loop < count; loop++) + { + Partition p = root.pm().getPartition(loop); + if (p.isXeno() == true) + { + %> + <tr class="vds"><td></td> + <% + } + else + { + %> + <tr class="vdt"> + <td><input type="checkbox" name="p" value="<%= p.getName() %>"></td> + <% + } + %> + <td><%= p.getMajor() %>:<%= p.getMinor() %></td> + <td align="right"><%= p.getBlocks() %></td> + <td align="right"><%= p.getStartSect() %> </td> + <td align="right"><%= p.getNumSects() %> </td> + <td><%= p.getName() %> </td> + </tr> + <% + } + %> +</tbody> +</table> + +</td></tr> + +##WHITESPACE## ##GREYLINE1## ##WHITESPACE## + +<tr><td> +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> + +<tr> + <td width="100"></td> + <td width="7"></td> + <td></td> +</tr> + +<tr> + <td align="right">domain</td> + <td></td> + <td> <input type="text" size="3" name="domain"> </td> +</tr> +<tr> + <td align="right"></td> + <td></td> + <td> <input type="radio" name="mode" value="ro" checked>RO + <input type="radio" name="mode" value="rw">RW</td> +</tr> +</tbody> +</table> +</td></tr> + +##WHITESPACE## ##GREYLINE1## ##WHITESPACE## + +<tr> + <td><input type="submit" name="action" value="grant access"></td> +</tr> + +</tbody> +</table> +</form> + +</td> +</tbody> +</table> + + + + +<!-- end content --> diff --git a/tools/control/web/tmpl/pd-gr.tmpl b/tools/control/web/tmpl/pd-gr.tmpl new file mode 100644 index 0000000000..800d9ebc4e --- /dev/null +++ b/tools/control/web/tmpl/pd-gr.tmpl @@ -0,0 +1,77 @@ +Grant Access Results +SECTION&XenoServers +BREADCRUMB&Physical Disk Manager&pd.jsp + +<!-- content --> +<img src="pixel.gif" class="block" width="1" height="12"> + +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +INCLUDE&pdmenu.tmpl +<td valign="top"> + +<b>Grant Access Results</b> +<br> + +<% + HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); + Defaults d = sc.getDefaults(); + + String partitions[] = hsrw.getParameterValues("p"); + String size = null; + + if (partitions == null || partitions.length == 0) + { +%> +Error: No partitions chosen.<br> +<% + } + else if (hsrw.getParameter("domain") == null || + hsrw.getParameter("domain").trim().equals("")) + { +%> +Error: No domain specified.<br> +<% + } + else + { + int domain = -1; + + try + { + domain = Integer.decode(hsrw.getParameter("domain")).intValue(); + Mode mode; + if (hsrw.getParameter("mode").equals("rw")) { + mode = Mode.READ_WRITE; + } else { + mode = Mode.READ_ONLY; + } + + for (int i = 0; i < partitions.length; i++) + { +%> +output[<%= i %>] =<br> +<%= new CommandPhysicalGrant(d, domain, partitions[i], mode, false).execute() %> <br> +<% + } + } catch (NumberFormatException e) { +%> +Error: invalid domain specification.<br> +<% + } + } +%> + + +<% + root.doFlushState(); +%> + + +</td> +</tbody> +</table> + + + +<!-- end content --> diff --git a/tools/control/web/tmpl/pd-l.tmpl b/tools/control/web/tmpl/pd-l.tmpl new file mode 100644 index 0000000000..795bdb011e --- /dev/null +++ b/tools/control/web/tmpl/pd-l.tmpl @@ -0,0 +1,90 @@ +Physical Access List +SECTION&XenoServers +BREADCRUMB&Physical Disk Manager&pd.jsp + +<!-- content --> +<img src="pixel.gif" class="block" width="1" height="12"> + +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +INCLUDE&pdmenu.tmpl +<td valign="top"> + +<% + CommandDomainList list = new CommandDomainList(sc.getDefaults()); + String output = list.executeWeb(); + if (output != null) + { +%> +<%= output %> +<% + } else { + Domain domains[] = list.domains(); +%> + +<table cellpadding="2" cellspacing="0" border="0"> +<tbody> + <tr class="vdh"><td>domain<br>id</td><td>mode</td><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr> + <% + /* assert: domains != null, otherwise, where is the servlet engine? */ + for (int loop = 0; loop < domains.length; loop++) + { + if ( domains[loop].id == 0 ) + continue; + CommandPhysicalList plist = new CommandPhysicalList(sc.getDefaults(),domains[loop].id); + output = plist.executeWeb(); + if (output != null) + { +%> +<%= output %> +<% + } else { + Iterator i = plist.extents().entrySet().iterator(); + while (i.hasNext()) { + Entry entry = (Entry) i.next(); + Extent e = (Extent) entry.getKey(); + String mode = entry.getValue().toString(); + Partition p = root.pm().getPartition(e); + if (p != null) { + %> + <tr> + <td><%= domains[loop].id %></td> + <td><%= mode %></td> + <td><%= p.getMajor() %>:<%= p.getMinor() %></td> + <td align="right"><%= p.getBlocks() %></td> + <td align="right"><%= p.getStartSect() %> </td> + <td align="right"><%= p.getNumSects() %> </td> + <td><%= p.getName() %> </td> + </tr> + <% + } else { + %> + <tr> + <td><%= domains[loop].id %></td> + <td><%= mode %></td> + <td><%= e.getMajor() %>:<%= e.getMinor()|e.getPartitionNo() %></td> + <td align="right"></td> + <td align="right"><%= e.getOffset() %> </td> + <td align="right"><%= e.getSize() %> </td> + <td></td> + </tr> + <% + } + } + } + } + %> +</tbody> +</table> +<% + } +%> + +</td> +</tbody> +</table> + + + + +<!-- end content --> diff --git a/tools/control/web/tmpl/pd-r.tmpl b/tools/control/web/tmpl/pd-r.tmpl new file mode 100644 index 0000000000..87f19e2ad4 --- /dev/null +++ b/tools/control/web/tmpl/pd-r.tmpl @@ -0,0 +1,104 @@ +Revoke Access +SECTION&XenoServers +BREADCRUMB&Physical Disk Manager&pd.jsp + +<!-- content --> +<img src="pixel.gif" class="block" width="1" height="12"> + +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +INCLUDE&pdmenu.tmpl +<td valign="top"> + +<% + CommandDomainList list = new CommandDomainList(sc.getDefaults()); + String output = list.executeWeb(); + if (output != null) + { +%> +<%= output %> +<% + } else { + Domain domains[] = list.domains(); +%> + +<form method="post" action="pd-rr.jsp"> +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +<tr><td> +<table cellpadding="2" cellspacing="0" border="0"> +<tbody> + <tr class="vdh"><td></td><td>domain<br>id</td><td>mode</td><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr> + <% + /* assert: domains != null, otherwise, where is the servlet engine? */ + for (int loop = 0; loop < domains.length; loop++) + { + if ( domains[loop].id == 0 ) + continue; + CommandPhysicalList plist = new CommandPhysicalList(sc.getDefaults(),domains[loop].id); + output = plist.executeWeb(); + if (output != null) + { +%> +<%= output %> +<% + } else { + Iterator i = plist.extents().entrySet().iterator(); + while (i.hasNext()) { + Entry entry = (Entry) i.next(); + Extent e = (Extent) entry.getKey(); + String mode = entry.getValue().toString(); + Partition p = root.pm().getPartition(e); + if (p != null) { + %> + <tr> + <td><input type="checkbox" name="dompart" value="<%= domains[loop].id + " " + p.getName() %>"></td> + <td><%= domains[loop].id %></td> + <td><%= mode %></td> + <td><%= p.getMajor() %>:<%= p.getMinor() %></td> + <td align="right"><%= p.getBlocks() %></td> + <td align="right"><%= p.getStartSect() %> </td> + <td align="right"><%= p.getNumSects() %> </td> + <td><%= p.getName() %> </td> + </tr> + <% + } else { + %> + <tr> + <td><%= domains[loop].id %></td> + <td><%= mode %></td> + <td><%= e.getMajor() %>:<%= e.getMinor()|e.getPartitionNo() %></td> + <td align="right"></td> + <td align="right"><%= e.getOffset() %> </td> + <td align="right"><%= e.getSize() %> </td> + <td></td> + </tr> + <% + } + } + } + } + %> +</tbody> +</table> +</td></tr> + +##WHITESPACE## ##GREYLINE1## ##WHITESPACE## + +<tr> + <td><input type="submit" name="action" value="revoke access"></td> +</tr> +</table> +</form> +<% + } +%> + +</td> +</tbody> +</table> + + + + +<!-- end content --> diff --git a/tools/control/web/tmpl/pd-rr.tmpl b/tools/control/web/tmpl/pd-rr.tmpl new file mode 100644 index 0000000000..51d184359a --- /dev/null +++ b/tools/control/web/tmpl/pd-rr.tmpl @@ -0,0 +1,50 @@ +Revoke Access +SECTION&XenoServers +BREADCRUMB&Physical Disk Manager&pd.jsp + +<!-- content --> +<img src="pixel.gif" class="block" width="1" height="12"> + +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +INCLUDE&pdmenu.tmpl +<td valign="top"> + +<b>Revoke Access Results</b> +<br> +<% + HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request); + + String partitions[] = hsrw.getParameterValues("dompart"); + if (partitions == null || partitions.length == 0) + { +%> +Error: No partitions chosen.<br> +<% + } + else + { + for (int i = 0; i < partitions.length; i++) + { + int domain = Integer.parseInt(partitions[i].substring(0,partitions[i].indexOf(" "))); + String partition = partitions[i].substring(partitions[i].indexOf(" ")+1); +%> +output[<%= i %>] =<br> +<%= new CommandPhysicalRevoke(sc.getDefaults(),domain,partition).execute() %> <br> +<% + } + } +%> + +<% + root.doFlushState(); +%> + +</td> +</tbody> +</table> + + + + +<!-- end content --> diff --git a/tools/control/web/tmpl/pd.tmpl b/tools/control/web/tmpl/pd.tmpl new file mode 100644 index 0000000000..60389228bc --- /dev/null +++ b/tools/control/web/tmpl/pd.tmpl @@ -0,0 +1,24 @@ +Physical Disk Manager +SECTION&XenoServers + +<!-- content --> +<img src="pixel.gif" class="block" width="1" height="12"> + +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +INCLUDE&pdmenu.tmpl +<td valign="top"> +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> + <tr><td nowrap="nowrap">Physical Disk Manager</td></tr> + +</tbody> +</table> +</td> +</tbody> +</table> + + + + +<!-- end content --> diff --git a/tools/control/web/tmpl/pdmenu.tmpl b/tools/control/web/tmpl/pdmenu.tmpl new file mode 100644 index 0000000000..9060a96114 --- /dev/null +++ b/tools/control/web/tmpl/pdmenu.tmpl @@ -0,0 +1,26 @@ +<td width="10" valign="top" align="right"></td> + +<td valign="top"> +<table cellpadding="0" cellspacing="0" border="0"> +<tbody> +<tr> + <td class="menuheader" width="100">Physical Disk Access</td> +</tr> +<tr> + <td class="sidemenu" width="100"><a href="pd-g.jsp">Grant</a></td> +</tr> +<tr> + <td class="sidemenu" width="100"><a href="pd-r.jsp">Revoke</a></td> +</tr> +<tr> + <td class="sidemenu" width="100"><a href="pd-l.jsp">List</a></td> +</tr> +</tbody> +</table> +</td> + +<td width="5" valign="top" align="right"></td> + +<td bgcolor="#666666" width="2"><img src="img/pixel.gif" class="block" width="2" height="50"></td> + +<td width="15" valign="top" align="right"></td> diff --git a/tools/control/web/tmpl/xenohead.def b/tools/control/web/tmpl/xenohead.def index 12b957a1df..adafeefca4 100644 --- a/tools/control/web/tmpl/xenohead.def +++ b/tools/control/web/tmpl/xenohead.def @@ -9,6 +9,7 @@ <%@ page import="org.xenoserver.control.*" %> <%@ page import="java.util.Iterator" %> <%@ page import="java.util.Date" %> +<%@ page import="java.util.Map.Entry" %> <%@ page import="javax.servlet.http.HttpServletRequestWrapper" %> <html lang="en"> |