ia64/xen-unstable

changeset 971:b5c1b4c684f2

bitkeeper revision 1.625 (3fbe2f19esMEVaXjNmogxfluk2JD7Q)

xi_stopdom.py, xi_listdoms.py, xi_destroydom.py, xi_createlinuxdom.py:
new file
Makefile, Xc.c, xen_cpuperf.c, Xeno-HOWTO:
Create example Python control scripts in tools/misc. Delete obsolete tools/control and tools/internal. Update docs.
.del-info.c~f4ad8e683fe1d35:
Delete: xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
.del-xi_vifinit~38149940dad8e67a:
Delete: tools/internal/xi_vifinit
.del-xi_vif_params.c~9151f057c314cf7a:
Delete: tools/internal/xi_vif_params.c
.del-xi_vbd_list.c~84922f92e6a6262e:
Delete: tools/internal/xi_vbd_list.c
.del-xi_vbd_info.c~981a992ecde72f50:
Delete: tools/internal/xi_vbd_info.c
.del-xi_vbd_create.c~f1118f53d74c555:
Delete: tools/internal/xi_vbd_create.c
.del-xi_vbd_add.c~a6d831ecbe015a9d:
Delete: tools/internal/xi_vbd_add.c
.del-xi_usage.c~68391a152ead20c:
Delete: tools/internal/xi_usage.c
.del-xi_stop.c~4ef370f18cb74cea:
Delete: tools/internal/xi_stop.c
.del-xi_start.c~b4656af7bfebd0eb:
Delete: tools/internal/xi_start.c
.del-xi_sched_global.c~bb19c1a0c457e08a:
Delete: tools/internal/xi_sched_global.c
.del-xi_sched_domain.c~7ed340cd41ae5b33:
Delete: tools/internal/xi_sched_domain.c
.del-xi_save_linux.c~15e91079dc6e1f52:
Delete: tools/internal/xi_save_linux.c
.del-xi_restore_linux.c~cd9f16a3dab69aee:
Delete: tools/internal/xi_restore_linux.c
.del-xi_read_console_ring.c~687b0bcae18cb1af:
Delete: tools/internal/xi_read_console_ring.c
.del-xi_phys_grant.c~422d8487936fa4c9:
Delete: tools/internal/xi_phys_grant.c
.del-xi_list.c~339a2f98db3a4b1f:
Delete: tools/internal/xi_list.c
.del-xi_helper~5d8f529425dd50f8:
Delete: tools/internal/xi_helper
.del-xi_destroy.c~44069345187b985d:
Delete: tools/internal/xi_destroy.c
.del-xi_create.c~9013eff27664db4b:
Delete: tools/internal/xi_create.c
.del-xi_build.c~55e0f7994dbfebdf:
Delete: tools/internal/xi_build.c
.del-rpm.spec~73ab630afebd3adc:
Delete: tools/internal/rpm.spec
.del-mem_defs.h~a42f0035e2bc6841:
Delete: tools/internal/mem_defs.h
.del-dom0_defs.h~8faf8b626237a755:
Delete: tools/internal/dom0_defs.h
.del-Makefile~f6522b0feb91f984:
Delete: tools/internal/Makefile
.del-xenostyle.css~6f6fdfdc625f6ba9:
Delete: tools/control/web/tmpl/xenostyle.css
.del-xenohead.def~75d33f086d74ed73:
Delete: tools/control/web/tmpl/xenohead.def
.del-xenofoot.def~7822ea1cb20d0bf:
Delete: tools/control/web/tmpl/xenofoot.def
.del-vdmenu.tmpl~a9affd2660773ba7:
Delete: tools/control/web/tmpl/vdmenu.tmpl
.del-vd.tmpl~8d64c39cb07c847c:
Delete: tools/control/web/tmpl/vd.tmpl
.del-vd-vdv.tmpl~6ce2247b5dd6fa71:
Delete: tools/control/web/tmpl/vd-vdv.tmpl
.del-xeno.gif~87337600f0e4b6cb:
Delete: tools/control/web/img/xeno.gif
.del-vd-vdrr.tmpl~f62e0e4cbbcaa21f:
Delete: tools/control/web/tmpl/vd-vdrr.tmpl
.del-vd-vdr.tmpl~bc166849e09d680a:
Delete: tools/control/web/tmpl/vd-vdr.tmpl
.del-vd-vddr.tmpl~a9305c17b49ed0a:
Delete: tools/control/web/tmpl/vd-vddr.tmpl
.del-vd-vdd.tmpl~a87ab77c787ebee2:
Delete: tools/control/web/tmpl/vd-vdd.tmpl
.del-vd-vdcr.tmpl~6cdd100a5a385284:
Delete: tools/control/web/tmpl/vd-vdcr.tmpl
.del-vd-vdc.tmpl~f564ab29c2ed6c51:
Delete: tools/control/web/tmpl/vd-vdc.tmpl
.del-vd-vbdv.tmpl~502df49e757bd832:
Delete: tools/control/web/tmpl/vd-vbdv.tmpl
.del-vd-vbdcr.tmpl~4011e8874a4d4580:
Delete: tools/control/web/tmpl/vd-vbdcr.tmpl
.del-vd-vbdc.tmpl~ea2620f4acddc499:
Delete: tools/control/web/tmpl/vd-vbdc.tmpl
.del-vd-pv.tmpl~7c15c3f2889c19:
Delete: tools/control/web/tmpl/vd-pv.tmpl
.del-vd-par.tmpl~6a9c1adf4255c1f4:
Delete: tools/control/web/tmpl/vd-par.tmpl
.del-vd-pa.tmpl~cfc3c39bbee289df:
Delete: tools/control/web/tmpl/vd-pa.tmpl
.del-vd-fv.tmpl~e7bf7c7f6b172cae:
Delete: tools/control/web/tmpl/vd-fv.tmpl
.del-search.gif~12f79a986fb9402c:
Delete: tools/control/web/img/search.gif
.del-pdmenu.tmpl~1e7bff9523b0bbaa:
Delete: tools/control/web/tmpl/pdmenu.tmpl
.del-pd.tmpl~8c5c232c132bcb13:
Delete: tools/control/web/tmpl/pd.tmpl
.del-pd-rr.tmpl~2f563e846bc965b5:
Delete: tools/control/web/tmpl/pd-rr.tmpl
.del-pd-r.tmpl~ee36df10225d67d9:
Delete: tools/control/web/tmpl/pd-r.tmpl
.del-pd-l.tmpl~acd063974b95504:
Delete: tools/control/web/tmpl/pd-l.tmpl
.del-pd-gr.tmpl~cca1c9a19939db70:
Delete: tools/control/web/tmpl/pd-gr.tmpl
.del-pd-g.tmpl~6983193813a3f098:
Delete: tools/control/web/tmpl/pd-g.tmpl
.del-makefile~32e72e0a58a71587:
Delete: tools/control/web/tmpl/makefile
.del-install.pl~bf0f10a96268eec:
Delete: tools/control/web/tmpl/install.pl
.del-index.tmpl~a9f5536b736b2bee:
Delete: tools/control/web/tmpl/index.tmpl
.del-help.tmpl~a8c78cf6aa63ca4d:
Delete: tools/control/web/tmpl/help.tmpl
.del-dommenu.tmpl~dcdecbc2f2bcf2df:
Delete: tools/control/web/tmpl/dommenu.tmpl
.del-dom.tmpl~4bb3289ae71d2f63:
Delete: tools/control/web/tmpl/dom.tmpl
.del-dom-stpr.tmpl~5469b499f28a24fe:
Delete: tools/control/web/tmpl/dom-stpr.tmpl
.del-dom-stp.tmpl~aa087fed3e776059:
Delete: tools/control/web/tmpl/dom-stp.tmpl
.del-dom-star.tmpl~c1e511d2e6e039bf:
Delete: tools/control/web/tmpl/dom-star.tmpl
.del-dom-sta.tmpl~eec4c966e27825ee:
Delete: tools/control/web/tmpl/dom-sta.tmpl
.del-dom-newr.tmpl~3f837ebfec8319a8:
Delete: tools/control/web/tmpl/dom-newr.tmpl
.del-dom-new.tmpl~6fe1462b95a26d5f:
Delete: tools/control/web/tmpl/dom-new.tmpl
.del-dom-lis.tmpl~85face7aa9811ee6:
Delete: tools/control/web/tmpl/dom-lis.tmpl
.del-dom-delr.tmpl~b0f4e92c66323471:
Delete: tools/control/web/tmpl/dom-delr.tmpl
.del-dom-del.tmpl~22452a94642dee59:
Delete: tools/control/web/tmpl/dom-del.tmpl
.del-about.tmpl~e55c75ae7d40f51d:
Delete: tools/control/web/tmpl/about.tmpl
.del-web.xml~d3569e2740475560:
Delete: tools/control/web/WEB-INF/web.xml
.del-pixel.gif~1c70dff3f6408bdd:
Delete: tools/control/web/img/pixel.gif
.del-home.gif~59d99d5348b498ac:
Delete: tools/control/web/img/home.gif
.del-help.gif~c2b5bbf58ecda4a5:
Delete: tools/control/web/img/help.gif
.del-cambridge.gif~31322a41ad46112:
Delete: tools/control/web/img/cambridge.gif
.del-XMLHelper.java~1ae486474964f9c3:
Delete: tools/control/src/org/xenoserver/control/XMLHelper.java
.del-XML.java~ede5498f3e107f1f:
Delete: tools/control/src/org/xenoserver/control/XML.java
.del-VirtualDiskManager.java~ab196de56ed40de1:
Delete: tools/control/src/org/xenoserver/control/VirtualDiskManager.java
.del-VirtualDisk.java~fafbe80750ab42e2:
Delete: tools/control/src/org/xenoserver/control/VirtualDisk.java
.del-VirtualBlockDevice.java~98092b4ad4e7bacd:
Delete: tools/control/src/org/xenoserver/control/VirtualBlockDevice.java
.del-SystemConfigurationBean.java~6fef72e1e39f275f:
Delete: tools/control/src/org/xenoserver/web/SystemConfigurationBean.java
.del-StringPattern.java~5315ee9851c204fe:
Delete: tools/control/src/org/xenoserver/control/StringPattern.java
.del-Settings.java~204154059ef7137a:
Delete: tools/control/src/org/xenoserver/control/Settings.java
.del-RootBean.java~51ad233a3a388d8a:
Delete: tools/control/src/org/xenoserver/web/RootBean.java
.del-PartitionManager.java~3de50829f63194f9:
Delete: tools/control/src/org/xenoserver/control/PartitionManager.java
.del-Partition.java~cf021656a42a020d:
Delete: tools/control/src/org/xenoserver/control/Partition.java
.del-ParseVdShow.java~9775d252c7b15110:
Delete: tools/control/src/org/xenoserver/cmdline/ParseVdShow.java
.del-Mode.java~25b8442d604135a2:
Delete: tools/control/src/org/xenoserver/control/Mode.java
.del-Library.java~1bdf383c73b9d30:
Delete: tools/control/src/org/xenoserver/control/Library.java
.del-InetAddressPattern.java~c8ab0e21763bb46:
Delete: tools/control/src/org/xenoserver/control/InetAddressPattern.java
.del-Extent.java~e2aacb058cf387dd:
Delete: tools/control/src/org/xenoserver/control/Extent.java
.del-Domain.java~2c9322038df8d5b0:
Delete: tools/control/src/org/xenoserver/control/Domain.java
.del-Defaults.java~a20e2ae2fdb4199:
Delete: tools/control/src/org/xenoserver/control/Defaults.java
.del-CommandVdRefresh.java~b561605ea2bb7663:
Delete: tools/control/src/org/xenoserver/control/CommandVdRefresh.java
.del-CommandVdDelete.java~1f1433ded35ec0e4:
Delete: tools/control/src/org/xenoserver/control/CommandVdDelete.java
.del-CommandVdCreate.java~eabf64408bfece75:
Delete: tools/control/src/org/xenoserver/control/CommandVdCreate.java
.del-CommandVbdList.java~c4b4a0a56d5c159b:
Delete: tools/control/src/org/xenoserver/control/CommandVbdList.java
.del-CommandVbdCreatePhysical.java~acddd9a8f3934603:
Delete: tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java
.del-CommandVbdCreate.java~cab25ef9c2f9efa0:
Delete: tools/control/src/org/xenoserver/control/CommandVbdCreate.java
.del-CommandPhysicalRevoke.java~19984f49205247ee:
Delete: tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java
.del-CommandPhysicalList.java~40e08514cd0288bd:
Delete: tools/control/src/org/xenoserver/control/CommandPhysicalList.java
.del-CommandPhysicalGrant.java~62fb80a3494e789a:
Delete: tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java
.del-CommandPartitionAdd.java~e7fcb3cea1f79648:
Delete: tools/control/src/org/xenoserver/control/CommandPartitionAdd.java
.del-CommandFailedException.java~cf05d4045a3ab73f:
Delete: tools/control/src/org/xenoserver/control/CommandFailedException.java
.del-CommandDomainStop.java~57fbc199fddf8b7d:
Delete: tools/control/src/org/xenoserver/control/CommandDomainStop.java
.del-CommandDomainStart.java~d24ceda9ec764887:
Delete: tools/control/src/org/xenoserver/control/CommandDomainStart.java
.del-CommandDomainNew.java~8a31b25dd21356d4:
Delete: tools/control/src/org/xenoserver/control/CommandDomainNew.java
.del-CommandDomainList.java~831c2cbb36df1829:
Delete: tools/control/src/org/xenoserver/control/CommandDomainList.java
.del-CommandDomainDestroy.java~858175208c48ee8d:
Delete: tools/control/src/org/xenoserver/control/CommandDomainDestroy.java
.del-Command.java~c45623cf89aa911f:
Delete: tools/control/src/org/xenoserver/control/Command.java
.del-xenctl~d6d1ced69a4edb06:
Delete: tools/control/xenctl
.del-xenctl.xml~dbcf47dd62a4c874:
Delete: tools/control/examples/xenctl.xml
.del-xenctl.xml-publicip~c1dc0c0c01bae47:
Delete: tools/control/examples/xenctl.xml-publicip
.del-xenctl.xml-linklocal~ac50b907d93dde62:
Delete: tools/control/examples/xenctl.xml-linklocal
.del-xenctl.xml-dom0nfs~2d4bfd30420f37c:
Delete: tools/control/examples/xenctl.xml-dom0nfs
.del-xen-mynewdom~eb9eb7ccaba10ea6:
Delete: tools/control/examples/xen-mynewdom
.del-grub.conf-example~ffdd191a69572347:
Delete: tools/control/examples/grub.conf-example
.del-etc.exports-example~e109d7d96ace82d5:
Delete: tools/control/examples/etc.exports-example
.del-build.properties~a26cad6e308b460d:
Delete: tools/control/build.properties
.del-build-web.xml~65af6961ad5a0006:
Delete: tools/control/build-web.xml
.del-build-cmdline.xml~90a4e63cd116d260:
Delete: tools/control/build-cmdline.xml
.del-USAGE-cmdline~a07f39f14fa71021:
Delete: tools/control/doc/USAGE-cmdline
.del-ParseVdRefresh.java~52d3c19fba954349:
Delete: tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java
.del-ParseVdFree.java~736eae32c0439aef:
Delete: tools/control/src/org/xenoserver/cmdline/ParseVdFree.java
.del-ParseVdDelete.java~1be4ea2ea5ce7030:
Delete: tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java
.del-ParseVdCreate.java~28ee263e4872c2a:
Delete: tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java
.del-ParseVbdShow.java~bd36e5a695e124de:
Delete: tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java
.del-ParseVbdCreate.java~7d6abfe7b735916f:
Delete: tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java
.del-ParseScript.java~5137d45494c175f4:
Delete: tools/control/src/org/xenoserver/cmdline/ParseScript.java
.del-ParsePhysicalRevoke.java~6b0265c5134872be:
Delete: tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java
.del-ParsePhysicalList.java~c42cd53f66a8cbfa:
Delete: tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java
.del-ParsePhysicalGrant.java~453f27fc4b20a519:
Delete: tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java
.del-ParsePartitionsList.java~2cfe6d2f93711838:
Delete: tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java
.del-ParsePartitionsAdd.java~2869522f1c6258b1:
Delete: tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java
.del-ParseHelp.java~d81805b2b35e7f8b:
Delete: tools/control/src/org/xenoserver/cmdline/ParseHelp.java
.del-ParseGroup.java~9dca3029634c4c7:
Delete: tools/control/src/org/xenoserver/cmdline/ParseGroup.java
.del-ParseFailedException.java~448f60dd7ec604b:
Delete: tools/control/src/org/xenoserver/cmdline/ParseFailedException.java
.del-ParseDomainStop.java~8a22aa198436278f:
Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java
.del-ParseDomainStart.java~eb406fd143d938f1:
Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java
.del-ParseDomainNew.java~1753e1f7b4942b:
Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java
.del-ParseDomainList.java~170d7622789247bb:
Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainList.java
.del-ParseDomainDestroy.java~3b2639c66f4c1fb:
Delete: tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java
.del-Makefile~8c5f335db8a47ad3:
Delete: tools/control/Makefile
.del-Main.java~72e3e9e28ef6446a:
Delete: tools/control/src/org/xenoserver/cmdline/Main.java
.del-INSTALL-web~96f8752b9fcd6dae:
Delete: tools/control/doc/INSTALL-web
.del-INSTALL-cmdline~73e6d06a3262dcea:
Delete: tools/control/doc/INSTALL-cmdline
.del-CommandParser.java~534cced2be48ac9d:
Delete: tools/control/src/org/xenoserver/cmdline/CommandParser.java
author kaf24@scramble.cl.cam.ac.uk
date Fri Nov 21 15:28:25 2003 +0000 (2003-11-21)
parents ea0572c4bc9f
children 895f1ca085a7
files .rootkeys docs/Xeno-HOWTO tools/Makefile tools/control/Makefile tools/control/build-cmdline.xml tools/control/build-web.xml tools/control/build.properties tools/control/doc/INSTALL-cmdline tools/control/doc/INSTALL-web tools/control/doc/USAGE-cmdline tools/control/examples/etc.exports-example tools/control/examples/grub.conf-example tools/control/examples/xen-mynewdom tools/control/examples/xenctl.xml tools/control/examples/xenctl.xml-dom0nfs tools/control/examples/xenctl.xml-linklocal tools/control/examples/xenctl.xml-publicip tools/control/src/org/xenoserver/cmdline/CommandParser.java tools/control/src/org/xenoserver/cmdline/Main.java tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java tools/control/src/org/xenoserver/cmdline/ParseDomainList.java tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java tools/control/src/org/xenoserver/cmdline/ParseFailedException.java tools/control/src/org/xenoserver/cmdline/ParseGroup.java tools/control/src/org/xenoserver/cmdline/ParseHelp.java tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java tools/control/src/org/xenoserver/cmdline/ParseScript.java tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java tools/control/src/org/xenoserver/cmdline/ParseVdFree.java tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java tools/control/src/org/xenoserver/cmdline/ParseVdShow.java tools/control/src/org/xenoserver/control/Command.java tools/control/src/org/xenoserver/control/CommandDomainDestroy.java tools/control/src/org/xenoserver/control/CommandDomainList.java tools/control/src/org/xenoserver/control/CommandDomainNew.java tools/control/src/org/xenoserver/control/CommandDomainStart.java tools/control/src/org/xenoserver/control/CommandDomainStop.java tools/control/src/org/xenoserver/control/CommandFailedException.java tools/control/src/org/xenoserver/control/CommandPartitionAdd.java tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java tools/control/src/org/xenoserver/control/CommandPhysicalList.java tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java tools/control/src/org/xenoserver/control/CommandVbdCreate.java tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java tools/control/src/org/xenoserver/control/CommandVbdList.java tools/control/src/org/xenoserver/control/CommandVdCreate.java tools/control/src/org/xenoserver/control/CommandVdDelete.java tools/control/src/org/xenoserver/control/CommandVdRefresh.java tools/control/src/org/xenoserver/control/Defaults.java tools/control/src/org/xenoserver/control/Domain.java tools/control/src/org/xenoserver/control/Extent.java tools/control/src/org/xenoserver/control/InetAddressPattern.java tools/control/src/org/xenoserver/control/Library.java tools/control/src/org/xenoserver/control/Mode.java tools/control/src/org/xenoserver/control/Partition.java tools/control/src/org/xenoserver/control/PartitionManager.java tools/control/src/org/xenoserver/control/Settings.java tools/control/src/org/xenoserver/control/StringPattern.java tools/control/src/org/xenoserver/control/VirtualBlockDevice.java tools/control/src/org/xenoserver/control/VirtualDisk.java tools/control/src/org/xenoserver/control/VirtualDiskManager.java tools/control/src/org/xenoserver/control/XML.java tools/control/src/org/xenoserver/control/XMLHelper.java tools/control/src/org/xenoserver/web/RootBean.java tools/control/src/org/xenoserver/web/SystemConfigurationBean.java tools/control/web/WEB-INF/web.xml tools/control/web/img/cambridge.gif tools/control/web/img/help.gif tools/control/web/img/home.gif tools/control/web/img/pixel.gif tools/control/web/img/search.gif tools/control/web/img/xeno.gif tools/control/web/tmpl/about.tmpl tools/control/web/tmpl/dom-del.tmpl tools/control/web/tmpl/dom-delr.tmpl tools/control/web/tmpl/dom-lis.tmpl tools/control/web/tmpl/dom-new.tmpl tools/control/web/tmpl/dom-newr.tmpl tools/control/web/tmpl/dom-sta.tmpl tools/control/web/tmpl/dom-star.tmpl tools/control/web/tmpl/dom-stp.tmpl tools/control/web/tmpl/dom-stpr.tmpl tools/control/web/tmpl/dom.tmpl tools/control/web/tmpl/dommenu.tmpl tools/control/web/tmpl/help.tmpl tools/control/web/tmpl/index.tmpl tools/control/web/tmpl/install.pl tools/control/web/tmpl/makefile tools/control/web/tmpl/pd-g.tmpl tools/control/web/tmpl/pd-gr.tmpl tools/control/web/tmpl/pd-l.tmpl tools/control/web/tmpl/pd-r.tmpl tools/control/web/tmpl/pd-rr.tmpl tools/control/web/tmpl/pd.tmpl tools/control/web/tmpl/pdmenu.tmpl 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-vbdv.tmpl tools/control/web/tmpl/vd-vdc.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/vd.tmpl tools/control/web/tmpl/vdmenu.tmpl tools/control/web/tmpl/xenofoot.def tools/control/web/tmpl/xenohead.def tools/control/web/tmpl/xenostyle.css tools/control/xenctl tools/internal/Makefile tools/internal/dom0_defs.h tools/internal/mem_defs.h tools/internal/rpm.spec tools/internal/xi_build.c tools/internal/xi_create.c tools/internal/xi_destroy.c tools/internal/xi_helper tools/internal/xi_list.c tools/internal/xi_phys_grant.c tools/internal/xi_read_console_ring.c tools/internal/xi_restore_linux.c tools/internal/xi_save_linux.c tools/internal/xi_sched_domain.c tools/internal/xi_sched_global.c tools/internal/xi_start.c tools/internal/xi_stop.c tools/internal/xi_usage.c tools/internal/xi_vbd_add.c tools/internal/xi_vbd_create.c tools/internal/xi_vbd_info.c tools/internal/xi_vbd_list.c tools/internal/xi_vif_params.c tools/internal/xi_vifinit tools/misc/Makefile tools/misc/xen_cpuperf.c tools/misc/xi_createlinuxdom.py tools/misc/xi_destroydom.py tools/misc/xi_listdoms.py tools/misc/xi_stopdom.py tools/xc/py/Xc.c xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
line diff
     1.1 --- a/.rootkeys	Fri Nov 21 12:05:32 2003 +0000
     1.2 +++ b/.rootkeys	Fri Nov 21 15:28:25 2003 +0000
     1.3 @@ -39,151 +39,6 @@ 3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Mak
     1.4  3e6377b24eQqYMsDi9XrFkIgTzZ47A tools/balloon/Makefile
     1.5  3e6377d6eiFjF1hHIS6JEIOFk62xSA tools/balloon/README
     1.6  3e6377dbGcgnisKw16DPCaND7oGO3Q tools/balloon/balloon.c
     1.7 -3eb781edFwm_pW9FwnQACIe68viLOw tools/control/Makefile
     1.8 -3eb781fceEYkUi1XHKf2V0KX7si2JA tools/control/build-cmdline.xml
     1.9 -3ec41f7cWCxQ8pdH8ZWqhhv-38qQ1w tools/control/build-web.xml
    1.10 -3ec41f7ca6IBXDSe0HVcMPp3PPloOQ tools/control/build.properties
    1.11 -3f0d61da3O5gkcntbIOdUmN2-RcZbQ tools/control/doc/INSTALL-cmdline
    1.12 -3eca6a96a31IwaKtkEa4jmzwTWlm8Q tools/control/doc/INSTALL-web
    1.13 -3f0d61daCTHGCpQK0Brz3PAp80d_2Q tools/control/doc/USAGE-cmdline
    1.14 -3f77f25c4zdCalc5d0YnMGEnc9By-Q tools/control/examples/etc.exports-example
    1.15 -3f776bd12y6bW-wtcs6rD2qhdpT_Rw tools/control/examples/grub.conf-example
    1.16 -3f776bd1RBu7Gnce6Bq9328QFUZBsw tools/control/examples/xen-mynewdom
    1.17 -3eb781fcabCKRogwxJA3-jJKstw9Vg tools/control/examples/xenctl.xml
    1.18 -3f776bd1bfwM-pP6b2qd0vih1KeV8w tools/control/examples/xenctl.xml-dom0nfs
    1.19 -3f776bd1-A4vvCCsz-KOgZyAj4ux2g tools/control/examples/xenctl.xml-linklocal
    1.20 -3f776bd2y1sfPGpfiaj4A-sRdUON7A tools/control/examples/xenctl.xml-publicip
    1.21 -3f042c35FzVap5QW0UBPnZ2ZM0l3QA tools/control/src/org/xenoserver/cmdline/CommandParser.java
    1.22 -3eb781fdNQvEJW3tNvovjqoN7GlePA tools/control/src/org/xenoserver/cmdline/Main.java
    1.23 -3f042c35-TPgpCQViIaJzLts2-CnBw tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java
    1.24 -3f042c35h9GAWRu7wimPjBpCi09nUA tools/control/src/org/xenoserver/cmdline/ParseDomainList.java
    1.25 -3f042c359mRNaxBYXFwVsmv5-J_DJA tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java
    1.26 -3f042c35bMvqLB4Yc-0Dxs4WlYHHpw tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java
    1.27 -3f042c35Lc-JegNavF6Bj6coM486Ig tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java
    1.28 -3f042c35UhRkvblwKSx0KW2QHUn3Fw tools/control/src/org/xenoserver/cmdline/ParseFailedException.java
    1.29 -3f0445524oTSyogDGmCAyKMM665Rxg tools/control/src/org/xenoserver/cmdline/ParseGroup.java
    1.30 -3f042c35Inw0LzkOzXo9ncbEHZzUHA tools/control/src/org/xenoserver/cmdline/ParseHelp.java
    1.31 -3f098761jTSCT4f7lCWFePC3TJN_nw tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java
    1.32 -3f05631djnPcaqmzMFSa8RLmGCZ-0Q tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java
    1.33 -3f05631dswxJX_TpcuG6tBstyHSetg tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java
    1.34 -3f05631dMY7PMkwSY7zBFelGJ8goVg tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java
    1.35 -3f05631dYDFXv6mwNFAgz3ta9kShJA tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java
    1.36 -3f5f3d95BlaPZ2JHfpjHuHscx2SJow tools/control/src/org/xenoserver/cmdline/ParseScript.java
    1.37 -3f0bdfabfXM4tMbvmV06di5U-5FfqA tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java
    1.38 -3f0bec93F_VDIcn9oeXwJYwydX20kg tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java
    1.39 -3f098761TRsbDk9woUM846Q6_F7EmA tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java
    1.40 -3f099009pmH9MFkRYwP2V1DfsqEwdg tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java
    1.41 -3f098761zh9WTV6LpRqcet3gqlXdtg tools/control/src/org/xenoserver/cmdline/ParseVdFree.java
    1.42 -3f099009lDK_5xXO4gPyPpCTUhgnCA tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java
    1.43 -3f098761vY4hzt_QKskmvMcibN0zYQ tools/control/src/org/xenoserver/cmdline/ParseVdShow.java
    1.44 -3f042c35V-Bf3dlIe1r5mZs8ZTPSvA tools/control/src/org/xenoserver/control/Command.java
    1.45 -3f042c35U_4O2eovLKUgo2avPPHKUw tools/control/src/org/xenoserver/control/CommandDomainDestroy.java
    1.46 -3f042c3570VRwuzl94tEozOIVBycNg tools/control/src/org/xenoserver/control/CommandDomainList.java
    1.47 -3f042c35xVm-ucJAVdvC3acD6ZEe2Q tools/control/src/org/xenoserver/control/CommandDomainNew.java
    1.48 -3f042c36GqoXJJj_BvWGwBeKwEzgvg tools/control/src/org/xenoserver/control/CommandDomainStart.java
    1.49 -3f042c36bmZJD0xrxURD075avUlIUg tools/control/src/org/xenoserver/control/CommandDomainStop.java
    1.50 -3f042c35hdwL__Airzyz4HutOgGRqQ tools/control/src/org/xenoserver/control/CommandFailedException.java
    1.51 -3f0987611uZwg-o64yi0p_2aXCYEug tools/control/src/org/xenoserver/control/CommandPartitionAdd.java
    1.52 -3f05631ev3UK5FRi5vgR08zDp3OZYw tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java
    1.53 -3f05631e_G6wzHhEnpihX0pIkEsbMw tools/control/src/org/xenoserver/control/CommandPhysicalList.java
    1.54 -3f05631eGWxq7bojQbMa-tGxsENIhw tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java
    1.55 -3f0bdfab88VYiD26FXCDmmAAGJ8zWA tools/control/src/org/xenoserver/control/CommandVbdCreate.java
    1.56 -3f0bdfabI14M5_odjCIwQbXCdauReA tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java
    1.57 -3f0d4a70B132OMLyoUBFJAfNCATCww tools/control/src/org/xenoserver/control/CommandVbdList.java
    1.58 -3f098761c5-idlmf9vWEMOlDw0VCHg tools/control/src/org/xenoserver/control/CommandVdCreate.java
    1.59 -3f0990096KcyQw77qJmjTu941smS8A tools/control/src/org/xenoserver/control/CommandVdDelete.java
    1.60 -3f0990093VJUL7QjxGigR5GPXf_Fkw tools/control/src/org/xenoserver/control/CommandVdRefresh.java
    1.61 -3eb781fdBRXfSlWzK6GXlIQIlHFoaQ tools/control/src/org/xenoserver/control/Defaults.java
    1.62 -3ec41f7cQ7Ug739JBDrsVH-7KJ5MvQ tools/control/src/org/xenoserver/control/Domain.java
    1.63 -3ec41f7cAzdBu0lkuTTQx92rqSM9Qw tools/control/src/org/xenoserver/control/Extent.java
    1.64 -3eb781fdDeZEopemXIVg_ARCGKSmBw tools/control/src/org/xenoserver/control/InetAddressPattern.java
    1.65 -3ec41f7cqN_uVR_7TqjgypDfFdGyrg tools/control/src/org/xenoserver/control/Library.java
    1.66 -3ec41f7dsb1R8BvBNzjYufMrx6ONdA tools/control/src/org/xenoserver/control/Mode.java
    1.67 -3ec41f7dbqJLTy1msByMzQhy3jHHyQ tools/control/src/org/xenoserver/control/Partition.java
    1.68 -3ec41f7djIGkw6M9meq8-YZ1WDATcw tools/control/src/org/xenoserver/control/PartitionManager.java
    1.69 -3eb781fdmMkFbyb2SAGR0vsuFtl9Lw tools/control/src/org/xenoserver/control/Settings.java
    1.70 -3eb781fdpgi83RpUvQWVccWjsDJK7w tools/control/src/org/xenoserver/control/StringPattern.java
    1.71 -3ec41f7dNJZ1YkLD8X5CsqqYmP601g tools/control/src/org/xenoserver/control/VirtualBlockDevice.java
    1.72 -3ec41f7dVFBlviwXPQ06BlU3UybziA tools/control/src/org/xenoserver/control/VirtualDisk.java
    1.73 -3ec41f7dKX9YpwrfH7BZ7BogyWqqLA tools/control/src/org/xenoserver/control/VirtualDiskManager.java
    1.74 -3ec41f7dUPpYTwYL5QVpRBv6PLKPrg tools/control/src/org/xenoserver/control/XML.java
    1.75 -3ec41f7d7Try-2zmfnpaALwJjY0GCA tools/control/src/org/xenoserver/control/XMLHelper.java
    1.76 -3ec41f7dOVZgjP4sQS6vjuBnExdlMQ tools/control/src/org/xenoserver/web/RootBean.java
    1.77 -3ec41f7dvPdszb0frNEkMnEdJUBVjA tools/control/src/org/xenoserver/web/SystemConfigurationBean.java
    1.78 -3ec41f7dO6IuKGGLG4VRUhMDmkTn5g tools/control/web/WEB-INF/web.xml
    1.79 -3ec41f7dRAPXBA0jQUd1k6MB3xVidg tools/control/web/img/cambridge.gif
    1.80 -3ec41f7dvxVe1Vb3kVOLZcN5Jra2tQ tools/control/web/img/help.gif
    1.81 -3ec41f7dJYExm-ityN2SgVVaeR_BYA tools/control/web/img/home.gif
    1.82 -3ec41f7d4IYjCuVYWjgq-OCue4O0Vw tools/control/web/img/pixel.gif
    1.83 -3ec41f7dW6Rxbc2h5vulWqEkj0rMzA tools/control/web/img/search.gif
    1.84 -3ec41f7d-WawzXt-iMiQON6VVF0d6Q tools/control/web/img/xeno.gif
    1.85 -3ec41f7d6gAIVIeI6d36osnxPNIbEw tools/control/web/tmpl/about.tmpl
    1.86 -3ec41f7dU7BdfMqTjNuI2yFIE9YTxQ tools/control/web/tmpl/dom-del.tmpl
    1.87 -3ec41f7dnAVr1lPsPDV0cwNe-cDiSw tools/control/web/tmpl/dom-delr.tmpl
    1.88 -3ec41f7dKNiNO7usbqUVaXvZafVzSg tools/control/web/tmpl/dom-lis.tmpl
    1.89 -3ec41f7dJ4oF7TdF8c858DgzXAPJUA tools/control/web/tmpl/dom-new.tmpl
    1.90 -3ec41f7dPelejfeiuXzFeETZXtYY3g tools/control/web/tmpl/dom-newr.tmpl
    1.91 -3ec41f7deN7cXpkmKhmp9nGMWtQ9Yw tools/control/web/tmpl/dom-sta.tmpl
    1.92 -3ec41f7dFl7cFsLVTEu06abaLjrh7A tools/control/web/tmpl/dom-star.tmpl
    1.93 -3ec41f7dOyejg7nsGjHhwS9dRwuwJQ tools/control/web/tmpl/dom-stp.tmpl
    1.94 -3ec41f7d-jdCAs49yO8mmvGdbVnFcQ tools/control/web/tmpl/dom-stpr.tmpl
    1.95 -3ec41f7d2S1JM6utrcajiWWmPi85TA tools/control/web/tmpl/dom.tmpl
    1.96 -3ec41f7dPyCkHbXAufQ0Nxnvhq7XpQ tools/control/web/tmpl/dommenu.tmpl
    1.97 -3ec41f7dZRDqKe8wk__95ztDQmaAOA tools/control/web/tmpl/help.tmpl
    1.98 -3ec41f7eTqbaFqMGU7lJG09vlEt0TQ tools/control/web/tmpl/index.tmpl
    1.99 -3ec41f7ed6_QZ1mg0vuA9Xu1wu1plw tools/control/web/tmpl/install.pl
   1.100 -3ec41f7emmAnjM4gsW6JWkqsjfi4Rg tools/control/web/tmpl/makefile
   1.101 -3f0d3c5bP8omJUhjEmXpsRvOZH3igw tools/control/web/tmpl/pd-g.tmpl
   1.102 -3f0d3c5bpmNu22iZ8mb-9hzOZUWEZw tools/control/web/tmpl/pd-gr.tmpl
   1.103 -3f0d3c5b1oQA8A-Y4AK0akN9k2T1KQ tools/control/web/tmpl/pd-l.tmpl
   1.104 -3f0d3c5bkJgUEumHh-qAL3ZB1xApSw tools/control/web/tmpl/pd-r.tmpl
   1.105 -3f0d3c5bOEOuHzB1HdWY9GvlYj7H-w tools/control/web/tmpl/pd-rr.tmpl
   1.106 -3f0d3c5cb9-AClRfExuRwJi45LcYuA tools/control/web/tmpl/pd.tmpl
   1.107 -3f0d3c5cQqQ23OpQJx-sNE0-EclRlA tools/control/web/tmpl/pdmenu.tmpl
   1.108 -3ec41f7eoDHD2raa4x6dBINr4QLO3A tools/control/web/tmpl/vd-fv.tmpl
   1.109 -3ec41f7eawycxV05Ow3LfZtOlHZJPA tools/control/web/tmpl/vd-pa.tmpl
   1.110 -3ec41f7ef4mVT4vwOEL40MKIzS4EeA tools/control/web/tmpl/vd-par.tmpl
   1.111 -3ec41f7e1-bFRAfSveBhJNc-yQguXQ tools/control/web/tmpl/vd-pv.tmpl
   1.112 -3ec41f7e6v7MAKuV03qkOLX94vCGQg tools/control/web/tmpl/vd-vbdc.tmpl
   1.113 -3ec41f7eInaxQyoN0zPtGH6O1l0qaA tools/control/web/tmpl/vd-vbdcr.tmpl
   1.114 -3ec41f7eSe6rb0p4IxLU16czqIaTCA tools/control/web/tmpl/vd-vbdv.tmpl
   1.115 -3ec41f7eAYtNdK1Yy-RdGMCcSDNfBA tools/control/web/tmpl/vd-vdc.tmpl
   1.116 -3ec41f7eFxwTmuQ8wWMdvVQ5jtiKKA tools/control/web/tmpl/vd-vdcr.tmpl
   1.117 -3ec41f7e2osvqR4HUXCd9zUIIvUjaA tools/control/web/tmpl/vd-vdd.tmpl
   1.118 -3ec41f7e_TlFUNtMUUk1vivYx-4M2w tools/control/web/tmpl/vd-vddr.tmpl
   1.119 -3ec41f7eqey0GnU2CvlvO0OvX0Pmgg tools/control/web/tmpl/vd-vdr.tmpl
   1.120 -3ec41f7elad0gJQYmWPOikqUUKkMtA tools/control/web/tmpl/vd-vdrr.tmpl
   1.121 -3ec41f7eQ2vdTzXZAbxIWCosxZHJkg tools/control/web/tmpl/vd-vdv.tmpl
   1.122 -3ec41f7estxrL28BGG8obBnzt-SiAA tools/control/web/tmpl/vd.tmpl
   1.123 -3ec41f7e6SAwV8ebs9Be7zV2LV92oQ tools/control/web/tmpl/vdmenu.tmpl
   1.124 -3ec41f7ecn3uvsSrOVxKC8G8ACuulg tools/control/web/tmpl/xenofoot.def
   1.125 -3ec41f7ek1RffqN2yRUzSTkD5m1J6w tools/control/web/tmpl/xenohead.def
   1.126 -3ec41f7e1ZpfCsgQ2qRJBooBn_iRtA tools/control/web/tmpl/xenostyle.css
   1.127 -3eb781fc6vgq5yhkJRGDLY9gWWRY2A tools/control/xenctl
   1.128 -3eb781fdl4lXWYZzmqDDUAYhAThRqQ tools/internal/Makefile
   1.129 -3eb781fdc539MQQm47rYRCCR3N5i-Q tools/internal/dom0_defs.h
   1.130 -3eb781fdKiQbgozBsgs_zzJQ9ubehw tools/internal/mem_defs.h
   1.131 -3ec61e1bJCeJJu0SsptmDpA1xKvwvw tools/internal/rpm.spec
   1.132 -3eb781fdgbSkh2O6JQS-65Dz4n0ItQ tools/internal/xi_build.c
   1.133 -3eb781fdW1SAyiaC4mTsXq_9fRHh-A tools/internal/xi_create.c
   1.134 -3eb781fdcJ0fF7rWfzAOArW-x4-gwA tools/internal/xi_destroy.c
   1.135 -3ec43c5dmQxGDvgJJXbV1yLxT30Y1A tools/internal/xi_helper
   1.136 -3f108ad5wQm0ZaQ4GXFoUhH1W1aW9w tools/internal/xi_list.c
   1.137 -3f0458aaXhD8BQAggO81gv30RQ-ifA tools/internal/xi_phys_grant.c
   1.138 -3fb14ab76b0aJu66S18CVjlemLwk4Q tools/internal/xi_read_console_ring.c
   1.139 -3fa9861aBdNV1yCjfY4cLPr4Mtrpuw tools/internal/xi_restore_linux.c
   1.140 -3fa98615LWZfagwDBp7XfuC-u9wi3w tools/internal/xi_save_linux.c
   1.141 -3f108adb2b5OkKL6-faG3lMiOYDf_w tools/internal/xi_sched_domain.c
   1.142 -3f108ade1v8weyh1sKx890VTd240Hw tools/internal/xi_sched_global.c
   1.143 -3eb781fd8oRfPgH7qTh7xvgmwD6NgA tools/internal/xi_start.c
   1.144 -3eb781fd0Eo9K1jEFCSAVzO51i_ngg tools/internal/xi_stop.c
   1.145 -3f108ae2to5nHRRXfvUK7oxgjcW_yA tools/internal/xi_usage.c
   1.146 -3fb01fd5CGkDlZddcIlPxLwrquLqKA tools/internal/xi_vbd_add.c
   1.147 -3fb01fd5MoGCWdylPicf4UinUjYfDg tools/internal/xi_vbd_create.c
   1.148 -3fb01fd54I4P44vZDb1CtDt1BytDtA tools/internal/xi_vbd_info.c
   1.149 -3fb01fd5B-UeibZkmSCOUZckNyNFYA tools/internal/xi_vbd_list.c
   1.150 -3f86be322bd0h9jG3krZFOUgCDoxZg tools/internal/xi_vif_params.c
   1.151 -3eb781fd7211MZsLxJSiuy7W4KnJXg tools/internal/xi_vifinit
   1.152  3f776bd2Xd-dUcPKlPN2vG89VGtfvQ tools/misc/Makefile
   1.153  3f6dc136ZKOjd8PIqLbFBl_v-rnkGg tools/misc/miniterm/Makefile
   1.154  3f6dc140C8tAeBfroAF24VrmCS4v_w tools/misc/miniterm/README
   1.155 @@ -198,6 +53,10 @@ 3f13d81eQ9Vz-h-6RDGFkNR9CRP95g tools/mis
   1.156  3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README
   1.157  3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c
   1.158  3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c
   1.159 +3fbe2f12OPAkzIUtumU3wRAihnhocQ tools/misc/xi_createlinuxdom.py
   1.160 +3fbe2f12dZbmXLlgQdMgkmnSUj23AQ tools/misc/xi_destroydom.py
   1.161 +3fbe2f12ltvweb13kBSsxqzZDAq4sg tools/misc/xi_listdoms.py
   1.162 +3fbe2f12Bnt8mwmr1ZCP6HWGS6yvYw tools/misc/xi_stopdom.py
   1.163  3fbca441SjQr8vJwTQIgH1laysaWog tools/xc/Makefile
   1.164  3fbba6dbDfYvJSsw9500b4SZyUhxjQ tools/xc/lib/Makefile
   1.165  3fbba6dbEVkVMX0JuDFzap9jeaucGA tools/xc/lib/libxc_bvtsched.c
   1.166 @@ -598,7 +457,6 @@ 3e5a4e65TNEycLeXqPSXQJQm_xGecA xenolinux
   1.167  3e6377f5xwPfYZkPHPrDbEq1PRN7uQ xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/Makefile
   1.168  3e6377f8Me8IqtvEhb70XFgOvqQH7A xenolinux-2.4.22-sparse/arch/xeno/drivers/balloon/balloon.c
   1.169  3e5a4e65iHEuC5sjFhj42XALYbLVRw xenolinux-2.4.22-sparse/arch/xeno/drivers/block/Makefile
   1.170 -3f689056Vxx_8K8DQTRysOxx_ikmLg xenolinux-2.4.22-sparse/arch/xeno/drivers/block/info.c
   1.171  3e5a4e65pP5spJErBW69pJxSSdK9RA xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.c
   1.172  3e67f822FOPwqHiaRKbrskgWgoNL5g xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_block.h
   1.173  3e676eb5RXnHzSHgA1BvM0B1aIm4qg xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_vbd.c
     2.1 --- a/docs/Xeno-HOWTO	Fri Nov 21 12:05:32 2003 +0000
     2.2 +++ b/docs/Xeno-HOWTO	Fri Nov 21 15:28:25 2003 +0000
     2.3 @@ -99,27 +99,21 @@ This is the gzip version of XenoLinux ke
     2.4  Build the Domain Control Tools
     2.5  ==============================
     2.6  
     2.7 -Under '/xeno-1.1.bk/tools', there are four sub-directories:
     2.8 -'balloon', 'control', 'internal' and 'misc', each containing
     2.9 +Under '/xeno-1.1.bk/tools', there are three sub-directories:
    2.10 +'balloon', 'xc' and 'misc', each containing
    2.11  a group of tools. You can enter any of the four sub-directories
    2.12  and type 'make' to compile the corresponding group of tools.
    2.13  Or you can type 'make' under '/xeno-1.1.bk/tools' to compile
    2.14  all the tools.
    2.15  
    2.16 -Particularly, in order to compile tools under 'control', you
    2.17 -must have Apache Ant installed. Latest binary can be found at
    2.18 -'http://ant.apache.org/bindownload.cgi'.
    2.19 -
    2.20 -Besides, you must have Java J2SDK 1.4 installed. There seemed
    2.21 -to be compilation errors with J2SDK 1.3, but fine with J2SDK 1.4
    2.22 +In order to compile the control-interface library in 'xc' you must
    2.23 +have zlib and devlopment headers installed. Also you will need at
    2.24 +least Python v2.2. 
    2.25  
    2.26 -To summarize:
    2.27 -
    2.28 -# cd /xeno-1.1.bk/tools
    2.29 -# make
    2.30 -# make install
    2.31 -# cd /install/bin
    2.32 -# cp * /usr/local/bin
    2.33 +'make install' in the tools directory will place executables and
    2.34 +libraries in an install directory immediately outside you local
    2.35 +repository. NOTE: the installation of the Python modules may need root
    2.36 +privileges if you are not using a personal installation of Python.
    2.37  
    2.38  
    2.39  Installation
    2.40 @@ -181,55 +175,6 @@ The following is a list of command line 
    2.41   dom0_mem=xxx     Set the maximum amount of memory for domain0.
    2.42  
    2.43  
    2.44 -Xenctl Configuration
    2.45 -==============================
    2.46 -
    2.47 -# cd /xeno-1.1.bk/tools/control/examples
    2.48 -# cp xenctl.xml xen-mynewdom /etc
    2.49 -
    2.50 -Then, you need to modify /etc/xen-mynewdom:
    2.51 -
    2.52 -# cat /etc/xen-mynewdom
    2.53 -domain new
    2.54 -physical grant -pcdrom_link
    2.55 -domain start
    2.56 -
    2.57 -You should substitue 'cdrom_link' with the
    2.58 -root partition, e.g. '/dev/hda3', '/dev/sda1'.
    2.59 -Therefore, the second looks like:
    2.60 -'physical grant -p/dev/hda3'
    2.61 -
    2.62 -Then, you need to modify /etc/xenctl.xml:
    2.63 -
    2.64 -# cat /etc/xenctl.xml
    2.65 -<?xml version="1.0"?>
    2.66 -<domctl_defaults>
    2.67 -<domain_name>XenoLinux</domain_name>
    2.68 -<domain_size_kb>98304</domain_size_kb>
    2.69 -<domain_image>/boot/xenolinux.gz</domain_image>
    2.70 -<domain_vifs>1</domain_vifs>
    2.71 -<domain_init_rd>/boot/initrd.gz</domain_init_rd>
    2.72 -<root_device>/dev/ram0</root_device>
    2.73 -<root_args>rw</root_args>
    2.74 -<args>init=/linuxrc 4 DOMID=+</args>
    2.75 -<nw_ip>169.254.1.0+</nw_ip>
    2.76 -<nw_gw>169.254.1.0</nw_gw>
    2.77 -<nw_mask>255.255.0.0</nw_mask>
    2.78 -<nw_nfs_server>169.254.1.0</nw_nfs_server>
    2.79 -<max_domain_number>1000</max_domain_number>
    2.80 -<xi_tools_dir>/usr/local/bin/</xi_tools_dir>
    2.81 -</domctl_defaults>
    2.82 -
    2.83 -The meaning of every line is very straightforward
    2.84 -and should be modified according to your configuration.
    2.85 -
    2.86 -Normally you don't need <domain_init_rd>. And you probably want
    2.87 -root_args set to "ro", otherwise fsck will complain. Assuming you've
    2.88 -installed a standard linux installation, you probably don't want to
    2.89 -explicit set the init program, or the run level,
    2.90 -e.g. <args>DOMID=+</args>
    2.91 -
    2.92 -
    2.93  Boot into Domain 0
    2.94  ==============================
    2.95  
    2.96 @@ -259,31 +204,43 @@ UDP packets to  the local virtual networ
    2.97  by xen_read_console running in Domain  0 and output are printed out to
    2.98  the standard output.
    2.99  
   2.100 -# xenctl script -f/etc/xen-mynewdom
   2.101 -
   2.102 -This will create and start a new domain based on /etc/xen-mynewdom and
   2.103 -/etc/xenctl.xml
   2.104 +Now edit the installed xi_createlinuxdom.py script to your taste. This
   2.105 +should then be executed as root to create a new domain.
   2.106  
   2.107  You should be able to see XenoLinux boot message on standard output
   2.108 -with each line prepended [domain_id].
   2.109 +with each line prepended with [domain_id].
   2.110  
   2.111  
   2.112  List and Stop Domains
   2.113  ==============================
   2.114  
   2.115  You can see a list of existing domains with:
   2.116 -
   2.117 -# xi_list
   2.118 -or
   2.119 -# xenctl domain list
   2.120 +# xi_listdoms.py
   2.121  
   2.122  In order to stop a domain, you use:
   2.123 +# xi_stopdom.py <domain_id>
   2.124  
   2.125 -# xi_stop domain_id
   2.126 -or
   2.127 -# xenctl domain stop -ndomain_id
   2.128 +To destroy a domain use ('force' causes an immediate destruction
   2.129 +without waiting for the guest OS to shut down cleanly):
   2.130 +# xi_destroydom.py <domain_id> [force]
   2.131 +
   2.132 +
   2.133 +Other Control Tasks using Python
   2.134 +================================
   2.135  
   2.136 -followed by
   2.137 -# xi_destroy domain_id
   2.138 -or
   2.139 -# xenctl domain destroy -ndomain_id
   2.140 \ No newline at end of file
   2.141 +A Python module 'Xc' is installed as part of the tools-install
   2.142 +process. This can be imported, and an 'xc object' instantiated, to
   2.143 +provide access to privileged command operations:
   2.144 +
   2.145 +# import Xc
   2.146 +# xc = Xc.new()
   2.147 +# dir(xc)
   2.148 +# help(xc.domain_create)
   2.149 +
   2.150 +In this way you can see that the class 'xc' contains useful
   2.151 +documentation for you to consult.
   2.152 +
   2.153 +A further module of useful routines (XenoUtil) is also installed:
   2.154 +
   2.155 +# import XenoUtil
   2.156 +# help(XenoUtil)
   2.157 \ No newline at end of file
     3.1 --- a/tools/Makefile	Fri Nov 21 12:05:32 2003 +0000
     3.2 +++ b/tools/Makefile	Fri Nov 21 15:28:25 2003 +0000
     3.3 @@ -19,22 +19,16 @@
     3.4  
     3.5  all:	
     3.6  	$(MAKE) -C balloon
     3.7 -	$(MAKE) -C control
     3.8 -	$(MAKE) -C internal
     3.9  	$(MAKE) -C xc
    3.10  	$(MAKE) -C misc
    3.11  
    3.12  install: all
    3.13  	$(MAKE) -C balloon install
    3.14 -	$(MAKE) -C control install
    3.15 -	$(MAKE) -C internal install
    3.16  	$(MAKE) -C xc install
    3.17  	$(MAKE) -C misc install
    3.18  
    3.19  clean:
    3.20  	$(MAKE) -C balloon clean
    3.21 -	$(MAKE) -C control clean
    3.22 -	$(MAKE) -C internal clean
    3.23  	$(MAKE) -C xc clean
    3.24  	$(MAKE) -C misc clean
    3.25  
     4.1 --- a/tools/control/Makefile	Fri Nov 21 12:05:32 2003 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,39 +0,0 @@
     4.4 -#default: cmdline web
     4.5 -default: cmdline
     4.6 -
     4.7 -#install: install-cmdline install-web
     4.8 -install: install-cmdline examples
     4.9 -
    4.10 -clean: clean-cmdline clean-web
    4.11 -
    4.12 -examples: FORCE
    4.13 -	mkdir -p ../../../install/etc
    4.14 -	chmod +w ../../../install/etc/* || true
    4.15 -	cp examples/xen* examples/*example ../../../install/etc/
    4.16 -
    4.17 -cmdline: FORCE
    4.18 -	ant -buildfile build-cmdline.xml dist
    4.19 -
    4.20 -install-cmdline: cmdline
    4.21 -	mkdir -p ../../../install/bin
    4.22 -	cp -a xenctl-cmdline.jar xenctl ../../../install/bin
    4.23 -	chmod 755 ../../../install/bin/xenctl
    4.24 -
    4.25 -clean-cmdline:
    4.26 -	ant -buildfile build-cmdline.xml clean
    4.27 -	rm -f xenctl-cmdline.jar
    4.28 -
    4.29 -
    4.30 -
    4.31 -web: FORCE
    4.32 -	ant -buildfile build-web.xml dist
    4.33 -
    4.34 -install-web: xenctl
    4.35 -	ant -buildfile build-web.xml remove || true
    4.36 -	ant -buildfile build-web.xml install
    4.37 -
    4.38 -clean-web:
    4.39 -	ant -buildfile build-web.xml clean
    4.40 -	rm -f xenctl-web.jar
    4.41 -
    4.42 -FORCE:
     5.1 --- a/tools/control/build-cmdline.xml	Fri Nov 21 12:05:32 2003 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,50 +0,0 @@
     5.4 -<project name="xenctl cmdline project" default="compile">
     5.5 -  <property name="src" location="src"/>
     5.6 -  <property name="build" location="build-cmdline"/>
     5.7 -
     5.8 -  <target name="init">
     5.9 -    <tstamp/>
    5.10 -    <mkdir dir="${build}"/>     
    5.11 -  </target>
    5.12 -
    5.13 -  <target name="compile" depends="init">
    5.14 -    <javac srcdir="${src}" destdir="${build}" debug="on">
    5.15 -      <include name="org/xenoserver/cmdline/**"/>
    5.16 -      <include name="org/xenoserver/control/**"/>
    5.17 -    </javac>
    5.18 -  </target>
    5.19 -
    5.20 -  <target name="dist" depends="compile">
    5.21 -    <jar jarfile="xenctl-cmdline.jar"
    5.22 -         excludes="*~"
    5.23 -	 basedir="${build}">
    5.24 -      <fileset dir="${src}">
    5.25 -        <include name="org/xenoserver/cmdline/**"/>
    5.26 -        <include name="org/xenoserver/control/**"/>
    5.27 -      </fileset>
    5.28 -      <fileset dir=".">
    5.29 -        <include name="build-cmdline.xml"/>
    5.30 -        <include name="xenctl"/>
    5.31 -	<include name="xenctl.xml"/>
    5.32 -        <include name="Makefile"/>
    5.33 -      </fileset>
    5.34 -      <manifest>
    5.35 -        <attribute name="Built-By" value="${user.name}"/>
    5.36 -	<attribute name="Main-Class" value="org.xenoserver.cmdline.Main"/>
    5.37 -	<attribute name="Sealed" value="true"/>
    5.38 -      </manifest>
    5.39 -    </jar>
    5.40 -  </target>
    5.41 -
    5.42 -  <target name="test" depends="compile">
    5.43 -    <java fork="true" classname="org.xenoserver.cmdline.Main">
    5.44 -      <classpath>
    5.45 -        <pathelement path="${build}"/>
    5.46 -      </classpath>
    5.47 -    </java>
    5.48 -  </target>
    5.49 -
    5.50 -  <target name="clean">
    5.51 -    <delete dir="${build}"/>
    5.52 -  </target>
    5.53 -</project>
     6.1 --- a/tools/control/build-web.xml	Fri Nov 21 12:05:32 2003 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,477 +0,0 @@
     6.4 -<!--
     6.5 -     General purpose build script for web applications and web services,
     6.6 -     including enhanced support for deploying directly to a Tomcat 4
     6.7 -     based server.
     6.8 -
     6.9 -     This build script assumes that the source code of your web application
    6.10 -     is organized into the following subdirectories underneath the source
    6.11 -     code directory from which you execute the build script:
    6.12 -
    6.13 -        docs                 Static documentation files to be copied to
    6.14 -                             the "docs" subdirectory of your distribution.
    6.15 -
    6.16 -        src                  Java source code (and associated resource files)
    6.17 -                             to be compiled to the "WEB-INF/classes"
    6.18 -                             subdirectory of your web applicaiton.
    6.19 -
    6.20 -        web                  Static HTML, JSP, and other content (such as
    6.21 -                             image files), including the WEB-INF subdirectory
    6.22 -                             and its configuration file contents.
    6.23 -
    6.24 -     $Id: build.xml.txt,v 1.7 2002/12/28 09:08:58 jfclere Exp $
    6.25 --->
    6.26 -
    6.27 -
    6.28 -<!-- A "project" describes a set of targets that may be requested
    6.29 -     when Ant is executed.  The "default" attribute defines the
    6.30 -     target which is executed if no specific target is requested,
    6.31 -     and the "basedir" attribute defines the current working directory
    6.32 -     from which Ant executes the requested task.  This is normally
    6.33 -     set to the current working directory.
    6.34 --->
    6.35 -
    6.36 -<project name="xenctl web interface" default="compile" basedir=".">
    6.37 -
    6.38 -
    6.39 -
    6.40 -<!-- ===================== Property Definitions =========================== -->
    6.41 -
    6.42 -
    6.43 -<!--
    6.44 -
    6.45 -  Each of the following properties are used in the build script.
    6.46 -  Values for these properties are set by the first place they are
    6.47 -  defined, from the following list:
    6.48 -
    6.49 -  * Definitions on the "ant" command line (ant -Dfoo=bar compile).
    6.50 -
    6.51 -  * Definitions from a "build.properties" file in the top level
    6.52 -    source directory of this application.
    6.53 -
    6.54 -  * Definitions from a "build.properties" file in the developer's
    6.55 -    home directory.
    6.56 -
    6.57 -  * Default definitions in this build.xml file.
    6.58 -
    6.59 -  You will note below that property values can be composed based on the
    6.60 -  contents of previously defined properties.  This is a powerful technique
    6.61 -  that helps you minimize the number of changes required when your development
    6.62 -  environment is modified.  Note that property composition is allowed within
    6.63 -  "build.properties" files as well as in the "build.xml" script.
    6.64 -
    6.65 --->
    6.66 -
    6.67 -  <property file="build.properties"/>
    6.68 -  <property file="${user.home}/build.properties"/>
    6.69 -
    6.70 -
    6.71 -<!-- ==================== File and Directory Names ======================== -->
    6.72 -
    6.73 -
    6.74 -<!--
    6.75 -
    6.76 -  These properties generally define file and directory names (or paths) that
    6.77 -  affect where the build process stores its outputs.
    6.78 -
    6.79 -  app.name             Base name of this application, used to
    6.80 -                       construct filenames and directories.
    6.81 -                       Defaults to "myapp".
    6.82 -
    6.83 -  app.path             Context path to which this application should be
    6.84 -                       deployed (defaults to "/" plus the value of the
    6.85 -                       "app.name" property).
    6.86 -
    6.87 -  app.version          Version number of this iteration of the application.
    6.88 -
    6.89 -  build.home           The directory into which the "prepare" and
    6.90 -                       "compile" targets will generate their output.
    6.91 -                       Defaults to "build".
    6.92 -
    6.93 -  catalina.home        The directory in which you have installed
    6.94 -                       a binary distribution of Tomcat 4.  This will
    6.95 -                       be used by the "deploy" target.
    6.96 -
    6.97 -  dist.home            The name of the base directory in which
    6.98 -                       distribution files are created.
    6.99 -                       Defaults to "dist".
   6.100 -
   6.101 -  manager.password     The login password of a user that is assigned the
   6.102 -                       "manager" role (so that he or she can execute
   6.103 -                       commands via the "/manager" web application)
   6.104 -
   6.105 -  manager.url          The URL of the "/manager" web application on the
   6.106 -                       Tomcat installation to which we will deploy web
   6.107 -                       applications and web services.
   6.108 -
   6.109 -  manager.username     The login username of a user that is assigned the
   6.110 -                       "manager" role (so that he or she can execute
   6.111 -                       commands via the "/manager" web application)
   6.112 -
   6.113 --->
   6.114 -
   6.115 -  <property name="app.name"      value="xenctl"/>
   6.116 -  <property name="app.path"      value="/${app.name}"/>
   6.117 -  <property name="app.version"   value="0.1-dev"/>
   6.118 -  <property name="build.home"    value="${basedir}/build-web"/>
   6.119 -  <property name="catalina.home" value="../../../.."/> <!-- UPDATE THIS! -->
   6.120 -  <property name="dist.home"     value="${basedir}/dist-web"/>
   6.121 -  <property name="src.home"      value="${basedir}/src"/>
   6.122 -  <property name="web.home"      value="${basedir}/web"/>
   6.123 -
   6.124 -
   6.125 -<!-- ================== Custom Ant Task Definitions ======================= -->
   6.126 -
   6.127 -
   6.128 -<!--
   6.129 -
   6.130 -  These properties define custom tasks for the Ant build tool that interact
   6.131 -  with the "/manager" web application installed with Tomcat 4.  Before they
   6.132 -  can be successfully utilized, you must perform the following steps:
   6.133 -
   6.134 -  - Copy the file "server/lib/catalina-ant.jar" from your Tomcat 4
   6.135 -    installation into the "lib" directory of your Ant installation.
   6.136 -
   6.137 -  - Create a "build.properties" file in your application's top-level
   6.138 -    source directory (or your user login home directory) that defines
   6.139 -    appropriate values for the "manager.password", "manager.url", and
   6.140 -    "manager.username" properties described above.
   6.141 -
   6.142 -  For more information about the Manager web application, and the functionality
   6.143 -  of these tasks, see <http://localhost:8080/tomcat-docs/manager-howto.html>.
   6.144 -
   6.145 --->
   6.146 -
   6.147 -  <taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/>
   6.148 -  <taskdef name="list"    classname="org.apache.catalina.ant.ListTask"/>
   6.149 -  <taskdef name="reload"  classname="org.apache.catalina.ant.ReloadTask"/>
   6.150 -  <taskdef name="remove"  classname="org.apache.catalina.ant.RemoveTask"/>
   6.151 -
   6.152 -
   6.153 -<!--  ==================== Compilation Control Options ==================== -->
   6.154 -
   6.155 -<!--
   6.156 -
   6.157 -  These properties control option settings on the Javac compiler when it
   6.158 -  is invoked using the <javac> task.
   6.159 -
   6.160 -  compile.debug        Should compilation include the debug option?
   6.161 -
   6.162 -  compile.deprecation  Should compilation include the deprecation option?
   6.163 -
   6.164 -  compile.optimize     Should compilation include the optimize option?
   6.165 -
   6.166 --->
   6.167 -
   6.168 -  <property name="compile.debug"       value="true"/>
   6.169 -  <property name="compile.deprecation" value="false"/>
   6.170 -  <property name="compile.optimize"    value="true"/>
   6.171 -
   6.172 -
   6.173 -
   6.174 -<!-- ==================== External Dependencies =========================== -->
   6.175 -
   6.176 -
   6.177 -<!--
   6.178 -
   6.179 -  Use property values to define the locations of external JAR files on which
   6.180 -  your application will depend.  In general, these values will be used for
   6.181 -  two purposes:
   6.182 -  * Inclusion on the classpath that is passed to the Javac compiler
   6.183 -  * Being copied into the "/WEB-INF/lib" directory during execution
   6.184 -    of the "deploy" target.
   6.185 -
   6.186 -  Because we will automatically include all of the Java classes that Tomcat 4
   6.187 -  exposes to web applications, we will not need to explicitly list any of those
   6.188 -  dependencies.  You only need to worry about external dependencies for JAR
   6.189 -  files that you are going to include inside your "/WEB-INF/lib" directory.
   6.190 -
   6.191 --->
   6.192 -
   6.193 -<!-- Dummy external dependency -->
   6.194 -<!--
   6.195 -  <property name="foo.jar"
   6.196 -           value="/path/to/foo.jar"/>
   6.197 --->
   6.198 -
   6.199 -
   6.200 -<!-- ==================== Compilation Classpath =========================== -->
   6.201 -
   6.202 -<!--
   6.203 -
   6.204 -  Rather than relying on the CLASSPATH environment variable, Ant includes
   6.205 -  features that makes it easy to dynamically construct the classpath you
   6.206 -  need for each compilation.  The example below constructs the compile
   6.207 -  classpath to include the servlet.jar file, as well as the other components
   6.208 -  that Tomcat makes available to web applications automatically, plus anything
   6.209 -  that you explicitly added.
   6.210 -
   6.211 --->
   6.212 -
   6.213 -  <path id="compile.classpath">
   6.214 -
   6.215 -    <!-- Include all JAR files that will be included in /WEB-INF/lib -->
   6.216 -    <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
   6.217 -<!--
   6.218 -    <pathelement location="${foo.jar}"/>
   6.219 --->
   6.220 -
   6.221 -    <!-- Include all elements that Tomcat exposes to applications -->
   6.222 -    <pathelement location="${catalina.home}/common/classes"/>
   6.223 -    <fileset dir="${catalina.home}/common/endorsed">
   6.224 -      <include name="*.jar"/>
   6.225 -    </fileset>
   6.226 -    <fileset dir="${catalina.home}/common/lib">
   6.227 -      <include name="*.jar"/>
   6.228 -    </fileset>
   6.229 -    <pathelement location="${catalina.home}/shared/classes"/>
   6.230 -    <fileset dir="${catalina.home}/shared/lib">
   6.231 -      <include name="*.jar"/>
   6.232 -    </fileset>
   6.233 -
   6.234 -  </path>
   6.235 -
   6.236 -
   6.237 -
   6.238 -<!-- ==================== All Target ====================================== -->
   6.239 -
   6.240 -<!--
   6.241 -
   6.242 -  The "all" target is a shortcut for running the "clean" target followed
   6.243 -  by the "compile" target, to force a complete recompile.
   6.244 -
   6.245 --->
   6.246 -
   6.247 -  <target name="all" depends="clean,compile"
   6.248 -   description="Clean build and dist directories, then compile"/>
   6.249 -
   6.250 -
   6.251 -
   6.252 -<!-- ==================== Clean Target ==================================== -->
   6.253 -
   6.254 -<!--
   6.255 -
   6.256 -  The "clean" target deletes any previous "build" and "dist" directory,
   6.257 -  so that you can be ensured the application can be built from scratch.
   6.258 -
   6.259 --->
   6.260 -
   6.261 -  <target name="clean"
   6.262 -   description="Delete old build and dist directories">
   6.263 -    <delete dir="${build.home}"/>
   6.264 -    <delete dir="${dist.home}"/>
   6.265 -    <exec executable="make" dir="${web.home}/tmpl"><arg value="clean"/></exec>
   6.266 -  </target>
   6.267 -
   6.268 -
   6.269 -
   6.270 -<!-- ==================== Compile Target ================================== -->
   6.271 -
   6.272 -<!--
   6.273 -
   6.274 -  The "compile" target transforms source files (from your "src" directory)
   6.275 -  into object files in the appropriate location in the build directory.
   6.276 -  This example assumes that you will be including your classes in an
   6.277 -  unpacked directory hierarchy under "/WEB-INF/classes".
   6.278 -
   6.279 --->
   6.280 -
   6.281 -  <target name="compile" depends="prepare"
   6.282 -   description="Compile Java sources">
   6.283 -
   6.284 -    <!-- Compile Java classes as necessary -->
   6.285 -    <mkdir    dir="${build.home}/WEB-INF/classes"/>
   6.286 -    <javac srcdir="${src.home}"
   6.287 -          destdir="${build.home}/WEB-INF/classes"
   6.288 -            debug="${compile.debug}"
   6.289 -      deprecation="${compile.deprecation}"
   6.290 -         optimize="${compile.optimize}">
   6.291 -        <classpath refid="compile.classpath"/>
   6.292 -        <include name="org/xenoserver/control/**"/>
   6.293 -        <include name="org/xenoserver/web/**"/>
   6.294 -    </javac>
   6.295 -
   6.296 -    <!-- Copy application resources -->
   6.297 -    <copy  todir="${build.home}/WEB-INF/classes">
   6.298 -      <fileset dir="${src.home}" excludes="**/*.java"/>
   6.299 -    </copy>
   6.300 -
   6.301 -  </target>
   6.302 -
   6.303 -
   6.304 -
   6.305 -<!-- ==================== Dist Target ===================================== -->
   6.306 -
   6.307 -
   6.308 -<!--
   6.309 -
   6.310 -  The "dist" target creates a binary distribution of your application
   6.311 -  in a directory structure ready to be archived in a tar.gz or zip file.
   6.312 -  Note that this target depends on:
   6.313 -
   6.314 -  * "compile" so that the entire web application (including external
   6.315 -    dependencies) will have been assembled
   6.316 -
   6.317 --->
   6.318 -
   6.319 -  <target name="dist" depends="compile"
   6.320 -   description="Create binary distribution">
   6.321 -
   6.322 -    <!-- Create application JAR file -->
   6.323 -    <jar jarfile="${dist.home}/${app.name}-${app.version}.war"
   6.324 -         basedir="${build.home}"/>
   6.325 -
   6.326 -    <!-- Copy additional files to ${dist.home} as necessary -->
   6.327 -
   6.328 -  </target>
   6.329 -
   6.330 -
   6.331 -
   6.332 -<!-- ==================== Install Target ================================== -->
   6.333 -
   6.334 -<!--
   6.335 -
   6.336 -  The "install" target tells the specified Tomcat 4 installation to dynamically
   6.337 -  install this web application and make it available for execution.  It does
   6.338 -  *not* cause the existence of this web application to be remembered across
   6.339 -  Tomcat restarts; if you restart the server, you will need to re-install all
   6.340 -  this web application.
   6.341 -
   6.342 -  If you have already installed this application, and simply want Tomcat to
   6.343 -  recognize that you have updated Java classes (or the web.xml file), use the
   6.344 -  "reload" target instead.
   6.345 -
   6.346 -  NOTE:  This target will only succeed if it is run from the same server that
   6.347 -  Tomcat is running on.
   6.348 -
   6.349 -  NOTE:  This is the logical opposite of the "remove" target.
   6.350 -
   6.351 --->
   6.352 -
   6.353 -  <target name="install" depends="compile"
   6.354 -   description="Install application to servlet container">
   6.355 -
   6.356 -    <install url="${manager.url}"
   6.357 -        username="${manager.username}"
   6.358 -        password="${manager.password}"
   6.359 -            path="${app.path}"
   6.360 -             war="file://${build.home}"/>
   6.361 -
   6.362 -  </target>
   6.363 -
   6.364 -
   6.365 -<!-- ====================== List Target =================================== -->
   6.366 -
   6.367 -<!--
   6.368 -
   6.369 -  The "list" target asks the specified Tomcat 4 installation to list the
   6.370 -  currently running web applications, either loaded at startup time or
   6.371 -  installed dynamically.  It is useful to determine whether or not the
   6.372 -  application you are currently developing has been installed.
   6.373 -
   6.374 --->
   6.375 -
   6.376 -  <target name="list"
   6.377 -   description="List installed applications on servlet container">
   6.378 -
   6.379 -    <list    url="${manager.url}"
   6.380 -        username="${manager.username}"
   6.381 -        password="${manager.password}"/>
   6.382 -
   6.383 -  </target>
   6.384 -
   6.385 -
   6.386 -<!-- ==================== Prepare Target ================================== -->
   6.387 -
   6.388 -<!--
   6.389 -
   6.390 -  The "prepare" target is used to create the "build" destination directory,
   6.391 -  and copy the static contents of your web application to it.  If you need
   6.392 -  to copy static files from external dependencies, you can customize the
   6.393 -  contents of this task.
   6.394 -
   6.395 -  Normally, this task is executed indirectly when needed.
   6.396 -
   6.397 --->
   6.398 -
   6.399 -  <target name="prepare">
   6.400 -
   6.401 -    <!-- Create build directories as needed -->
   6.402 -    <mkdir  dir="${build.home}"/>
   6.403 -    <mkdir  dir="${build.home}/WEB-INF"/>
   6.404 -    <mkdir  dir="${build.home}/WEB-INF/classes"/>
   6.405 -    <mkdir  dir="${dist.home}"/>
   6.406 -
   6.407 -	<!-- create templates -->
   6.408 -	<exec executable="make" dir="${web.home}/tmpl"/>
   6.409 -
   6.410 -    <!-- Copy static content of this web application -->
   6.411 -    <copy todir="${build.home}">
   6.412 -      <fileset dir="${web.home}"/>
   6.413 -    </copy>
   6.414 -
   6.415 -    <!-- Copy external dependencies as required -->
   6.416 -    <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
   6.417 -    <mkdir  dir="${build.home}/WEB-INF/lib"/>
   6.418 -<!--
   6.419 -    <copy todir="${build.home}/WEB-INF/lib" file="${foo.jar}"/>
   6.420 --->
   6.421 -
   6.422 -    <!-- Copy static files from external dependencies as needed -->
   6.423 -    <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
   6.424 -
   6.425 -  </target>
   6.426 -
   6.427 -
   6.428 -<!-- ==================== Reload Target =================================== -->
   6.429 -
   6.430 -<!--
   6.431 -
   6.432 -  The "reload" target tells the specified Tomcat 4 installation to dynamically
   6.433 -  reload this web application, to reflect changes in the underlying classes or
   6.434 -  the "web.xml" deployment descriptor.
   6.435 -
   6.436 --->
   6.437 -
   6.438 -  <target name="reload" depends="compile"
   6.439 -   description="Reload application on servlet container">
   6.440 -
   6.441 -    <reload url="${manager.url}"
   6.442 -       username="${manager.username}"
   6.443 -       password="${manager.password}"
   6.444 -           path="${app.path}"/>
   6.445 -
   6.446 -  </target>
   6.447 -
   6.448 -
   6.449 -<!-- ==================== Remove Target =================================== -->
   6.450 -
   6.451 -<!--
   6.452 -
   6.453 -  The "remove" target tells the specified Tomcat 4 installation to dynamically
   6.454 -  remove this web application from service.
   6.455 -
   6.456 -  NOTE:  This is the logical opposite of the "install" target.
   6.457 -
   6.458 --->
   6.459 -
   6.460 -  <target name="remove"
   6.461 -   description="Remove application on servlet container">
   6.462 -
   6.463 -    <remove url="${manager.url}"
   6.464 -       username="${manager.username}"
   6.465 -       password="${manager.password}"
   6.466 -           path="${app.path}"/>
   6.467 -
   6.468 -  </target>
   6.469 -
   6.470 -
   6.471 -  <target name="help">
   6.472 -    <echo>all      clean, them compile</echo>
   6.473 -    <echo>dist     create war file</echo>
   6.474 -    <echo>install  install application in servlet container</echo>
   6.475 -    <echo>list     list applications installed in servelet container</echo>
   6.476 -    <echo>reload   reload application in servlet container</echo>
   6.477 -    <echo>remove   dynamically remove web application</echo>
   6.478 -  </target>
   6.479 -
   6.480 -</project>
     7.1 --- a/tools/control/build.properties	Fri Nov 21 12:05:32 2003 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,7 +0,0 @@
     7.4 -catalina.home=/usr/groups/xeno/build_tools/jakarta-tomcat-4.1.24
     7.5 -# change <hostname> to your xenoserver
     7.6 -manager.url=http://<hostname>/manager
     7.7 -manager.username=hobbes
     7.8 -manager.password=tiger
     7.9 -compile.optimize=false
    7.10 -
     8.1 --- a/tools/control/doc/INSTALL-cmdline	Fri Nov 21 12:05:32 2003 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,14 +0,0 @@
     8.4 -To install command line interface:
     8.5 -
     8.6 -cd xeno.bk/tools/control
     8.7 -make cmdline
     8.8 -cp xenctl xenctl-cmdline.jar <dom0>/usr/local/bin
     8.9 -cp xenctl.xml <dom0>/etc
    8.10 -mkdir <dom0>/var/lib/xen
    8.11 -
    8.12 -First invocation of command line interface will give a warning about not being
    8.13 -able to load the disk state from /var/lib/xen/vdstate.xml. This is ok, it'll
    8.14 -be created the first time you change any state in the virtual disk manager.
    8.15 -
    8.16 -If you already have /etc/domctl.xml you can rename it to xenctl.xml to keep
    8.17 -your existing defaults.
     9.1 --- a/tools/control/doc/INSTALL-web	Fri Nov 21 12:05:32 2003 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,50 +0,0 @@
     9.4 -
     9.5 -some notes on configuring xenctl web interface...
     9.6 -
     9.7 -to build:
     9.8 -
     9.9 - export PATH=/usr/groups/xeno/build_tools/bin:${PATH}
    9.10 - # this next step has already been done.
    9.11 - # cp $CATALINA_HOME/server/lib/catalina-ant.jar $ANT_HOME/lib
    9.12 - cd xeno.bk/tools/control
    9.13 - make web
    9.14 - # You only need to make/install internal if you haven't already
    9.15 - # it's also needed by the cmdline tool
    9.16 - cd xeno.bk/tools/internal
    9.17 - make
    9.18 -
    9.19 -to setup:
    9.20 -
    9.21 - ## expand the jakarta (aka catalina) tree somewhere accessible by dom0
    9.22 - export ROOTDIR=/anfs/scratch/<somewhere>
    9.23 - cd $ROOTDIR
    9.24 - tar zxf /usr/groups/xeno/archive/tomcat-4.1.24.tar.gz 
    9.25 - export CATALINA_HOME=$ROOTDIR/jakarta-tomcat-4.1.24
    9.26 - export JAVA_HOME=/usr/groups/xeno/build_tools/java-1.4.1
    9.27 -
    9.28 - ## edit $CATALINA_HOME/conf/server.xml, change port 8080 to port 80
    9.29 - cp $CATALINA_HOME/conf/server.xml $CATALINA_HOME/conf/server.orig
    9.30 - sed 's/8080/80/g' $CATALINA_HOME/conf/server.orig > $CATALINA_HOME/conf/server.xml 
    9.31 -
    9.32 - ## install the xenctl web archive
    9.33 - cp xeno.bk/tools/control/dist/xenctl-0.1-dev.war $CATALINA_HOME/webapps/xenctl.war
    9.34 - # Only if you have not already copied this file for the command line tool
    9.35 - cp xeno.bk/tools/control/xenctl.xml /etc
    9.36 - # If it doesn't exist:
    9.37 - mkdir /var/lib/xen
    9.38 -
    9.39 - ## either edit xi_tools_dir in xenctl.xml or copy the binaries
    9.40 - ## unless already installed for the command line tool
    9.41 - # find xeno.bk/tools/internal -perm +111 -type f -exec cp {} /usr/local/bin \;
    9.42 -
    9.43 -to run:
    9.44 - $CATALINA_HOME/bin/startup.sh
    9.45 - # point your browser at hostname-0.xeno.cl.cam.ac.uk:80/xenctl
    9.46 -
    9.47 -
    9.48 -for development:
    9.49 - ## edit xeno.bk/tools/control/build.properties
    9.50 - # change manger.url to your xenoserver: mousetrap-0.xeno.cl.cam.ac.uk
    9.51 - ## to "make install-web" in xeno.bk/tools/control  instead of copying the war file
    9.52 - cp $CATALINA_HOME/conf/tomcat-users.xml $CATALINA_HOME/conf/tomcat-users.orig
    9.53 - 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
    10.1 --- a/tools/control/doc/USAGE-cmdline	Fri Nov 21 12:05:32 2003 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,97 +0,0 @@
    10.4 -IMPORTANT! DATA LOSS POTENTIAL!
    10.5 --------------------------------
    10.6 -
    10.7 -It is important that no changes be made to the virtual disk manager through
    10.8 -the command line while the web interface is running!
    10.9 -
   10.10 -If you use the web interface at all, it is NOT safe to call:
   10.11 -xenctl partitions add
   10.12 -xenctl vd create
   10.13 -xenctl vd delete
   10.14 -xenctl vd refresh
   10.15 -
   10.16 -Your changes will likely be lost, or the virtual disks left in an
   10.17 -inconsistent state, or data on them corrupted or erased.
   10.18 -
   10.19 -Other xenctl functions do not modify VDM state and are therefore safe,
   10.20 -e.g. it's okay to do domain control from the command line if the web
   10.21 -interface is running.
   10.22 -
   10.23 -General
   10.24 --------
   10.25 -
   10.26 -Invoking xenctl with no arguments, or with 'help' gives general usage
   10.27 -xenctl help command, or xenctl command -?, gives specific command help
   10.28 -
   10.29 -Domain control
   10.30 ---------------
   10.31 -
   10.32 -xenctl's command line interface is based on domctl. Defaults for domain
   10.33 -creation are found in /etc/xenctl.xml which has the same format as the
   10.34 -old domctl.xml
   10.35 -
   10.36 -Creating a domain: xenctl domain new <parameters>
   10.37 -All parameters may be omitted to get defaults from xenctl.xml, see help
   10.38 -for ful details of available parameters.
   10.39 -
   10.40 -Starting a domain: xenctl domain start -n<domain_no>
   10.41 -Stopping a domain: xenctl domain stop -n<domain_no>
   10.42 -Destroying a domain: xenctl domain destroy -n<domain_no> (add -f to force
   10.43 -                     destruction of a running domain)
   10.44 -
   10.45 -Listing all domains: xenctl domain list
   10.46 -
   10.47 -Physical disk access management
   10.48 --------------------------------
   10.49 -
   10.50 -Grant read-only access to a disk or partition:
   10.51 -  xenctl physical grant -n<domain_no> -p<partition_name> (e.g. sda10, sdc..etc)
   10.52 -Grant read-write access to a disk or partition:
   10.53 -  xenctl physical grant -w -n<domain_no> -p<partition_name>
   10.54 -  (if you grant read-write to a domain which already has read for the same
   10.55 -   partition, it will be upgraded quite happily, and vice versa)
   10.56 -Revoke access to a disk or partition:
   10.57 -  xenctl physical revoke -n<domain_no> -p<partition_name>
   10.58 -List access a domain has:
   10.59 -  xenctl physical list -n<domain_no>
   10.60 -   will list all the physical disks/partitions which the given domain may access
   10.61 -   and the rights assigned.
   10.62 -   
   10.63 -Virtual disk management
   10.64 ------------------------
   10.65 -
   10.66 -Add a disk partition as a XenoPartition (raw space to create VDs on):
   10.67 -  xenctl partitions add -p<partition_name> -c<chunk_size>
   10.68 -    adds the partition, splitting it up into chunks of the size given
   10.69 -    Sizes can all be specified as k, m, g.
   10.70 -Lists partitions:
   10.71 -  xenctl partitions list
   10.72 -    XenoPartitions are shown in [ ]
   10.73 -    
   10.74 -Create a virtual disk:
   10.75 -  xenctl vd create -n<name> -s<size> [-e<expiry>]
   10.76 -    Name is for identification only and need not be unique. Expiry may be none.
   10.77 -    Size can be in k, m, g
   10.78 -    You will be given a 10-digit key for the disk which is its unique identifier.
   10.79 -Delete a virtual disk:
   10.80 -  xenctl vd delete -k<key>
   10.81 -    Virtual disks with VBDs mapped to them may not be deleted.
   10.82 -Refresh the expiry on a disk:
   10.83 -  xenctl vd refresh -k<key> [-e<expiry>]
   10.84 -    Sets a new expiry, may be none.
   10.85 -List virtual disks:
   10.86 -  xenctl vd show
   10.87 -  
   10.88 -List space free:
   10.89 -  xenctl vd free
   10.90 -    Shows how much space has been added with partitions add, but not allocated
   10.91 -    to a virtual disk.
   10.92 -    
   10.93 -Create a virtual block device:
   10.94 -  xenctl vbd create -n<domain> -k<key> -v<vbd_number> [-w]
   10.95 -    Maps the disk with the given key into the domain. -w allows read-write.
   10.96 -    vbd number 0 = /dev/xvda, number 1 = /dev/xvdb, and so on.
   10.97 -Lists virtual block devices:
   10.98 -  xenctl vbd show
   10.99 -  
  10.100 -Virtual block devices are automatically deleted when their domain is destroyed.
    11.1 --- a/tools/control/examples/etc.exports-example	Fri Nov 21 12:05:32 2003 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,20 +0,0 @@
    11.4 -/local/roots/root1	169.254.1.1(rw,no_root_squash)
    11.5 -/local/roots/root2      169.254.1.2(rw,no_root_squash)
    11.6 -/local/roots/root3      169.254.1.3(rw,no_root_squash)
    11.7 -/local/roots/root4      169.254.1.4(rw,no_root_squash)
    11.8 -/local/roots/root5      169.254.1.5(rw,no_root_squash)
    11.9 -/local/roots/root6      169.254.1.6(rw,no_root_squash)
   11.10 -/local/roots/root7      169.254.1.7(rw,no_root_squash)
   11.11 -/local/roots/root8      169.254.1.8(rw,no_root_squash)
   11.12 -
   11.13 -#/usr			169.254.1/24(ro,no_root_squash)
   11.14 -
   11.15 -/local/usrs/usr1	169.254.1.1(rw,no_root_squash)
   11.16 -/local/usrs/usr2        169.254.1.2(rw,no_root_squash)
   11.17 -/local/usrs/usr3        169.254.1.3(rw,no_root_squash)
   11.18 -/local/usrs/usr4        169.254.1.4(rw,no_root_squash)
   11.19 -/local/usrs/usr5        169.254.1.5(rw,no_root_squash)
   11.20 -/local/usrs/usr6        169.254.1.6(rw,no_root_squash)
   11.21 -/local/usrs/usr7        169.254.1.7(rw,no_root_squash)
   11.22 -/local/usrs/usr8        169.254.1.8(rw,no_root_squash)
   11.23 -
    12.1 --- a/tools/control/examples/grub.conf-example	Fri Nov 21 12:05:32 2003 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,48 +0,0 @@
    12.4 -# grub.conf 
    12.5 -#
    12.6 -timeout=10
    12.7 -
    12.8 -# We can control GRUB via COM1. 
    12.9 -# Disable by default as it hangs on systems without a serial port and
   12.10 -# doesn't work with slpashimage enabled anyhow.
   12.11 -#
   12.12 -# serial --unit=0 --speed=115200
   12.13 -# terminal --timeout=10 serial console
   12.14 -
   12.15 -# These examples are from the Xen Demo CD, so the root filesystem setup
   12.16 -# using an initrd to mount the read only /usr is all rather non standard.
   12.17 -# There are arguably more normal examples in the README.CD file. Read
   12.18 -# the standard Linux documenation to find out about kernel cmd line
   12.19 -# parameters.
   12.20 -
   12.21 -# The two lots of console= parameters cause the domain 0 Linux to use both
   12.22 -# the VGA scree consoles and the Xen output-only console
   12.23 -
   12.24 -# We also make use of the ability to pass arbitrary environment variables
   12.25 -# on the kernel command line, so set the DOMID variable.
   12.26 -
   12.27 -splashimage=/boot/grub/splash.xpm.gz
   12.28 -
   12.29 -default=0
   12.30 -
   12.31 -title Xen / XenoLinux 2.4.22 
   12.32 -        kernel /boot/image.gz dom0_mem=100000
   12.33 -        module /boot/xenolinux.gz root=/dev/ram0 rw init=/linuxrc console=xencons0 console=tty0 DOMID=0
   12.34 -        module /boot/initrd.gz
   12.35 -
   12.36 -title Xen / XenoLinux 2.4.22 w/ cmdline IP config -- edit as required
   12.37 -        kernel /boot/image.gz dom0_mem=100000
   12.38 -        module /boot/xenolinux.gz ip=192.168.5.5::192.168.0.1:255.255.0.0::eth0:off root=/dev/ram0 rw init=/linuxrc console=xencons0 console=tty0 DOMID=0
   12.39 -        module /boot/initrd.gz
   12.40 -
   12.41 -title Xen / XenoLinux 2.4.22 in "safe mode"
   12.42 -        kernel /boot/image.gz ignorebiostables watchdog dom0_mem=100000 
   12.43 -        module /boot/xenolinux.gz root=/dev/ram0 rw init=/linuxrc console=xencons0 console=tty0 DOMID=0
   12.44 -        module /boot/initrd.gz
   12.45 -
   12.46 -
   12.47 -title Linux 2.4.22
   12.48 -        kernel /boot/vmlinuz-2.4.22 root=/dev/ram0 rw init=/linuxrc
   12.49 -        initrd /boot/initrd.gz
   12.50 -
   12.51 -
    13.1 --- a/tools/control/examples/xen-mynewdom	Fri Nov 21 12:05:32 2003 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,3 +0,0 @@
    13.4 -domain new
    13.5 -physical grant -pcdrom_link
    13.6 -domain start
    14.1 --- a/tools/control/examples/xenctl.xml	Fri Nov 21 12:05:32 2003 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,17 +0,0 @@
    14.4 -<?xml version="1.0"?>
    14.5 -<domctl_defaults>
    14.6 -<domain_name>XenoLinux</domain_name>
    14.7 -<domain_size_kb>98304</domain_size_kb>
    14.8 -<domain_image>/boot/xenolinux.gz</domain_image>
    14.9 -<domain_vifs>1</domain_vifs>
   14.10 -<domain_init_rd>/boot/initrd.gz</domain_init_rd>
   14.11 -<root_device>/dev/ram0</root_device>
   14.12 -<root_args>rw</root_args>
   14.13 -<args>init=/linuxrc 4 DOMID=+</args>
   14.14 -<nw_ip>169.254.1.0+</nw_ip>
   14.15 -<nw_gw>169.254.1.0</nw_gw>
   14.16 -<nw_mask>255.255.0.0</nw_mask>
   14.17 -<nw_nfs_server>169.254.1.0</nw_nfs_server>
   14.18 -<max_domain_number>1000</max_domain_number>
   14.19 -<xi_tools_dir>/usr/local/bin/</xi_tools_dir>
   14.20 -</domctl_defaults>
    15.1 --- a/tools/control/examples/xenctl.xml-dom0nfs	Fri Nov 21 12:05:32 2003 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,17 +0,0 @@
    15.4 -<?xml version="1.0"?>
    15.5 -<domctl_defaults>
    15.6 -<domain_name>XenoLinux</domain_name>
    15.7 -<domain_size_kb>98304</domain_size_kb>
    15.8 -<domain_image>/boot/xenolinux.gz</domain_image>
    15.9 -<domain_vifs>1</domain_vifs>
   15.10 -<root_device>/dev/nfs</root_device>
   15.11 -<root_args>rw</root_args>
   15.12 -<args>init=/linuxrc 4 DOMID=+</args>
   15.13 -<nw_ip>169.254.1.0+</nw_ip>
   15.14 -<nw_gw>169.254.1.0</nw_gw>
   15.15 -<nw_mask>255.255.0.0</nw_mask>
   15.16 -<nw_nfs_server>169.254.1.0</nw_nfs_server>
   15.17 -<nw_nfs_root>169.254.1.0:/local/roots/root+</nw_nfs_root>
   15.18 -<max_domain_number>1000</max_domain_number>
   15.19 -<xi_tools_dir>/usr/local/bin/</xi_tools_dir>
   15.20 -</domctl_defaults>
    16.1 --- a/tools/control/examples/xenctl.xml-linklocal	Fri Nov 21 12:05:32 2003 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,17 +0,0 @@
    16.4 -<?xml version="1.0"?>
    16.5 -<domctl_defaults>
    16.6 -<domain_name>XenoLinux</domain_name>
    16.7 -<domain_size_kb>98304</domain_size_kb>
    16.8 -<domain_image>/boot/xenolinux.gz</domain_image>
    16.9 -<domain_vifs>1</domain_vifs>
   16.10 -<domain_init_rd>/boot/initrd.gz</domain_init_rd>
   16.11 -<root_device>/dev/ram0</root_device>
   16.12 -<root_args>rw</root_args>
   16.13 -<args>init=/linuxrc 4 DOMID=+</args>
   16.14 -<nw_ip>169.254.1.0+</nw_ip>
   16.15 -<nw_gw>169.254.1.0</nw_gw>
   16.16 -<nw_mask>255.255.0.0</nw_mask>
   16.17 -<nw_nfs_server>169.254.1.0</nw_nfs_server>
   16.18 -<max_domain_number>1000</max_domain_number>
   16.19 -<xi_tools_dir>/usr/local/bin/</xi_tools_dir>
   16.20 -</domctl_defaults>
    17.1 --- a/tools/control/examples/xenctl.xml-publicip	Fri Nov 21 12:05:32 2003 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,17 +0,0 @@
    17.4 -<?xml version="1.0"?>
    17.5 -<domctl_defaults>
    17.6 -<domain_name>XenoLinux</domain_name>
    17.7 -<domain_size_kb>98304</domain_size_kb>
    17.8 -<domain_image>/boot/xenolinux.gz</domain_image>
    17.9 -<domain_vifs>1</domain_vifs>
   17.10 -<domain_init_rd>/boot/initrd.gz</domain_init_rd>
   17.11 -<root_device>/dev/ram0</root_device>
   17.12 -<root_args>rw</root_args>
   17.13 -<args>init=/linuxrc 4 DOMID=+</args>
   17.14 -<nw_ip>=+</nw_ip>
   17.15 -<nw_gw>=</nw_gw>
   17.16 -<nw_mask>=</nw_mask>
   17.17 -<nw_nfs_server>169.254.1.0</nw_nfs_server>
   17.18 -<max_domain_number>10</max_domain_number>
   17.19 -<xi_tools_dir>/usr/local/bin/</xi_tools_dir>
   17.20 -</domctl_defaults>
    18.1 --- a/tools/control/src/org/xenoserver/cmdline/CommandParser.java	Fri Nov 21 12:05:32 2003 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,142 +0,0 @@
    18.4 -package org.xenoserver.cmdline;
    18.5 -
    18.6 -import java.util.Iterator;
    18.7 -import java.util.LinkedList;
    18.8 -import java.util.List;
    18.9 -
   18.10 -import org.xenoserver.control.CommandFailedException;
   18.11 -import org.xenoserver.control.Defaults;
   18.12 -import org.xenoserver.control.PartitionManager;
   18.13 -import org.xenoserver.control.Settings;
   18.14 -import org.xenoserver.control.VirtualDiskManager;
   18.15 -import org.xenoserver.control.XML;
   18.16 -
   18.17 -/**
   18.18 - * Subclasses of Parser know how to parse arguments for a given command
   18.19 - * and execute it, displaying any output.
   18.20 - */
   18.21 -public abstract class CommandParser {
   18.22 -    /**
   18.23 -     * Subclasses should implement this method such that it outputs any successful
   18.24 -     * output to the screen, or throws an exception if required arguments
   18.25 -     * are missing or malformed. It also may propagate exceptions from the
   18.26 -     * command execution.
   18.27 -     * 
   18.28 -     * @param d The defaults object to use.
   18.29 -     * @param args The arguments to parse.
   18.30 -     * @throws ParseFailedException if the arguments are not suitable.
   18.31 -     * @throws CommandFailedException if the command did not execute successfully.
   18.32 -     */
   18.33 -    public abstract void parse(Defaults d, LinkedList args)
   18.34 -        throws ParseFailedException, CommandFailedException;
   18.35 -
   18.36 -    /** @return The command name which will be matched on the command line. */
   18.37 -    public abstract String getName();
   18.38 -    /** @return A usage string for this command. */
   18.39 -    public abstract String getUsage();
   18.40 -    /** @return The help text for this command. */
   18.41 -    public abstract String getHelpText();
   18.42 -
   18.43 -    /**
   18.44 -     * Print a usage string for this command.
   18.45 -     * @param prefix The command prefix for this command
   18.46 -     */
   18.47 -    public void printUsage(String prefix) {
   18.48 -        String name = getName();
   18.49 -        if (prefix != null) {
   18.50 -            name = prefix + " " + name;
   18.51 -        }
   18.52 -        String usage = getUsage();
   18.53 -        while (name.length() < 16) {
   18.54 -            name = name + " ";
   18.55 -        }
   18.56 -        System.out.println("   " + name + usage);
   18.57 -    }
   18.58 -
   18.59 -    /**
   18.60 -     * Prints the help text for this command.
   18.61 -     * @param args Command arguments, ignored for normal commands.
   18.62 -     */
   18.63 -    public void printHelpText(LinkedList args) {
   18.64 -        System.out.println(getName() + " " + getUsage());
   18.65 -        System.out.println();
   18.66 -        System.out.println(getHelpText());
   18.67 -    }
   18.68 -
   18.69 -    /**
   18.70 -     * Get a string parameter
   18.71 -     * @param args Argument list to search
   18.72 -     * @param key Argument key
   18.73 -     * @param def Default value
   18.74 -     * @return parameter, or default if none found
   18.75 -     */
   18.76 -    public String getStringParameter(List args, char key, String def) {
   18.77 -        String r = getParameter(args, key);
   18.78 -        return (r == null) ? def : r;
   18.79 -    }
   18.80 -
   18.81 -    /**
   18.82 -     * Get an int parameter
   18.83 -     * @param args Argument list to search
   18.84 -     * @param key Argument key
   18.85 -     * @param def Default value
   18.86 -     * @return parameter, or default if none found
   18.87 -     */
   18.88 -    public int getIntParameter(List args, char key, int def) {
   18.89 -        String r = getParameter(args, key);
   18.90 -        return (r == null) ? def : (Integer.parseInt(r.trim()));
   18.91 -    }
   18.92 -
   18.93 -    /**
   18.94 -     * Get a boolean parameter
   18.95 -     * @param args Argument list to search
   18.96 -     * @param key Argument key
   18.97 -     * @return parameter, or false if none found
   18.98 -     */
   18.99 -    public boolean getFlagParameter(List args, char key) {
  18.100 -        String r = getParameter(args, key);
  18.101 -        return (r == null) ? false : true;
  18.102 -    }
  18.103 -
  18.104 -    /**
  18.105 -     * Get a parameter
  18.106 -     * @param args Argument list to search
  18.107 -     * @param key Key to look for
  18.108 -     * @return Value, or "" if no value, or null if no such argument
  18.109 -     */
  18.110 -    protected String getParameter(List args, char key) {
  18.111 -        String result = null;
  18.112 -        Iterator i = args.iterator();
  18.113 -        while (i.hasNext()) {
  18.114 -            String arg = (String) i.next();
  18.115 -            if (arg.startsWith("-" + key)) {
  18.116 -                if (arg.length() > 2) {
  18.117 -                    result = arg.substring(2);
  18.118 -                } else {
  18.119 -                    result = "";
  18.120 -                }
  18.121 -            }
  18.122 -        }
  18.123 -        return result;
  18.124 -    }
  18.125 -
  18.126 -    /**
  18.127 -     * Load the partition and disk manager state
  18.128 -     */
  18.129 -    protected void loadState() {
  18.130 -        XML.loadState(
  18.131 -            PartitionManager.IT,
  18.132 -            VirtualDiskManager.IT,
  18.133 -            Settings.STATE_INPUT_FILE);
  18.134 -    }
  18.135 -
  18.136 -    /**
  18.137 -     * Save the partition and disk manager state
  18.138 -     */
  18.139 -    protected void saveState() {
  18.140 -        XML.saveState(
  18.141 -            PartitionManager.IT,
  18.142 -            VirtualDiskManager.IT,
  18.143 -            Settings.STATE_OUTPUT_FILE);
  18.144 -    }
  18.145 -}
    19.1 --- a/tools/control/src/org/xenoserver/cmdline/Main.java	Fri Nov 21 12:05:32 2003 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,103 +0,0 @@
    19.4 -package org.xenoserver.cmdline;
    19.5 -
    19.6 -import java.util.LinkedList;
    19.7 -import java.util.NoSuchElementException;
    19.8 -
    19.9 -import org.xenoserver.control.CommandFailedException;
   19.10 -import org.xenoserver.control.Defaults;
   19.11 -
   19.12 -/**
   19.13 - * Main class for the command-line xenctl interface.
   19.14 - */
   19.15 -public class Main {
   19.16 -  static final ParseHelp help = new ParseHelp();
   19.17 -  private static final CommandParser domaincommands[] =
   19.18 -    { new ParseDomainNew(),
   19.19 -      new ParseDomainStart(),
   19.20 -      new ParseDomainStop(),
   19.21 -      new ParseDomainDestroy(),
   19.22 -      new ParseDomainList()
   19.23 -    };
   19.24 -  private static final CommandParser partitioncommands[] =
   19.25 -    { new ParsePartitionsAdd(),
   19.26 -      new ParsePartitionsList()
   19.27 -    };
   19.28 -  private static final CommandParser physicalcommands[] =
   19.29 -    { new ParsePhysicalGrant(),
   19.30 -      new ParsePhysicalRevoke(),
   19.31 -      new ParsePhysicalList()
   19.32 -    };
   19.33 -  private static final CommandParser vdcommands[] =
   19.34 -    { new ParseVdCreate(),
   19.35 -      new ParseVdDelete(),
   19.36 -      new ParseVdRefresh(),
   19.37 -      new ParseVdShow(),
   19.38 -      new ParseVdFree()
   19.39 -    };
   19.40 -  private static final CommandParser vbdcommands[] =
   19.41 -    { new ParseVbdCreate(),
   19.42 -      new ParseVbdShow()
   19.43 -    };
   19.44 -  private static final CommandParser commands[] =
   19.45 -    { help,
   19.46 -      new ParseGroup( "domain", domaincommands ),
   19.47 -      new ParseGroup( "partitions", partitioncommands ),
   19.48 -      new ParseGroup( "physical", physicalcommands ),
   19.49 -      new ParseScript(),
   19.50 -      new ParseGroup( "vd", vdcommands ),
   19.51 -      new ParseGroup( "vbd", vbdcommands )
   19.52 -    };
   19.53 -  /** The top-level parser. */
   19.54 -  static final CommandParser parser = new ParseGroup( null, commands );
   19.55 -
   19.56 -  public static void executeArgList (Defaults d, LinkedList arglist)
   19.57 -     throws ParseFailedException, CommandFailedException 
   19.58 -  {
   19.59 -    if (arglist.size() == 0) {
   19.60 -      help.parse(null, null);
   19.61 -    } else {
   19.62 -      parser.parse(d, arglist);
   19.63 -    }
   19.64 -  }
   19.65 -
   19.66 -  public static void main(String[] args) {
   19.67 -    Defaults d = new Defaults();
   19.68 -    int ec = -1;
   19.69 -    LinkedList arglist = new LinkedList();
   19.70 -    boolean seen_arg = false;
   19.71 -    String collected = null;
   19.72 -    for ( int i=0; i<args.length; i++ ) {
   19.73 -      if (!(args[i].startsWith("-"))) {
   19.74 -	if (seen_arg) {
   19.75 -	  collected += " " + args[i];
   19.76 -	} else {
   19.77 -	  arglist.add(args[i]);
   19.78 -	}
   19.79 -      }
   19.80 -      if (args[i].startsWith("-")) {
   19.81 -	if (collected != null) {
   19.82 -	  arglist.add ( collected );
   19.83 -	  collected = null;
   19.84 -	}
   19.85 -	collected = args[i];
   19.86 -	seen_arg = true;
   19.87 -      }
   19.88 -    }
   19.89 -    if (collected != null) {
   19.90 -      arglist.add( collected );
   19.91 -    }
   19.92 -
   19.93 -    try {
   19.94 -      executeArgList (d, arglist);
   19.95 -      ec = 0;
   19.96 -    } catch (NoSuchElementException e) {
   19.97 -      help.parse(null, null);
   19.98 -    } catch (ParseFailedException e) {
   19.99 -      System.err.println( e.getMessage() );
  19.100 -    } catch (CommandFailedException e) {
  19.101 -      System.err.println( e.getMessage() );
  19.102 -    }
  19.103 -
  19.104 -    System.exit(ec);
  19.105 -  }
  19.106 -}
    20.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java	Fri Nov 21 12:05:32 2003 +0000
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,36 +0,0 @@
    20.4 -package org.xenoserver.cmdline;
    20.5 -
    20.6 -import java.util.LinkedList;
    20.7 -
    20.8 -import org.xenoserver.control.CommandDomainDestroy;
    20.9 -import org.xenoserver.control.CommandFailedException;
   20.10 -import org.xenoserver.control.Defaults;
   20.11 -
   20.12 -public class ParseDomainDestroy extends CommandParser {
   20.13 -    public void parse(Defaults d, LinkedList args)
   20.14 -        throws ParseFailedException, CommandFailedException {
   20.15 -        int domain_id = getIntParameter(args, 'n', d.domainNumber);
   20.16 -        boolean force = getFlagParameter(args, 'f');
   20.17 -
   20.18 -        if (domain_id == 0) {
   20.19 -            throw new ParseFailedException("Expected -n<domain_id>");
   20.20 -        }
   20.21 -
   20.22 -        String output = new CommandDomainDestroy(d, domain_id, force).execute();
   20.23 -        if (output != null) {
   20.24 -            System.out.println(output);
   20.25 -        }
   20.26 -    }
   20.27 -
   20.28 -    public String getName() {
   20.29 -        return "destroy";
   20.30 -    }
   20.31 -
   20.32 -    public String getUsage() {
   20.33 -        return "[-n<domain_id>] [-f]";
   20.34 -    }
   20.35 -
   20.36 -    public String getHelpText() {
   20.37 -        return "Destroy the specified domain.  -f forcibly destroys it.";
   20.38 -    }
   20.39 -}
    21.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainList.java	Fri Nov 21 12:05:32 2003 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,44 +0,0 @@
    21.4 -package org.xenoserver.cmdline;
    21.5 -
    21.6 -import java.util.LinkedList;
    21.7 -
    21.8 -import org.xenoserver.control.CommandDomainList;
    21.9 -import org.xenoserver.control.CommandFailedException;
   21.10 -import org.xenoserver.control.Defaults;
   21.11 -import org.xenoserver.control.Domain;
   21.12 -
   21.13 -public class ParseDomainList extends CommandParser {
   21.14 -    public void parse(Defaults d, LinkedList args)
   21.15 -        throws ParseFailedException, CommandFailedException {
   21.16 -        CommandDomainList list = new CommandDomainList(d);
   21.17 -        String output = list.execute();
   21.18 -        if (output != null) {
   21.19 -            System.out.println(output);
   21.20 -        }
   21.21 -
   21.22 -        Domain[] domains = list.domains();
   21.23 -
   21.24 -        for (int loop = 0; loop < domains.length; loop++) {
   21.25 -            System.out.println(
   21.26 -                "id: " + domains[loop].id + " (" + domains[loop].name + ")");
   21.27 -            System.out.println("  processor: " + domains[loop].processor);
   21.28 -            System.out.println("  has cpu: " + domains[loop].cpu);
   21.29 -            System.out.println(
   21.30 -                "  state: " + domains[loop].nstate + " " + domains[loop].state);
   21.31 -            System.out.println("  mcu advance: " + domains[loop].mcu);
   21.32 -            System.out.println("  total pages: " + domains[loop].pages);
   21.33 -        }
   21.34 -    }
   21.35 -
   21.36 -    public String getName() {
   21.37 -        return "list";
   21.38 -    }
   21.39 -
   21.40 -    public String getUsage() {
   21.41 -        return "";
   21.42 -    }
   21.43 -
   21.44 -    public String getHelpText() {
   21.45 -        return "List domain information and status.";
   21.46 -    }
   21.47 -}
    22.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java	Fri Nov 21 12:05:32 2003 +0000
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,124 +0,0 @@
    22.4 -package org.xenoserver.cmdline;
    22.5 -
    22.6 -import java.util.LinkedList;
    22.7 -
    22.8 -import org.xenoserver.control.CommandDomainNew;
    22.9 -import org.xenoserver.control.CommandFailedException;
   22.10 -import org.xenoserver.control.CommandPhysicalGrant;
   22.11 -import org.xenoserver.control.Defaults;
   22.12 -import org.xenoserver.control.Mode;
   22.13 -import org.xenoserver.control.StringPattern;
   22.14 -
   22.15 -public class ParseDomainNew extends CommandParser {
   22.16 -    public void parse(Defaults d, LinkedList args)
   22.17 -        throws ParseFailedException, CommandFailedException {
   22.18 -        String name = getStringParameter(args, 'n', d.domainName);
   22.19 -        int size = getIntParameter(args, 'k', d.domainSizeKB);
   22.20 -        String image = getStringParameter(args, 'i', d.domainImage);
   22.21 -        String initrd = getStringParameter(args, 'r', d.domainInitRD);
   22.22 -        int vifs = getIntParameter(args, 'v', d.domainVIFs);
   22.23 -        String bargs = getStringParameter(args, 'a', d.args);
   22.24 -        String root_dev = getStringParameter(args, 'd', d.rootDevice);
   22.25 -        String root_args = getStringParameter(args, 't', d.rootArgs);
   22.26 -        String usr_dev = getStringParameter(args, 'u', d.usrDevice);
   22.27 -        String nfs_root_path = getStringParameter(args, 'f', d.nwNFSRoot);
   22.28 -        String nw_ip = getStringParameter(args, '4', d.nwIP);
   22.29 -        String nw_gw = getStringParameter(args, 'g', d.nwGateway);
   22.30 -        String nw_mask = getStringParameter(args, 'm', d.nwMask);
   22.31 -        String nw_nfs_server = getStringParameter(args, 's', d.nwNFSServer);
   22.32 -        String nw_host = getStringParameter(args, 'h', d.nwHost);
   22.33 -	int subst = getIntParameter(args, 'x', -1);
   22.34 -
   22.35 -        d.describe();
   22.36 -
   22.37 -        CommandDomainNew c =
   22.38 -            new CommandDomainNew(
   22.39 -                d,
   22.40 -                name,
   22.41 -                size,
   22.42 -                image,
   22.43 -                initrd,
   22.44 -                vifs,
   22.45 -                bargs,
   22.46 -                root_dev,
   22.47 -                root_args,
   22.48 -                nfs_root_path,
   22.49 -                nw_ip,
   22.50 -                nw_gw,
   22.51 -                nw_mask,
   22.52 -                nw_nfs_server,
   22.53 -                nw_host,
   22.54 -                usr_dev,
   22.55 -		subst);
   22.56 -        c.execute();
   22.57 -        String[] output = c.output();
   22.58 -        for (int i = 0; i < output.length; i++) {
   22.59 -            System.out.println(output[i]);
   22.60 -        }
   22.61 -        
   22.62 -        if (root_dev.startsWith("/dev/sda") || root_dev.startsWith("/dev/hda")) {
   22.63 -            String real_root = StringPattern.parse(root_dev).resolve(c.domain_id());
   22.64 -            String device = real_root.substring(real_root.indexOf('/',1)+1);
   22.65 -            CommandPhysicalGrant cg = new CommandPhysicalGrant(d,c.domain_id(),device,Mode.READ_WRITE,false,subst);
   22.66 -            String output2 = cg.execute();
   22.67 -            if ( output2 != null ) {
   22.68 -                System.out.println(output2);
   22.69 -            }
   22.70 -        }
   22.71 -        
   22.72 -        if (usr_dev != null && ((usr_dev.startsWith("/dev/sda")) || usr_dev.startsWith("/dev/hda"))) {
   22.73 -            String real_usr = StringPattern.parse(usr_dev).resolve(c.domain_id());
   22.74 -            String device = real_usr.substring(real_usr.indexOf('/',1)+1);
   22.75 -            CommandPhysicalGrant cg = new CommandPhysicalGrant(d,c.domain_id(),device,Mode.READ_ONLY,false,subst);
   22.76 -            String output2 = cg.execute();
   22.77 -            if ( output2 != null ) {
   22.78 -                System.out.println(output2);
   22.79 -            }
   22.80 -        }
   22.81 -    }
   22.82 -
   22.83 -    public String getName() {
   22.84 -        return "new";
   22.85 -    }
   22.86 -
   22.87 -    public String getUsage() {
   22.88 -        return "[-n<domain_name>] [-k<size>] [-i<image>] [-v<num_vifs>] [-r<initrd>] [-d<root_device>] [-t<root_mount_args>] [-u<usr_device>] [-f<nfs_root>] [-s<nfs_boot_server>] [-4<ipv4_boot_address>] [-g<ipv4_boot_gateway>] [-m<ipv4_boot_netmask>] [-h<hostname>] [-a<args>] [-x<subst>]";
   22.89 -    }
   22.90 -
   22.91 -    public String getHelpText() {
   22.92 -        return "Create a new domain.  Note that most of the parameters will assume\n"
   22.93 -            + "default values: it should not be necessary to specify them all. See\n"
   22.94 -            + "xenctl.xml for the current default settings.\n"
   22.95 -            + "\n"
   22.96 -            + "General command line options:\n"
   22.97 -            + "  -n  Domain name                              domain_name\n"
   22.98 -            + "  -k  Domain size (kb)                         domain_size_kb\n"
   22.99 -            + "  -i  Domain image name                        domain_image\n"
  22.100 -            + "  -v  Number of VIFs                           domain_vifs\n"
  22.101 -            + "  -r  InitRD (if required)                     domain_init_rd\n"
  22.102 -            + "  -d  Root device (e.g /dev/nfs, /dev/hda3)    root_device\n"
  22.103 -            + "  -t  Root mount args (e.g ro)                 root_args\n"
  22.104 -            + "  -u  Usr dev/path (e.g /dev/hda3, server:path)usr_device\n"
  22.105 -            + "  -a  Additional boot parameters               args\n"
  22.106 -            + "  -x  Number to substitute for + if not domain id\n"
  22.107 -            + "\n"
  22.108 -            + "Networking options:\n"
  22.109 -            + "  -f  NFS root (if /dev/nfs specified)         nw_nfs_root\n"
  22.110 -            + "  -s  NFS server                               nw_nfs_server\n"
  22.111 -            + "  -4  Domain IPv4 address                      nw_ip\n"
  22.112 -            + "  -g  Domain gateway                           nw_gw\n"
  22.113 -            + "  -m  Domain net mask                          nw_mask\n"
  22.114 -            + "  -h  Domain hostname                          nw_host\n"
  22.115 -            + "\n"
  22.116 -            + "Parameters to -d, -f, -4, -g, -h can be specified as patterns into\n"
  22.117 -            + "which the allocated domain ID will be incorporated.  e.g.  for\n"
  22.118 -            + "domain 1 patterns would expand as follows:\n"
  22.119 -            + "\n"
  22.120 -            + "  /dev/hda+       /dev/hda1\n"
  22.121 -            + "  /dev/hda7+      /dev/hda8\n"
  22.122 -            + "  128.232.8.50+   128.232.8.51\n"
  22.123 -            + "\n"
  22.124 -            + "Additionally, patterns for -4 -g -m can include an = which is\n"
  22.125 -            + "expanded to the corresponding setting from the calling domain.\n";
  22.126 -    }
  22.127 -}
    23.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java	Fri Nov 21 12:05:32 2003 +0000
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,34 +0,0 @@
    23.4 -package org.xenoserver.cmdline;
    23.5 -
    23.6 -import java.util.LinkedList;
    23.7 -
    23.8 -import org.xenoserver.control.CommandDomainStart;
    23.9 -import org.xenoserver.control.CommandFailedException;
   23.10 -import org.xenoserver.control.Defaults;
   23.11 -
   23.12 -public class ParseDomainStart extends CommandParser {
   23.13 -    public void parse(Defaults d, LinkedList args)
   23.14 -        throws ParseFailedException, CommandFailedException {
   23.15 -        int domain_id = getIntParameter(args, 'n', d.domainNumber);
   23.16 -
   23.17 -        if (domain_id == 0) {
   23.18 -            throw new ParseFailedException("Expected -n<domain_id>");
   23.19 -        }
   23.20 -
   23.21 -        String output = new CommandDomainStart(d, domain_id).execute();
   23.22 -        if (output != null)
   23.23 -            System.out.println(output);
   23.24 -    }
   23.25 -
   23.26 -    public String getName() {
   23.27 -        return "start";
   23.28 -    }
   23.29 -
   23.30 -    public String getUsage() {
   23.31 -        return "[-n<domain_id>]";
   23.32 -    }
   23.33 -
   23.34 -    public String getHelpText() {
   23.35 -        return "Start the specified domain.";
   23.36 -    }
   23.37 -}
    24.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java	Fri Nov 21 12:05:32 2003 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,34 +0,0 @@
    24.4 -package org.xenoserver.cmdline;
    24.5 -
    24.6 -import java.util.LinkedList;
    24.7 -
    24.8 -import org.xenoserver.control.CommandDomainStop;
    24.9 -import org.xenoserver.control.CommandFailedException;
   24.10 -import org.xenoserver.control.Defaults;
   24.11 -
   24.12 -public class ParseDomainStop extends CommandParser {
   24.13 -    public void parse(Defaults d, LinkedList args)
   24.14 -        throws ParseFailedException, CommandFailedException {
   24.15 -        int domain_id = getIntParameter(args, 'n', d.domainNumber);
   24.16 -
   24.17 -        if (domain_id == 0) {
   24.18 -            throw new ParseFailedException("Expected -n<domain_id>");
   24.19 -        }
   24.20 -
   24.21 -        String output = new CommandDomainStop(d, domain_id).execute();
   24.22 -        if (output != null)
   24.23 -            System.out.println(output);
   24.24 -    }
   24.25 -
   24.26 -    public String getName() {
   24.27 -        return "stop";
   24.28 -    }
   24.29 -
   24.30 -    public String getUsage() {
   24.31 -        return "[-n<domain_id>]";
   24.32 -    }
   24.33 -
   24.34 -    public String getHelpText() {
   24.35 -        return "Stop the specified domain.";
   24.36 -    }
   24.37 -}
    25.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseFailedException.java	Fri Nov 21 12:05:32 2003 +0000
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,14 +0,0 @@
    25.4 -package org.xenoserver.cmdline;
    25.5 -
    25.6 -/**
    25.7 - * Thrown when a command line could not be parsed.
    25.8 - */
    25.9 -public class ParseFailedException extends Exception {
   25.10 -    public ParseFailedException(String message) {
   25.11 -        super(message);
   25.12 -    }
   25.13 -
   25.14 -    public ParseFailedException(String message, Throwable cause) {
   25.15 -        super(message, cause);
   25.16 -    }
   25.17 -}
    26.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseGroup.java	Fri Nov 21 12:05:32 2003 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,94 +0,0 @@
    26.4 -package org.xenoserver.cmdline;
    26.5 -
    26.6 -import java.util.LinkedList;
    26.7 -
    26.8 -import org.xenoserver.control.CommandFailedException;
    26.9 -import org.xenoserver.control.Defaults;
   26.10 -
   26.11 -/**
   26.12 - * Parses a group of commands; taking the first argument, it searches its
   26.13 - * array of commands until it finds a match, and then, removing the matched
   26.14 - * argument from the command line, invokes it. This allows hierarchical
   26.15 - * parsing.
   26.16 - */
   26.17 -public class ParseGroup extends CommandParser {
   26.18 -    /** Name of this group, i.e. the prefix to the command line */
   26.19 -    private final String name;
   26.20 -    /** The commands this group will attempt to match its arguments against. */
   26.21 -    private final CommandParser[] commands;
   26.22 -
   26.23 -    /**
   26.24 -     * Constructor for ParseGroup.
   26.25 -     * @param name Name of this group of commands
   26.26 -     * @param commands Array of commands to include
   26.27 -     */
   26.28 -    public ParseGroup(String name, CommandParser[] commands) {
   26.29 -        this.name = name;
   26.30 -        this.commands = commands;
   26.31 -    }
   26.32 -
   26.33 -    public void parse(Defaults d, LinkedList args)
   26.34 -        throws ParseFailedException, CommandFailedException {
   26.35 -        if (args.isEmpty()) {
   26.36 -            Main.help.parse(null,null);
   26.37 -            return;
   26.38 -        }
   26.39 -        
   26.40 -        int i;
   26.41 -        String c = (String) args.removeFirst();
   26.42 -        for (i = 0; i < commands.length; i++) {
   26.43 -            if (commands[i].getName().equals(c)) {
   26.44 -                if (!args.isEmpty() && args.getFirst().equals("-?")) {
   26.45 -                    commands[i].printHelpText(null);
   26.46 -                } else {
   26.47 -                    commands[i].parse(d, args);
   26.48 -                }
   26.49 -                break;
   26.50 -            }
   26.51 -        }
   26.52 -        if (i == commands.length) {
   26.53 -            throw new ParseFailedException("Unknown command " + c);
   26.54 -        }
   26.55 -    }
   26.56 -
   26.57 -    public String getName() {
   26.58 -        return name;
   26.59 -    }
   26.60 -
   26.61 -    public String getUsage() {
   26.62 -        return null;
   26.63 -    }
   26.64 -
   26.65 -    public String getHelpText() {
   26.66 -        return null;
   26.67 -    }
   26.68 -
   26.69 -    public void printUsage(String prefix) {
   26.70 -        if (prefix == null) {
   26.71 -            prefix = name;
   26.72 -        } else {
   26.73 -            prefix += " " + name;
   26.74 -        }
   26.75 -        for (int i = 0; i < commands.length; i++) {
   26.76 -            commands[i].printUsage(prefix);
   26.77 -        }
   26.78 -    }
   26.79 -
   26.80 -    public void printHelpText(LinkedList args) {
   26.81 -        if (args == null) {
   26.82 -            Main.help.parse(null,null);
   26.83 -            return;            
   26.84 -        }
   26.85 -        if (name != null) {
   26.86 -            System.out.print(name + " ");
   26.87 -        }
   26.88 -        int i;
   26.89 -        String c = (String) args.removeFirst();
   26.90 -        for (i = 0; i < commands.length; i++) {
   26.91 -            if (commands[i].getName().equals(c)) {
   26.92 -                commands[i].printHelpText(args);
   26.93 -                break;
   26.94 -            }
   26.95 -        }
   26.96 -    }
   26.97 -}
    27.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseHelp.java	Fri Nov 21 12:05:32 2003 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,31 +0,0 @@
    27.4 -package org.xenoserver.cmdline;
    27.5 -
    27.6 -import java.util.LinkedList;
    27.7 -
    27.8 -import org.xenoserver.control.Defaults;
    27.9 -
   27.10 -public class ParseHelp extends CommandParser {
   27.11 -    public void parse(Defaults d, LinkedList args) {
   27.12 -        if (args == null || args.isEmpty()) {
   27.13 -            System.out.println("Usage:");
   27.14 -            Main.parser.printUsage(null);
   27.15 -        } else {
   27.16 -            System.out.print("xenctl ");
   27.17 -            Main.parser.printHelpText(args);
   27.18 -        }
   27.19 -
   27.20 -        System.out.println("");
   27.21 -    }
   27.22 -
   27.23 -    public String getName() {
   27.24 -        return "help";
   27.25 -    }
   27.26 -
   27.27 -    public String getUsage() {
   27.28 -        return "[<any command>]";
   27.29 -    }
   27.30 -
   27.31 -    public String getHelpText() {
   27.32 -        return "This message, or if a command is specified, help for that command.";
   27.33 -    }
   27.34 -}
    28.1 --- a/tools/control/src/org/xenoserver/cmdline/ParsePartitionsAdd.java	Fri Nov 21 12:05:32 2003 +0000
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,43 +0,0 @@
    28.4 -package org.xenoserver.cmdline;
    28.5 -
    28.6 -import java.util.LinkedList;
    28.7 -
    28.8 -import org.xenoserver.control.CommandFailedException;
    28.9 -import org.xenoserver.control.CommandPartitionAdd;
   28.10 -import org.xenoserver.control.Defaults;
   28.11 -import org.xenoserver.control.Library;
   28.12 -
   28.13 -public class ParsePartitionsAdd extends CommandParser {
   28.14 -    public void parse(Defaults d, LinkedList args)
   28.15 -        throws ParseFailedException, CommandFailedException {
   28.16 -        boolean force = getFlagParameter(args, 'f');
   28.17 -        String partition_name = getStringParameter(args, 'p', "");
   28.18 -        String size = getStringParameter(args, 'c', "128M");
   28.19 -
   28.20 -        if (partition_name.equals("")) {
   28.21 -            throw new ParseFailedException("Expected -p<partition_name>");
   28.22 -        }
   28.23 -
   28.24 -        loadState();
   28.25 -        String output =
   28.26 -            new CommandPartitionAdd(partition_name, Library.parseSize(size),force)
   28.27 -                .execute();
   28.28 -        if (output != null) {
   28.29 -            System.out.println(output);
   28.30 -        }
   28.31 -        saveState();
   28.32 -    }
   28.33 -
   28.34 -    public String getName() {
   28.35 -        return "add";
   28.36 -    }
   28.37 -
   28.38 -    public String getUsage() {
   28.39 -        return "-p<partition_name> [-f] [-c<chunk_size>]";
   28.40 -    }
   28.41 -
   28.42 -    public String getHelpText() {
   28.43 -        return "Add the specified partition to the virtual disk manager's free\n"
   28.44 -            + "space. -c changes the default chunk size. -f forces add.";
   28.45 -    }
   28.46 -}
    29.1 --- a/tools/control/src/org/xenoserver/cmdline/ParsePartitionsList.java	Fri Nov 21 12:05:32 2003 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,65 +0,0 @@
    29.4 -package org.xenoserver.cmdline;
    29.5 -
    29.6 -import java.util.Iterator;
    29.7 -import java.util.LinkedList;
    29.8 -
    29.9 -import org.xenoserver.control.CommandFailedException;
   29.10 -import org.xenoserver.control.Defaults;
   29.11 -import org.xenoserver.control.Library;
   29.12 -import org.xenoserver.control.Partition;
   29.13 -import org.xenoserver.control.PartitionManager;
   29.14 -
   29.15 -public class ParsePartitionsList extends CommandParser {
   29.16 -    public void parse(Defaults d, LinkedList args)
   29.17 -        throws ParseFailedException, CommandFailedException {
   29.18 -        loadState();
   29.19 -        Iterator i = PartitionManager.IT.iterator();
   29.20 -        int idx = 1;
   29.21 -        System.out.println(
   29.22 -            "     maj:min "
   29.23 -                + "    blocks "
   29.24 -                + "start sect "
   29.25 -                + " num sects "
   29.26 -                + "name");
   29.27 -        while (i.hasNext()) {
   29.28 -            Partition p = (Partition) i.next();
   29.29 -
   29.30 -            if (p.isXeno()) {
   29.31 -                System.out.print("[ ");
   29.32 -            } else {
   29.33 -                System.out.print("  ");
   29.34 -            }
   29.35 -            System.out.print(Library.format(idx++, 2, false) + " ");
   29.36 -            System.out.print(
   29.37 -                Library.format(p.getMajor(), 3, false)
   29.38 -                    + ":"
   29.39 -                    + Library.format(p.getMinor(), 3, true)
   29.40 -                    + " "
   29.41 -                    + Library.format(p.getBlocks(), 10, false)
   29.42 -                    + " "
   29.43 -                    + Library.format(p.getStartSect(), 10, false)
   29.44 -                    + " "
   29.45 -                    + Library.format(p.getNumSects(), 10, false)
   29.46 -                    + " "
   29.47 -                    + Library.format(p.getName(), 7, true));
   29.48 -            if (p.isXeno()) {
   29.49 -                System.out.println("]");
   29.50 -            } else {
   29.51 -                System.out.println();
   29.52 -            }
   29.53 -        }
   29.54 -    }
   29.55 -
   29.56 -    public String getName() {
   29.57 -        return "list";
   29.58 -    }
   29.59 -
   29.60 -    public String getUsage() {
   29.61 -        return "";
   29.62 -    }
   29.63 -
   29.64 -    public String getHelpText() {
   29.65 -        return "List physical partition information. Partitions surrounded by [] are XenoPartitions.";
   29.66 -    }
   29.67 -
   29.68 -}
    30.1 --- a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalGrant.java	Fri Nov 21 12:05:32 2003 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,56 +0,0 @@
    30.4 -package org.xenoserver.cmdline;
    30.5 -
    30.6 -import java.util.LinkedList;
    30.7 -
    30.8 -import org.xenoserver.control.CommandFailedException;
    30.9 -import org.xenoserver.control.CommandPhysicalGrant;
   30.10 -import org.xenoserver.control.Defaults;
   30.11 -import org.xenoserver.control.Mode;
   30.12 -
   30.13 -public class ParsePhysicalGrant extends CommandParser {
   30.14 -    public void parse(Defaults d, LinkedList args)
   30.15 -        throws ParseFailedException, CommandFailedException {
   30.16 -        int domain_id = getIntParameter(args, 'n', d.domainNumber);
   30.17 -        boolean force = getFlagParameter(args, 'f');
   30.18 -        String partition_name = getStringParameter(args, 'p', "");
   30.19 -        boolean write = getFlagParameter(args, 'w');
   30.20 -	int subst = getIntParameter(args, 'x', -1);
   30.21 -
   30.22 -        if (domain_id == 0) {
   30.23 -            throw new ParseFailedException("Expected -n<domain_id>");
   30.24 -        }
   30.25 -        if (partition_name.equals("")) {
   30.26 -            throw new ParseFailedException("Expected -p<partition_name>");
   30.27 -        }
   30.28 -
   30.29 -        Mode mode;
   30.30 -        if (write) {
   30.31 -            mode = Mode.READ_WRITE;
   30.32 -        } else {
   30.33 -            mode = Mode.READ_ONLY;
   30.34 -        }
   30.35 -
   30.36 -        // Initialise the partition manager and look up the partition
   30.37 -        loadState();
   30.38 -        String output =
   30.39 -            new CommandPhysicalGrant(d, domain_id, partition_name, mode, force,subst)
   30.40 -                .execute();
   30.41 -        if (output != null) {
   30.42 -            System.out.println(output);
   30.43 -        }
   30.44 -    }
   30.45 -
   30.46 -    public String getName() {
   30.47 -        return "grant";
   30.48 -    }
   30.49 -
   30.50 -    public String getUsage() {
   30.51 -        return "-p<partition_name> [-n<domain_id>] [-f] [-w] [-x<subst>]";
   30.52 -    }
   30.53 -
   30.54 -    public String getHelpText() {
   30.55 -        return "Grant the specified domain access to the given partition.  -w grants"
   30.56 -            + " read-write instead of read-only.  -f forcibly grants access.";
   30.57 -    }
   30.58 -
   30.59 -}
    31.1 --- a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalList.java	Fri Nov 21 12:05:32 2003 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,94 +0,0 @@
    31.4 -package org.xenoserver.cmdline;
    31.5 -
    31.6 -import java.util.Iterator;
    31.7 -import java.util.LinkedList;
    31.8 -import java.util.Map.Entry;
    31.9 -
   31.10 -import org.xenoserver.control.CommandFailedException;
   31.11 -import org.xenoserver.control.CommandPhysicalList;
   31.12 -import org.xenoserver.control.Defaults;
   31.13 -import org.xenoserver.control.Extent;
   31.14 -import org.xenoserver.control.Library;
   31.15 -import org.xenoserver.control.Partition;
   31.16 -import org.xenoserver.control.PartitionManager;
   31.17 -
   31.18 -public class ParsePhysicalList extends CommandParser {
   31.19 -    public void parse(Defaults d, LinkedList args)
   31.20 -        throws ParseFailedException, CommandFailedException {
   31.21 -        int domain_id = getIntParameter(args, 'n', d.domainNumber);
   31.22 -        if (domain_id == 0) {
   31.23 -            throw new ParseFailedException("Expected -n<domain_id>");
   31.24 -        }
   31.25 -
   31.26 -        // Initialise the partition manager
   31.27 -        loadState();
   31.28 -
   31.29 -        CommandPhysicalList list = new CommandPhysicalList(d, domain_id);
   31.30 -        String output = list.execute();
   31.31 -        if (output != null) {
   31.32 -            System.out.println(output);
   31.33 -        }
   31.34 -
   31.35 -        System.out.println(
   31.36 -            "maj:min "
   31.37 -                + "    blocks "
   31.38 -                + "start sect "
   31.39 -                + " num sects "
   31.40 -                + "name    "
   31.41 -                + "access");
   31.42 -        Iterator i = list.extents().entrySet().iterator();
   31.43 -        while (i.hasNext()) {
   31.44 -            Entry entry = (Entry) i.next();
   31.45 -            Extent e = (Extent) entry.getKey();
   31.46 -            String mode = entry.getValue().toString();
   31.47 -            Partition p = PartitionManager.IT.getPartition(e);
   31.48 -            if (p != null) {
   31.49 -                System.out.println(
   31.50 -                    Library.format(p.getMajor(), 3, false)
   31.51 -                        + ":"
   31.52 -                        + Library.format(p.getMinor(), 3, true)
   31.53 -                        + " "
   31.54 -                        + Library.format(p.getBlocks(), 10, false)
   31.55 -                        + " "
   31.56 -                        + Library.format(p.getStartSect(), 10, false)
   31.57 -                        + " "
   31.58 -                        + Library.format(p.getNumSects(), 10, false)
   31.59 -                        + " "
   31.60 -                        + Library.format(p.getName(), 7, true)
   31.61 -                        + " "
   31.62 -                        + Library.format(mode, 2, true));
   31.63 -            } else {
   31.64 -                System.out.println(
   31.65 -                    Library.format(e.getMajor(), 3, false)
   31.66 -                        + ":"
   31.67 -                        + Library.format(
   31.68 -                            e.getMinor() | e.getPartitionNo(),
   31.69 -                            3,
   31.70 -                            true)
   31.71 -                        + " "
   31.72 -                        + "          "
   31.73 -                        + " "
   31.74 -                        + Library.format(e.getOffset(), 10, false)
   31.75 -                        + " "
   31.76 -                        + Library.format(e.getSize(), 10, false)
   31.77 -                        + " "
   31.78 -                        + "       "
   31.79 -                        + " "
   31.80 -                        + Library.format(mode, 2, true));
   31.81 -            }
   31.82 -        }
   31.83 -    }
   31.84 -
   31.85 -    public String getName() {
   31.86 -        return "list";
   31.87 -    }
   31.88 -
   31.89 -    public String getUsage() {
   31.90 -        return "-n<domain_id>";
   31.91 -    }
   31.92 -
   31.93 -    public String getHelpText() {
   31.94 -        return "List all physical access which the given domain has been granted.";
   31.95 -    }
   31.96 -
   31.97 -}
    32.1 --- a/tools/control/src/org/xenoserver/cmdline/ParsePhysicalRevoke.java	Fri Nov 21 12:05:32 2003 +0000
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,43 +0,0 @@
    32.4 -package org.xenoserver.cmdline;
    32.5 -
    32.6 -import java.util.LinkedList;
    32.7 -
    32.8 -import org.xenoserver.control.CommandFailedException;
    32.9 -import org.xenoserver.control.CommandPhysicalRevoke;
   32.10 -import org.xenoserver.control.Defaults;
   32.11 -
   32.12 -public class ParsePhysicalRevoke extends CommandParser {
   32.13 -    public void parse(Defaults d, LinkedList args)
   32.14 -        throws ParseFailedException, CommandFailedException {
   32.15 -        int domain_id = getIntParameter(args, 'n', d.domainNumber);
   32.16 -        String partition_name = getStringParameter(args, 'p', "");
   32.17 -	int subst = getIntParameter(args, 'x', -1);
   32.18 -
   32.19 -        if (domain_id == 0) {
   32.20 -            throw new ParseFailedException("Expected -n<domain_id>");
   32.21 -        }
   32.22 -        if (partition_name.equals("")) {
   32.23 -            throw new ParseFailedException("Expected -p<partition_name>");
   32.24 -        }
   32.25 -
   32.26 -        // Initialise the partition manager and look up the partition
   32.27 -        loadState();
   32.28 -        String output = new CommandPhysicalRevoke(d, domain_id, partition_name, subst).execute();
   32.29 -        if (output != null) {
   32.30 -            System.out.println(output);
   32.31 -        }
   32.32 -    }
   32.33 -
   32.34 -    public String getName() {
   32.35 -        return "revoke";
   32.36 -    }
   32.37 -
   32.38 -    public String getUsage() {
   32.39 -        return "-p<partition_name> [-n<domain_id>] [-x<subst>]";
   32.40 -    }
   32.41 -
   32.42 -    public String getHelpText() {
   32.43 -        return "Revoke access to the given partition from the specified domain.";
   32.44 -    }
   32.45 -
   32.46 -}
    33.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseScript.java	Fri Nov 21 12:05:32 2003 +0000
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,79 +0,0 @@
    33.4 -package org.xenoserver.cmdline;
    33.5 -
    33.6 -import java.util.Iterator;
    33.7 -import java.util.LinkedList;
    33.8 -import java.util.StringTokenizer;
    33.9 -
   33.10 -import java.io.BufferedReader;
   33.11 -import java.io.FileReader;
   33.12 -import java.io.Reader;
   33.13 -import java.io.InputStreamReader;
   33.14 -import java.io.IOException;
   33.15 -
   33.16 -import org.xenoserver.control.CommandFailedException;
   33.17 -import org.xenoserver.control.Defaults;
   33.18 -import org.xenoserver.control.Extent;
   33.19 -import org.xenoserver.control.Library;
   33.20 -import org.xenoserver.control.Settings;
   33.21 -import org.xenoserver.control.VirtualDisk;
   33.22 -import org.xenoserver.control.VirtualDiskManager;
   33.23 -
   33.24 -public class ParseScript extends CommandParser {
   33.25 -  public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
   33.26 -    String filename = getStringParameter(args,'f',null);
   33.27 -
   33.28 -    try
   33.29 -      {
   33.30 -	Reader r;
   33.31 -	BufferedReader br;
   33.32 -	String next_line;
   33.33 -	boolean stdin;
   33.34 -
   33.35 -	if (filename == null) {
   33.36 -	  r = new InputStreamReader (System.in);
   33.37 -	  stdin = true;
   33.38 -	} else {
   33.39 -	  r = new FileReader (filename);
   33.40 -	  stdin = false;
   33.41 -	}
   33.42 -	br = new BufferedReader (r);
   33.43 -	
   33.44 -	if (stdin) prompt();
   33.45 -	while ((next_line = br.readLine()) != null) 
   33.46 -	  {
   33.47 -	    StringTokenizer tok = new StringTokenizer(next_line, " ");
   33.48 -	    LinkedList arglist = new LinkedList();
   33.49 -	    while (tok.hasMoreTokens()) {
   33.50 -	      arglist.add (tok.nextToken ());
   33.51 -	    }
   33.52 -	    Main.executeArgList (d, arglist);
   33.53 -	    if (stdin) prompt();
   33.54 -	  }
   33.55 -      }
   33.56 -    catch (IOException ioe)
   33.57 -      {
   33.58 -	throw new ParseFailedException ("Could not read script \"" + filename + "\"", ioe);
   33.59 -      }
   33.60 -  }
   33.61 -
   33.62 -  void prompt() {
   33.63 -    System.out.print ("$ ");
   33.64 -    System.out.flush ();
   33.65 -  }
   33.66 -
   33.67 -  public String getName() {
   33.68 -    return "script";
   33.69 -  }
   33.70 -
   33.71 -  public String getUsage() {
   33.72 -    return "[-f<filename>]";
   33.73 -  }
   33.74 -
   33.75 -  public String getHelpText() {
   33.76 -    return ("Execute a series of xenctl command lines found in the specified file\n" +
   33.77 -	    "(or from standard input if no filename is given).  Execution terminates\n" +
   33.78 -	    "if any command fails.  If a command requires a domain ID then, if\n" +
   33.79 -	    "ommitted, the domain most recently created by the script will be used\n" +
   33.80 -	    "by default.\n");
   33.81 -  }
   33.82 -}
    34.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseVbdCreate.java	Fri Nov 21 12:05:32 2003 +0000
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,63 +0,0 @@
    34.4 -package org.xenoserver.cmdline;
    34.5 -
    34.6 -import java.util.LinkedList;
    34.7 -
    34.8 -import org.xenoserver.control.CommandFailedException;
    34.9 -import org.xenoserver.control.CommandVbdCreate;
   34.10 -import org.xenoserver.control.CommandVbdCreatePhysical;
   34.11 -import org.xenoserver.control.Defaults;
   34.12 -import org.xenoserver.control.Mode;
   34.13 -
   34.14 -public class ParseVbdCreate extends CommandParser {
   34.15 -    public void parse(Defaults d, LinkedList args)
   34.16 -        throws ParseFailedException, CommandFailedException {
   34.17 -        String vd_key = getStringParameter(args, 'k', "");
   34.18 -        String partition_name = getStringParameter(args, 'p', "");
   34.19 -        int domain_id = getIntParameter(args, 'n', d.domainNumber);
   34.20 -        int vbd_num = getIntParameter(args, 'v', -1);
   34.21 -        boolean write = getFlagParameter(args, 'w');
   34.22 -	int subst = getIntParameter(args, 'x', -1);
   34.23 -
   34.24 -        if (vd_key.equals("") && partition_name.equals("")) {
   34.25 -            throw new ParseFailedException("Expected -k<key> or -p<partition>");
   34.26 -        }
   34.27 -        if (vbd_num == -1) {
   34.28 -            throw new ParseFailedException("Expected -v<vbd_num>");
   34.29 -        }
   34.30 -
   34.31 -        Mode mode;
   34.32 -        if (write) {
   34.33 -            mode = Mode.READ_WRITE;
   34.34 -        } else {
   34.35 -            mode = Mode.READ_ONLY;
   34.36 -        }
   34.37 -
   34.38 -        loadState();
   34.39 -        String output;
   34.40 -        if (vd_key.equals("")) {
   34.41 -            output = new CommandVbdCreatePhysical(d,  partition_name, domain_id, vbd_num, mode, subst ).execute();
   34.42 -        } else {
   34.43 -            output =
   34.44 -                new CommandVbdCreate(vd_key, domain_id, vbd_num, mode).execute();
   34.45 -        }
   34.46 -        if (output != null) {
   34.47 -            System.out.println(output);
   34.48 -        }
   34.49 -        saveState();
   34.50 -    }
   34.51 -
   34.52 -    public String getName() {
   34.53 -        return "create";
   34.54 -    }
   34.55 -
   34.56 -    public String getUsage() {
   34.57 -        return "{-k<key>|-p<partition} -v<vbd_num> [-n<domain_id>] [-w] [-x<subst>]";
   34.58 -    }
   34.59 -
   34.60 -    public String getHelpText() {
   34.61 -        return "Create a new virtual block device binding the virtual disk with\n"
   34.62 -            + "the specified key to the domain and VBD number given. Add -w to\n"
   34.63 -            + "allow read-write access.";
   34.64 -    }
   34.65 -
   34.66 -}
    35.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseVbdShow.java	Fri Nov 21 12:05:32 2003 +0000
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,41 +0,0 @@
    35.4 -package org.xenoserver.cmdline;
    35.5 -
    35.6 -import java.util.LinkedList;
    35.7 -
    35.8 -import org.xenoserver.control.CommandFailedException;
    35.9 -import org.xenoserver.control.CommandVbdList;
   35.10 -import org.xenoserver.control.Defaults;
   35.11 -import org.xenoserver.control.Library;
   35.12 -import org.xenoserver.control.VirtualBlockDevice;
   35.13 -
   35.14 -public class ParseVbdShow extends CommandParser {
   35.15 -    public void parse(Defaults d, LinkedList args)
   35.16 -        throws ParseFailedException, CommandFailedException {
   35.17 -        loadState();
   35.18 -        CommandVbdList list = new CommandVbdList();
   35.19 -        list.execute();
   35.20 -        VirtualBlockDevice[] vbds = list.vbds();
   35.21 -        System.out.println("key         dom vbd mode");
   35.22 -        for (int i=0; i<vbds.length; i++) {
   35.23 -            System.out.println( vbds[i].getVirtualDisk().getKey()
   35.24 -                    + "  "
   35.25 -                    + Library.format(vbds[i].getDomain(), 3, false)
   35.26 -                    + " "
   35.27 -                    + Library.format(vbds[i].getVbdNum(), 3, false)
   35.28 -                    + " "
   35.29 -                    + vbds[i].getMode().toString());
   35.30 -        }
   35.31 -    }
   35.32 -
   35.33 -    public String getName() {
   35.34 -        return "show";
   35.35 -    }
   35.36 -
   35.37 -    public String getUsage() {
   35.38 -        return "";
   35.39 -    }
   35.40 -
   35.41 -    public String getHelpText() {
   35.42 -        return "Show details of all mapped virtual block devices.";
   35.43 -    }
   35.44 -}
    36.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdCreate.java	Fri Nov 21 12:05:32 2003 +0000
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,60 +0,0 @@
    36.4 -package org.xenoserver.cmdline;
    36.5 -
    36.6 -import java.text.DateFormat;
    36.7 -import java.text.ParseException;
    36.8 -import java.util.Date;
    36.9 -import java.util.LinkedList;
   36.10 -
   36.11 -import org.xenoserver.control.CommandFailedException;
   36.12 -import org.xenoserver.control.CommandVdCreate;
   36.13 -import org.xenoserver.control.Defaults;
   36.14 -import org.xenoserver.control.Library;
   36.15 -
   36.16 -public class ParseVdCreate extends CommandParser {
   36.17 -    public void parse(Defaults d, LinkedList args)
   36.18 -        throws ParseFailedException, CommandFailedException {
   36.19 -        String name = getStringParameter(args, 'n', "");
   36.20 -        String size_s = getStringParameter(args, 's', "");
   36.21 -        String expiry_s = getStringParameter(args, 'e', "");
   36.22 -        Date expiry;
   36.23 -
   36.24 -        if (name.equals("")) {
   36.25 -            throw new ParseFailedException("Expected -n<name>");
   36.26 -        }
   36.27 -        if (size_s.equals("")) {
   36.28 -            throw new ParseFailedException("Expected -s<size>");
   36.29 -        }
   36.30 -        if (expiry_s.equals("")) {
   36.31 -            expiry = null;
   36.32 -        } else {
   36.33 -            DateFormat format = DateFormat.getDateTimeInstance();
   36.34 -            try {
   36.35 -                expiry = format.parse(expiry_s);
   36.36 -            } catch (ParseException e) {
   36.37 -                throw new ParseFailedException("Could not parse date");
   36.38 -            }
   36.39 -        }
   36.40 -
   36.41 -        long size = Library.parseSize(size_s);
   36.42 -
   36.43 -        loadState();
   36.44 -        String output = new CommandVdCreate(name, size, expiry).execute();
   36.45 -        if (output != null) {
   36.46 -            System.out.println(output);
   36.47 -        }
   36.48 -        saveState();
   36.49 -    }
   36.50 -
   36.51 -    public String getName() {
   36.52 -        return "create";
   36.53 -    }
   36.54 -
   36.55 -    public String getUsage() {
   36.56 -        return "-n<name> -s<size> [-e<expiry>]";
   36.57 -    }
   36.58 -
   36.59 -    public String getHelpText() {
   36.60 -        return "Create a new virtual disk with the specified parameters";
   36.61 -    }
   36.62 -
   36.63 -}
    37.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdDelete.java	Fri Nov 21 12:05:32 2003 +0000
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,40 +0,0 @@
    37.4 -package org.xenoserver.cmdline;
    37.5 -
    37.6 -import java.util.LinkedList;
    37.7 -
    37.8 -import org.xenoserver.control.CommandFailedException;
    37.9 -import org.xenoserver.control.CommandVdDelete;
   37.10 -import org.xenoserver.control.Defaults;
   37.11 -
   37.12 -public class ParseVdDelete extends CommandParser {
   37.13 -    public void parse(Defaults d, LinkedList args)
   37.14 -        throws ParseFailedException, CommandFailedException {
   37.15 -        String vd_key = getStringParameter(args, 'k', "");
   37.16 -        boolean force = getFlagParameter(args,'f');
   37.17 -
   37.18 -        if (vd_key.equals("")) {
   37.19 -            throw new ParseFailedException("Expected -k<key>");
   37.20 -        }
   37.21 -
   37.22 -        loadState();
   37.23 -        String output = new CommandVdDelete(vd_key,force).execute();
   37.24 -        if (output != null) {
   37.25 -            System.out.println(output);
   37.26 -        }
   37.27 -
   37.28 -        saveState();
   37.29 -    }
   37.30 -
   37.31 -    public String getName() {
   37.32 -        return "delete";
   37.33 -    }
   37.34 -
   37.35 -    public String getUsage() {
   37.36 -        return "-k<key> [-f]";
   37.37 -    }
   37.38 -
   37.39 -    public String getHelpText() {
   37.40 -        return "Deletes the virtual disk with the specified key. -f forces deletion even if the disk is in use.";
   37.41 -    }
   37.42 -
   37.43 -}
    38.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdFree.java	Fri Nov 21 12:05:32 2003 +0000
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,55 +0,0 @@
    38.4 -package org.xenoserver.cmdline;
    38.5 -
    38.6 -import java.util.Iterator;
    38.7 -import java.util.LinkedList;
    38.8 -
    38.9 -import org.xenoserver.control.CommandFailedException;
   38.10 -import org.xenoserver.control.Defaults;
   38.11 -import org.xenoserver.control.Extent;
   38.12 -import org.xenoserver.control.Library;
   38.13 -import org.xenoserver.control.Settings;
   38.14 -import org.xenoserver.control.VirtualDisk;
   38.15 -import org.xenoserver.control.VirtualDiskManager;
   38.16 -
   38.17 -public class ParseVdFree extends CommandParser {
   38.18 -    public void parse(Defaults d, LinkedList args)
   38.19 -        throws ParseFailedException, CommandFailedException {
   38.20 -        boolean verbose = getFlagParameter(args, 'v');
   38.21 -
   38.22 -        loadState();
   38.23 -        VirtualDisk free = VirtualDiskManager.IT.getFreeDisk();
   38.24 -        System.out.println(
   38.25 -            "Free disk has "
   38.26 -                + free.getExtentCount()
   38.27 -                + " extents totalling "
   38.28 -                + Library.formatSize(
   38.29 -                    free.getSize() * Settings.SECTOR_SIZE,
   38.30 -                    8,
   38.31 -                    true));
   38.32 -        if (verbose) {
   38.33 -            Iterator i = free.extents();
   38.34 -            System.out.println("  disk       offset         size");
   38.35 -            while (i.hasNext()) {
   38.36 -                Extent e = (Extent) i.next();
   38.37 -                System.out.println(
   38.38 -                    Library.format(e.getDisk(), 6, false)
   38.39 -                        + " "
   38.40 -                        + Library.format(e.getOffset(), 12, false)
   38.41 -                        + " "
   38.42 -                        + Library.format(e.getSize(), 12, false));
   38.43 -            }
   38.44 -        }
   38.45 -    }
   38.46 -
   38.47 -    public String getName() {
   38.48 -        return "free";
   38.49 -    }
   38.50 -
   38.51 -    public String getUsage() {
   38.52 -        return "[-v]";
   38.53 -    }
   38.54 -
   38.55 -    public String getHelpText() {
   38.56 -        return "Show free space allocated to virtual disk manager. -v enables verbose output.";
   38.57 -    }
   38.58 -}
    39.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdRefresh.java	Fri Nov 21 12:05:32 2003 +0000
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,53 +0,0 @@
    39.4 -package org.xenoserver.cmdline;
    39.5 -
    39.6 -import java.text.DateFormat;
    39.7 -import java.text.ParseException;
    39.8 -import java.util.Date;
    39.9 -import java.util.LinkedList;
   39.10 -
   39.11 -import org.xenoserver.control.CommandFailedException;
   39.12 -import org.xenoserver.control.CommandVdRefresh;
   39.13 -import org.xenoserver.control.Defaults;
   39.14 -
   39.15 -public class ParseVdRefresh extends CommandParser {
   39.16 -    public void parse(Defaults d, LinkedList args)
   39.17 -        throws ParseFailedException, CommandFailedException {
   39.18 -        String vd_key = getStringParameter(args, 'k', "");
   39.19 -        String expiry_s = getStringParameter(args, 'e', "");
   39.20 -        Date expiry;
   39.21 -
   39.22 -        if (vd_key.equals("")) {
   39.23 -            throw new ParseFailedException("Expected -k<key>");
   39.24 -        }
   39.25 -        if (expiry_s.equals("")) {
   39.26 -            expiry = null;
   39.27 -        } else {
   39.28 -            DateFormat format = DateFormat.getDateTimeInstance();
   39.29 -            try {
   39.30 -                expiry = format.parse(expiry_s);
   39.31 -            } catch (ParseException e) {
   39.32 -                throw new ParseFailedException("Could not parse date");
   39.33 -            }
   39.34 -        }
   39.35 -
   39.36 -        loadState();
   39.37 -        String output = new CommandVdRefresh(vd_key, expiry).execute();
   39.38 -        if (output != null) {
   39.39 -            System.out.println(output);
   39.40 -        }
   39.41 -        saveState();
   39.42 -    }
   39.43 -
   39.44 -    public String getName() {
   39.45 -        return "refresh";
   39.46 -    }
   39.47 -
   39.48 -    public String getUsage() {
   39.49 -        return "-k<key> [-e<expiry>]";
   39.50 -    }
   39.51 -
   39.52 -    public String getHelpText() {
   39.53 -        return "Refresh the expiry for the specified virtual disk. Omitting -e will cause the disk to never expire.";
   39.54 -    }
   39.55 -
   39.56 -}
    40.1 --- a/tools/control/src/org/xenoserver/cmdline/ParseVdShow.java	Fri Nov 21 12:05:32 2003 +0000
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,70 +0,0 @@
    40.4 -package org.xenoserver.cmdline;
    40.5 -
    40.6 -import java.util.Iterator;
    40.7 -import java.util.LinkedList;
    40.8 -
    40.9 -import org.xenoserver.control.CommandFailedException;
   40.10 -import org.xenoserver.control.Defaults;
   40.11 -import org.xenoserver.control.Extent;
   40.12 -import org.xenoserver.control.Library;
   40.13 -import org.xenoserver.control.Settings;
   40.14 -import org.xenoserver.control.VirtualDisk;
   40.15 -import org.xenoserver.control.VirtualDiskManager;
   40.16 -
   40.17 -public class ParseVdShow extends CommandParser {
   40.18 -  public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
   40.19 -    String key = getStringParameter(args,'k',"");
   40.20 -    
   40.21 -    loadState();
   40.22 -    
   40.23 -    if ( key.equals("") ) {
   40.24 -      System.out.println("key        expiry                       name                 size");
   40.25 -      Iterator i = VirtualDiskManager.IT.getVirtualDisks();
   40.26 -      while ( i.hasNext() ) {
   40.27 -        VirtualDisk vd = (VirtualDisk) i.next();
   40.28 -        System.out.print( vd.getKey() + " " );
   40.29 -        if ( vd.getExpiry() != null ) {
   40.30 -          System.out.print( vd.getExpiry().toString() );
   40.31 -        } else {
   40.32 -          System.out.print( "                            " );
   40.33 -        }
   40.34 -        System.out.println( " " + Library.format(vd.getName(),16,true) + " "
   40.35 -                          + Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) );
   40.36 -      }
   40.37 -    } else {
   40.38 -      VirtualDisk vd = VirtualDiskManager.IT.getVirtualDisk(key);
   40.39 -      if ( vd == null ) {
   40.40 -        throw new CommandFailedException("There is no virtual disk " + key );
   40.41 -      }
   40.42 -        
   40.43 -      System.out.println("  name: " + vd.getName());
   40.44 -      System.out.println("   key: " + vd.getKey());
   40.45 -      System.out.println("  size: " + Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,true));
   40.46 -      if ( vd.getExpiry() != null ) {
   40.47 -        System.out.println("expiry: " + vd.getExpiry());
   40.48 -      }
   40.49 -      System.out.println();
   40.50 - 
   40.51 -      Iterator i = vd.extents();
   40.52 -      System.out.println("  disk       offset         size");
   40.53 -      while (i.hasNext()) {
   40.54 -        Extent e = (Extent) i.next();
   40.55 -        System.out.println( Library.format(e.getDisk(), 6, false) + " "
   40.56 -                          + Library.format(e.getOffset(), 12, false) + " "
   40.57 -                          + Library.format(e.getSize(), 12, false) );
   40.58 -      }
   40.59 -    }
   40.60 -  }
   40.61 -
   40.62 -  public String getName() {
   40.63 -    return "show";
   40.64 -  }
   40.65 -
   40.66 -  public String getUsage() {
   40.67 -    return "[-k<key>]";
   40.68 -  }
   40.69 -
   40.70 -  public String getHelpText() {
   40.71 -    return "Show a summary of all virtual disks, or details of one disk if -k is given";
   40.72 -  }
   40.73 -}
    41.1 --- a/tools/control/src/org/xenoserver/control/Command.java	Fri Nov 21 12:05:32 2003 +0000
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,44 +0,0 @@
    41.4 -package org.xenoserver.control;
    41.5 -
    41.6 -/**
    41.7 - * Subclasses of Command are responsible for applying changes to domain
    41.8 - * and virtual disk settings.
    41.9 - */
   41.10 -public abstract class Command {
   41.11 -    /**
   41.12 -     * Subclasses should define an execute method which will apply the
   41.13 -     * relevant change, if possible.
   41.14 -     * 
   41.15 -     * @return The results of executing the command, if successful, or null if
   41.16 -     *         the command does not need to return results.
   41.17 -     * @throws CommandFailedException if the command could not be completed.
   41.18 -     */
   41.19 -    public abstract String execute() throws CommandFailedException;
   41.20 -    
   41.21 -    /**
   41.22 -     * Wraps execute() suitable for the web interface: all exceptions are
   41.23 -     * converted into output strings.
   41.24 -     * @return Output string, whether command succeeded or not.
   41.25 -     */
   41.26 -    public String executeWeb() {
   41.27 -        try {
   41.28 -            return execute();
   41.29 -        } catch (CommandFailedException e) {
   41.30 -            return e.getMessage();
   41.31 -        }
   41.32 -    }
   41.33 -
   41.34 -    /**
   41.35 -     * Construct a string to report the execution of a command.
   41.36 -     * @param cmd_array The array of command parameters.
   41.37 -     * @return The report string.
   41.38 -     */
   41.39 -    protected String reportCommand(String[] cmd_array) {
   41.40 -        StringBuffer sb = new StringBuffer();
   41.41 -        int i;
   41.42 -        for (i = 0; i < cmd_array.length; i++) {
   41.43 -            sb.append(cmd_array[i] + " ");
   41.44 -        }
   41.45 -        return sb.toString();
   41.46 -    }
   41.47 -}
    42.1 --- a/tools/control/src/org/xenoserver/control/CommandDomainDestroy.java	Fri Nov 21 12:05:32 2003 +0000
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,68 +0,0 @@
    42.4 -package org.xenoserver.control;
    42.5 -
    42.6 -/**
    42.7 - * Destroys a domain.
    42.8 - */
    42.9 -public class CommandDomainDestroy extends Command {
   42.10 -    /** Defaults instance in use. */
   42.11 -    private Defaults d;
   42.12 -    /** Domain ID to destroy. */
   42.13 -    private int domain_id;
   42.14 -    /** Force destruction? */
   42.15 -    private boolean force;
   42.16 -
   42.17 -    /**
   42.18 -     * Constructor for CommandDomainDestroy.
   42.19 -     * 
   42.20 -     * @param d Defaults object to use.
   42.21 -     * @param domain_id Domain ID number to destroy.
   42.22 -     * @param force Force destruction.
   42.23 -     */
   42.24 -    public CommandDomainDestroy(Defaults d, int domain_id, boolean force) {
   42.25 -        this.d = d;
   42.26 -        this.domain_id = domain_id;
   42.27 -        this.force = force;
   42.28 -    }
   42.29 -
   42.30 -    /**
   42.31 -     * @see org.xenoserver.control.Command#execute()
   42.32 -     */
   42.33 -    public String execute() throws CommandFailedException {
   42.34 -        Runtime r = Runtime.getRuntime();
   42.35 -        String output = null;
   42.36 -
   42.37 -        try {
   42.38 -            Process destroy_p;
   42.39 -            String destroy_cmdarray[] = force ? new String[3] : new String[2];
   42.40 -            int destroy_rc;
   42.41 -            int idx = 0;
   42.42 -            destroy_cmdarray[idx++] = d.xiToolsDir + "xi_destroy";
   42.43 -            if (force) {
   42.44 -                destroy_cmdarray[idx++] = "-f";
   42.45 -            }
   42.46 -            destroy_cmdarray[idx++] = "" + domain_id;
   42.47 -
   42.48 -            if (Settings.TEST) {
   42.49 -                output = reportCommand(destroy_cmdarray);
   42.50 -            } else {
   42.51 -                destroy_p = r.exec(destroy_cmdarray);
   42.52 -                destroy_rc = destroy_p.waitFor();
   42.53 -
   42.54 -                if (destroy_rc != 0) {
   42.55 -                    throw CommandFailedException.xiCommandFailed(
   42.56 -                        "Could not destroy domain",
   42.57 -                        destroy_cmdarray);
   42.58 -                }
   42.59 -                output = "Destroyed domain " + domain_id;
   42.60 -            }
   42.61 -        } catch (CommandFailedException e) {
   42.62 -            throw e;
   42.63 -        } catch (Exception e) {
   42.64 -            throw new CommandFailedException(
   42.65 -                "Could not destroy domain (" + e + ")",
   42.66 -                e);
   42.67 -        }
   42.68 -
   42.69 -        return output;
   42.70 -    }
   42.71 -}
    43.1 --- a/tools/control/src/org/xenoserver/control/CommandDomainList.java	Fri Nov 21 12:05:32 2003 +0000
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,121 +0,0 @@
    43.4 -package org.xenoserver.control;
    43.5 -
    43.6 -import java.io.BufferedReader;
    43.7 -import java.io.InputStreamReader;
    43.8 -import java.util.StringTokenizer;
    43.9 -import java.util.Vector;
   43.10 -
   43.11 -/**
   43.12 - * Lists details of all domains. After execute() has been called, call
   43.13 - * domains() to get the array of domains.
   43.14 - */
   43.15 -public class CommandDomainList extends Command {
   43.16 -    /** Defaults instance in use. */
   43.17 -    private Defaults d;
   43.18 -    /** Array of domains returned. */
   43.19 -    private Domain[] array;
   43.20 -    
   43.21 -    /**
   43.22 -    * Constructor for CommandDomainList.
   43.23 -    * @param d Defaults object to use.
   43.24 -    */
   43.25 -    public CommandDomainList(Defaults d) {
   43.26 -        this.d = d;
   43.27 -    }
   43.28 -
   43.29 -    /**
   43.30 -     * Retrieves the list of domains.
   43.31 -     * @return null, call domains() to get the list.
   43.32 -     * @throws CommandFailedException if the list could not be retrieved.
   43.33 -     */
   43.34 -    public String execute() throws CommandFailedException {
   43.35 -        Runtime r = Runtime.getRuntime();
   43.36 -        Vector v = new Vector();
   43.37 -        String outline;
   43.38 -        BufferedReader in;
   43.39 -        String output = null;
   43.40 -
   43.41 -        try {
   43.42 -            Process start_p;
   43.43 -            String start_cmdarray[] = new String[1];
   43.44 -            int start_rc;
   43.45 -            start_cmdarray[0] = d.xiToolsDir + "xi_list";
   43.46 -
   43.47 -            if (Settings.TEST) {
   43.48 -                output = reportCommand(start_cmdarray);
   43.49 -            } else {
   43.50 -                start_p = r.exec(start_cmdarray);
   43.51 -                start_rc = start_p.waitFor();
   43.52 -                if (start_rc != 0) {
   43.53 -                    throw CommandFailedException.xiCommandFailed(
   43.54 -                        "Could not get domain list",
   43.55 -                        start_cmdarray);
   43.56 -                }
   43.57 -
   43.58 -                in =
   43.59 -                    new BufferedReader(
   43.60 -                        new InputStreamReader(start_p.getInputStream()));
   43.61 -
   43.62 -                outline = in.readLine();
   43.63 -                while (outline != null) {
   43.64 -                    Domain domain = new Domain();
   43.65 -
   43.66 -                    StringTokenizer st = new StringTokenizer(outline);
   43.67 -                    if (st.hasMoreTokens()) {
   43.68 -                        domain.id = Integer.parseInt(st.nextToken());
   43.69 -                    }
   43.70 -                    if (st.hasMoreTokens()) {
   43.71 -                        domain.processor = Integer.parseInt(st.nextToken());
   43.72 -                    }
   43.73 -                    if (st.hasMoreTokens()) {
   43.74 -                        if (st.nextToken().equals("1")) {
   43.75 -                            domain.cpu = true;
   43.76 -                        } else {
   43.77 -                            domain.cpu = false;
   43.78 -                        }
   43.79 -                    }
   43.80 -                    if (st.hasMoreTokens()) {
   43.81 -                        domain.nstate = Integer.parseInt(st.nextToken());
   43.82 -                    }
   43.83 -                    if (st.hasMoreTokens()) {
   43.84 -                        domain.state = st.nextToken().toLowerCase();
   43.85 -                    }
   43.86 -                    if (st.hasMoreTokens()) {
   43.87 -                        domain.ev = Integer.parseInt(st.nextToken());
   43.88 -                    }
   43.89 -                    if (st.hasMoreTokens()) {
   43.90 -                        domain.mcu = Integer.parseInt(st.nextToken());
   43.91 -                    }
   43.92 -                    if (st.hasMoreTokens()) {
   43.93 -                        domain.pages = Integer.parseInt(st.nextToken());
   43.94 -                    }
   43.95 -                    if (st.hasMoreTokens()) {
   43.96 -                        domain.name = st.nextToken();
   43.97 -                    }
   43.98 -
   43.99 -                    v.add(domain);
  43.100 -
  43.101 -                    outline = in.readLine();
  43.102 -                }
  43.103 -
  43.104 -            }
  43.105 -        } catch (CommandFailedException e) {
  43.106 -            throw e;
  43.107 -        } catch (Exception e) {
  43.108 -            throw new CommandFailedException(
  43.109 -                "Could not get domain list(" + e + ")",
  43.110 -                e);
  43.111 -        }
  43.112 -
  43.113 -        array = new Domain[v.size()];
  43.114 -        v.toArray(array);
  43.115 -        return output;
  43.116 -    }
  43.117 -
  43.118 -    /**
  43.119 -     * @return Array of domains.
  43.120 -     */
  43.121 -    public Domain[] domains() {
  43.122 -        return array;
  43.123 -    }
  43.124 -}
    44.1 --- a/tools/control/src/org/xenoserver/control/CommandDomainNew.java	Fri Nov 21 12:05:32 2003 +0000
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,413 +0,0 @@
    44.4 -package org.xenoserver.control;
    44.5 -
    44.6 -import java.io.BufferedReader;
    44.7 -import java.io.File;
    44.8 -import java.io.FileInputStream;
    44.9 -import java.io.FileOutputStream;
   44.10 -import java.io.IOException;
   44.11 -import java.io.InputStreamReader;
   44.12 -import java.lang.NumberFormatException;
   44.13 -import java.net.InetAddress;
   44.14 -import java.net.UnknownHostException;
   44.15 -import java.util.zip.GZIPInputStream;
   44.16 -
   44.17 -/**
   44.18 - * Creates a new domain. As this command returns a multi-line result,
   44.19 - * call output() to get an array of strings.
   44.20 - */
   44.21 -public class CommandDomainNew extends Command {
   44.22 -    /** Defaults instance in use. */
   44.23 -    private Defaults d;
   44.24 -    /** Name of new domain. */
   44.25 -    private String name;
   44.26 -    /** Memory size for new domain. */
   44.27 -    private int size;
   44.28 -    /** Kernel image */
   44.29 -    private String image;
   44.30 -    /** Initial ramdisk */
   44.31 -    private String initrd;
   44.32 -    /** Num of virtual interfaces */
   44.33 -    private int vifs;
   44.34 -    /** Boot arguments */
   44.35 -    private String bargs;
   44.36 -    /** Root device */
   44.37 -    private String root_dev;
   44.38 -    /** Root mount args */
   44.39 -    private String root_args;
   44.40 -    /** Usr device */
   44.41 -    private String usr_dev;
   44.42 -    /** NFS root path */
   44.43 -    private String nfs_root_path;
   44.44 -    /** IP address */
   44.45 -    private String nw_ip;
   44.46 -    /** Gateway */
   44.47 -    private String nw_gw;
   44.48 -    /** netmask */
   44.49 -    private String nw_mask;
   44.50 -    /** NFS server */
   44.51 -    private String nw_nfs_server;
   44.52 -    /** Hostname */
   44.53 -    private String nw_host;
   44.54 -    /** Output from domain creation */
   44.55 -    private String[] output;
   44.56 -    /** Domain ID created. */
   44.57 -    private int domain_id;
   44.58 -    /** Number to substitute for + (-1 => use domain_id) */
   44.59 -    private int subst;
   44.60 -
   44.61 -    /**
   44.62 -     * @return Output from domain creation.
   44.63 -     */
   44.64 -    public String[] output() {
   44.65 -        return output;
   44.66 -    }
   44.67 -    
   44.68 -    /**
   44.69 -     * @return The domain id this command created.
   44.70 -     */
   44.71 -    public int domain_id() {
   44.72 -        return domain_id;
   44.73 -    }
   44.74 -
   44.75 -    /**
   44.76 -     * Constructor for CommandDomainNew.
   44.77 -     * @param d Defaults object to use.
   44.78 -     * @param name Name for the domain.
   44.79 -     * @param size Memory size for the domain.
   44.80 -     * @param image Image to boot domain from.
   44.81 -     * @param initrd Initrd to boot domain with.
   44.82 -     * @param vifs Number of virtual interfaces for the domain.
   44.83 -     * @param bargs Boot arguments for the domain.
   44.84 -     * @param root_dev Root device for the domain.
   44.85 -     * @param nfs_root_path NFS root to be used by the domain.
   44.86 -     * @param nw_ip IP address pattern to use for the domain's interfaces.
   44.87 -     * @param nw_gw Gateway to configure the domain for.
   44.88 -     * @param nw_mask Network mask to configure the domain for.
   44.89 -     * @param nw_nfs_server NFS server to be used by the domain.
   44.90 -     * @param nw_host Hostname to be used by the domain.
   44.91 -     */
   44.92 -    public CommandDomainNew(
   44.93 -        Defaults d,
   44.94 -        String name,
   44.95 -        int size,
   44.96 -        String image,
   44.97 -        String initrd,
   44.98 -        int vifs,
   44.99 -        String bargs,
  44.100 -        String root_dev,
  44.101 -        String root_args,
  44.102 -        String nfs_root_path,
  44.103 -        String nw_ip,
  44.104 -        String nw_gw,
  44.105 -        String nw_mask,
  44.106 -        String nw_nfs_server,
  44.107 -        String nw_host,
  44.108 -	int subst) {
  44.109 -        this(d,name,size,image,initrd,vifs,bargs,root_dev,root_args,nfs_root_path,nw_ip,nw_gw,nw_mask,nw_nfs_server,nw_host,null,subst);
  44.110 -    }
  44.111 -    
  44.112 -    public CommandDomainNew(
  44.113 -        Defaults d,
  44.114 -        String name,
  44.115 -        int size,
  44.116 -        String image,
  44.117 -        String initrd,
  44.118 -        int vifs,
  44.119 -        String bargs,
  44.120 -        String root_dev,
  44.121 -        String root_args,
  44.122 -        String nfs_root_path,
  44.123 -        String nw_ip,
  44.124 -        String nw_gw,
  44.125 -        String nw_mask,
  44.126 -        String nw_nfs_server,
  44.127 -        String nw_host,
  44.128 -        String usr_dev,
  44.129 -	int subst) {
  44.130 -            this.d = d;
  44.131 -            this.name = name;
  44.132 -            this.size = size;
  44.133 -            this.image = image;
  44.134 -            this.initrd = initrd;
  44.135 -            this.vifs = vifs;
  44.136 -            this.bargs = bargs;
  44.137 -            this.root_dev = root_dev;
  44.138 -            this.root_args = root_args;
  44.139 -            this.nfs_root_path = nfs_root_path;
  44.140 -            this.nw_ip = nw_ip;
  44.141 -            this.nw_gw = nw_gw;
  44.142 -            this.nw_mask = nw_mask;
  44.143 -            this.nw_nfs_server = nw_nfs_server;
  44.144 -            this.nw_host = nw_host;
  44.145 -            this.usr_dev = usr_dev;
  44.146 -	    this.subst = subst;
  44.147 -    }
  44.148 -
  44.149 -    /**
  44.150 -     * @see org.xenoserver.control.Command#execute()
  44.151 -     */
  44.152 -    public String execute() throws CommandFailedException {
  44.153 -        Runtime r = Runtime.getRuntime();
  44.154 -        int domain_id = -1;
  44.155 -        BufferedReader br;
  44.156 -        int idx;
  44.157 -        int i;
  44.158 -        File image_tmp = null;
  44.159 -        File initrd_tmp = null;
  44.160 -        String domain_ip = "";
  44.161 -
  44.162 -        String create_cmdarray[] = new String[3];
  44.163 -        String build_cmdarray[] = new String[6];
  44.164 -        String vifinit_cmdarray[] = new String[4];
  44.165 -
  44.166 -        try {
  44.167 -            try {
  44.168 -                /* Some initial sanity checks */
  44.169 -                if (root_dev.equals("/dev/nfs") && (vifs == 0)) {
  44.170 -                    throw new CommandFailedException("Cannot use NFS root without VIFs configured");
  44.171 -                }
  44.172 -
  44.173 -                /* Uncompress the image and initrd */
  44.174 -                if (image.endsWith(".gz")) {
  44.175 -                    image_tmp = getUncompressed("xen-image-", image);
  44.176 -                    image = image_tmp.getPath();
  44.177 -                }
  44.178 -
  44.179 -                if (initrd != null && initrd.endsWith(".gz")) {
  44.180 -                    initrd_tmp = getUncompressed("xen-initrd-", initrd);
  44.181 -                    initrd = initrd_tmp.getPath();
  44.182 -                }
  44.183 -
  44.184 -                /* Create a new empty domain */
  44.185 -                Process create_p;
  44.186 -                int create_rc;
  44.187 -                create_cmdarray[0] = d.xiToolsDir + "xi_create";
  44.188 -                create_cmdarray[1] = "" + size;
  44.189 -                create_cmdarray[2] = name;
  44.190 -                if (Settings.TEST) {
  44.191 -                    reportCommand(create_cmdarray);
  44.192 -                    domain_id = 1;
  44.193 -                    create_rc = 0;
  44.194 -                } else {
  44.195 -                    create_p = r.exec(create_cmdarray);
  44.196 -                    br =
  44.197 -                        new BufferedReader(
  44.198 -                            new InputStreamReader(create_p.getInputStream()));
  44.199 -		    try
  44.200 -		      {
  44.201 -			domain_id = Integer.parseInt(br.readLine());
  44.202 -		      }
  44.203 -		    catch (NumberFormatException nfe) 
  44.204 -		      {
  44.205 -			domain_id = -1;
  44.206 -		      }
  44.207 -                    create_rc = create_p.waitFor();
  44.208 -                }
  44.209 -		d.domainNumber = domain_id;
  44.210 -
  44.211 -                if (create_rc != 0) {
  44.212 -                    throw CommandFailedException.xiCommandFailed(
  44.213 -                        "Failed to create domain",
  44.214 -                        create_cmdarray);
  44.215 -                } else if (domain_id > d.maxDomainNumber) {
  44.216 -                    throw new CommandFailedException(
  44.217 -                        "Cannot configure more than "
  44.218 -                            + d.maxDomainNumber
  44.219 -                            + " domains");
  44.220 -                }
  44.221 -
  44.222 -		if (subst == -1) subst = domain_id;
  44.223 -
  44.224 -                /* Set up boot parameters to pass to xi_build. */
  44.225 -		bargs = StringPattern.parse(bargs).resolve(subst) + " ";
  44.226 -                if (root_dev.equals("/dev/nfs")) {
  44.227 -                    if (vifs == 0) {
  44.228 -                        throw new CommandFailedException("Cannot use NFS root without VIFs configured");
  44.229 -                    }
  44.230 -                    if (nfs_root_path == null) {
  44.231 -                        throw new CommandFailedException("No NFS root specified");
  44.232 -                    }
  44.233 -                    if (nw_nfs_server == null) {
  44.234 -                        throw new CommandFailedException("No NFS server specified");
  44.235 -                    }
  44.236 -                    bargs =
  44.237 -                        (bargs
  44.238 -                            + " root=/dev/nfs " + StringPattern.parse(root_args).resolve(subst) + " " 
  44.239 -                            + "nfsroot="
  44.240 -                            + StringPattern.parse(nfs_root_path).resolve(
  44.241 -                                subst)
  44.242 -                            + " ");
  44.243 -                } else {
  44.244 -                    bargs =
  44.245 -                        (bargs
  44.246 -                            + " root="
  44.247 -                            + StringPattern.parse(root_dev).resolve(subst)
  44.248 -                            + " " + StringPattern.parse(root_args).resolve(subst) + " ");
  44.249 -
  44.250 -                }
  44.251 -                
  44.252 -                if (usr_dev != null && !usr_dev.equals("")) {
  44.253 -                    bargs = bargs + " usr=" + StringPattern.parse(usr_dev).resolve(subst) + " ";
  44.254 -                }
  44.255 -
  44.256 -                if (vifs > 0) {
  44.257 -                    domain_ip =
  44.258 -                        InetAddressPattern.parse(nw_ip).resolve(subst);
  44.259 -                 /*   if (nw_host == null) {
  44.260 -                        try {
  44.261 -                            nw_host =
  44.262 -                                InetAddress.getByName(domain_ip).getHostName();
  44.263 -                        } catch (UnknownHostException uhe) {
  44.264 -                            nw_host = "" + nw_ip;
  44.265 -                        }
  44.266 -
  44.267 -                    }*/
  44.268 -                    bargs =
  44.269 -                        ("ip="
  44.270 -                            + domain_ip
  44.271 -                            + ":"
  44.272 -                            + ((nw_nfs_server == null || nw_nfs_server.equals(""))
  44.273 -                                ? ""
  44.274 -                                : (InetAddressPattern
  44.275 -                                    .parse(nw_nfs_server)
  44.276 -                                    .resolve(subst)))
  44.277 -                            + ":"
  44.278 -                            + ((nw_gw == null || nw_gw.equals(""))
  44.279 -                                ? ""
  44.280 -                                : (InetAddressPattern
  44.281 -                                    .parse(nw_gw)
  44.282 -                                    .resolve(subst)))
  44.283 -                            + ":"
  44.284 -                            + ((nw_mask == null || nw_mask.equals(""))
  44.285 -                                ? ""
  44.286 -                                : InetAddressPattern.parse(nw_mask).resolve(
  44.287 -                                    subst))
  44.288 -                            + ":"
  44.289 -                            + ((nw_host == null) ? "" : nw_host)
  44.290 -                            + ":eth0:off "
  44.291 -                            + bargs);
  44.292 -                }
  44.293 -
  44.294 -                /* Build the domain */
  44.295 -                Process build_p;
  44.296 -                int build_rc;
  44.297 -                idx = 0;
  44.298 -                for (i = 0; i < build_cmdarray.length; i++) {
  44.299 -                    build_cmdarray[i] = "";
  44.300 -                }
  44.301 -                build_cmdarray[idx++] = d.xiToolsDir + "xi_build";
  44.302 -                build_cmdarray[idx++] = "" + domain_id;
  44.303 -                build_cmdarray[idx++] = "" + image;
  44.304 -                build_cmdarray[idx++] = "" + vifs;
  44.305 -                if (initrd != null) {
  44.306 -                    build_cmdarray[idx++] = "initrd=" + initrd;
  44.307 -                }
  44.308 -                build_cmdarray[idx++] = "" + bargs;
  44.309 -                if (Settings.TEST) {
  44.310 -                    reportCommand(build_cmdarray);
  44.311 -                    build_rc = 0;
  44.312 -                } else {
  44.313 -                    build_p = r.exec(build_cmdarray);
  44.314 -                    build_rc = build_p.waitFor();
  44.315 -                }
  44.316 -
  44.317 -                if (build_rc != 0) {
  44.318 -                    throw CommandFailedException.xiCommandFailed(
  44.319 -                        "Failed to build domain",
  44.320 -                        build_cmdarray);
  44.321 -                }
  44.322 -
  44.323 -                /* Set up the first VIF if necessary */
  44.324 -                if (vifs > 0) {
  44.325 -                    Process vifinit_p;
  44.326 -                    int vifinit_rc;
  44.327 -                    vifinit_cmdarray[0] = d.xiToolsDir + "xi_vifinit";
  44.328 -                    vifinit_cmdarray[1] = "" + domain_id;
  44.329 -                    vifinit_cmdarray[2] = "0";
  44.330 -                    vifinit_cmdarray[3] = domain_ip;
  44.331 -                    if (Settings.TEST) {
  44.332 -                        reportCommand(vifinit_cmdarray);
  44.333 -                        vifinit_rc = 0;
  44.334 -                    } else {
  44.335 -                        vifinit_p = r.exec(vifinit_cmdarray);
  44.336 -                        vifinit_rc = vifinit_p.waitFor();
  44.337 -                    }
  44.338 -
  44.339 -                    if (vifinit_rc != 0) {
  44.340 -                        throw CommandFailedException.xiCommandFailed(
  44.341 -                            "Failed to initialise VIF 0",
  44.342 -                            vifinit_cmdarray);
  44.343 -                    }
  44.344 -                }
  44.345 -            } finally {
  44.346 -                if (image_tmp != null) {
  44.347 -                    image_tmp.delete();
  44.348 -                }
  44.349 -                if (initrd_tmp != null) {
  44.350 -                    initrd_tmp.delete();
  44.351 -                }
  44.352 -            }
  44.353 -        } catch (CommandFailedException e) {
  44.354 -            throw e;
  44.355 -        } catch (Exception e) {
  44.356 -					     e.printStackTrace();
  44.357 -            throw new CommandFailedException(
  44.358 -                "Could not create new domain (" + e + ")",
  44.359 -                e);
  44.360 -        }
  44.361 -
  44.362 -        output = new String[vifs > 0 ? 6 : 4];
  44.363 -        output[0] = "Domain created with arguments:";
  44.364 -        output[1] = "";
  44.365 -        for (i = 0; i < create_cmdarray.length; i++) {
  44.366 -            output[1] += create_cmdarray[i] + " ";
  44.367 -        }
  44.368 -        output[2] = "Domain built with arguments:";
  44.369 -        output[3] = "";
  44.370 -        for (i = 0; i < build_cmdarray.length; i++) {
  44.371 -            output[3] += build_cmdarray[i] + " ";
  44.372 -        }
  44.373 -        if (vifs > 0) {
  44.374 -            output[4] = "VIF 0 initialized with arguments:";
  44.375 -            output[5] = "";
  44.376 -            for (i = 0; i < vifinit_cmdarray.length; i++) {
  44.377 -                output[5] += vifinit_cmdarray[i] + " ";
  44.378 -            }
  44.379 -        }
  44.380 -        
  44.381 -        this.domain_id = domain_id;
  44.382 -
  44.383 -        return null;
  44.384 -    }
  44.385 -
  44.386 -    /**
  44.387 -     * Get uncompressed version of file.
  44.388 -     * @param prefix Temp file prefix.
  44.389 -     * @param original Original filename.
  44.390 -     * @return Uncompressed file.
  44.391 -     * @throws IOException if decompression failed.
  44.392 -     */
  44.393 -    private File getUncompressed(String prefix, String original)
  44.394 -        throws IOException {
  44.395 -        FileOutputStream fos;
  44.396 -        GZIPInputStream gis;
  44.397 -        File result;
  44.398 -        byte buffer[] = new byte[1024];
  44.399 -        int l;
  44.400 -
  44.401 -        result = File.createTempFile(prefix, null);
  44.402 -
  44.403 -        try {
  44.404 -            fos = new FileOutputStream(result);
  44.405 -            gis = new GZIPInputStream(new FileInputStream(original));
  44.406 -            while ((l = gis.read(buffer, 0, buffer.length)) != -1) {
  44.407 -                fos.write(buffer, 0, l);
  44.408 -            }
  44.409 -        } catch (IOException ioe) {
  44.410 -            result.delete();
  44.411 -            throw ioe;
  44.412 -        }
  44.413 -
  44.414 -        return result;
  44.415 -    }
  44.416 -}
    45.1 --- a/tools/control/src/org/xenoserver/control/CommandDomainStart.java	Fri Nov 21 12:05:32 2003 +0000
    45.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.3 @@ -1,58 +0,0 @@
    45.4 -package org.xenoserver.control;
    45.5 -
    45.6 -/**
    45.7 - * Starts a domain.
    45.8 - */
    45.9 -public class CommandDomainStart extends Command {
   45.10 -    /** Defaults instance in use. */
   45.11 -    private Defaults d;
   45.12 -    /** Domain ID to start */
   45.13 -    private int domain_id;
   45.14 -    
   45.15 -    /**
   45.16 -    * Constructor for CommandDomainStart.
   45.17 -    * @param d Defaults object to use.
   45.18 -    * @param domain_id Domain to start.
   45.19 -    */
   45.20 -    public CommandDomainStart(Defaults d, int domain_id) {
   45.21 -        this.d = d;
   45.22 -        this.domain_id = domain_id;
   45.23 -    }
   45.24 -
   45.25 -    /**
   45.26 -     * @see org.xenoserver.control.Command#execute()
   45.27 -     */
   45.28 -    public String execute() throws CommandFailedException {
   45.29 -        Runtime r = Runtime.getRuntime();
   45.30 -        String output = null;
   45.31 -
   45.32 -        try {
   45.33 -            Process start_p;
   45.34 -            String start_cmdarray[] = new String[2];
   45.35 -            int start_rc;
   45.36 -            start_cmdarray[0] = d.xiToolsDir + "xi_start";
   45.37 -            start_cmdarray[1] = "" + domain_id;
   45.38 -
   45.39 -            if (Settings.TEST) {
   45.40 -                output = reportCommand(start_cmdarray);
   45.41 -            } else {
   45.42 -                start_p = r.exec(start_cmdarray);
   45.43 -                start_rc = start_p.waitFor();
   45.44 -                if (start_rc != 0) {
   45.45 -                    throw CommandFailedException.xiCommandFailed(
   45.46 -                        "Could not start domain",
   45.47 -                        start_cmdarray);
   45.48 -                }
   45.49 -                output = "Started domain " + domain_id;
   45.50 -            }
   45.51 -        } catch (CommandFailedException e) {
   45.52 -            throw e;
   45.53 -        } catch (Exception e) {
   45.54 -            throw new CommandFailedException(
   45.55 -                "Could not start new domain (" + e + ")",
   45.56 -                e);
   45.57 -        }
   45.58 -
   45.59 -        return output;
   45.60 -    }
   45.61 -}
    46.1 --- a/tools/control/src/org/xenoserver/control/CommandDomainStop.java	Fri Nov 21 12:05:32 2003 +0000
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,59 +0,0 @@
    46.4 -package org.xenoserver.control;
    46.5 -
    46.6 -/**
    46.7 - * Stops a domain.
    46.8 - */
    46.9 -public class CommandDomainStop extends Command {
   46.10 -    /** Defaults instance in use */
   46.11 -    private Defaults d;
   46.12 -    /** Domain ID to stop */
   46.13 -    private int domain_id;
   46.14 -
   46.15 -    /**
   46.16 -     * Constructor for CommandDomainStop.
   46.17 -     * @param d The defaults object to use.
   46.18 -     * @param domain_id The domain to stop.
   46.19 -     */
   46.20 -    public CommandDomainStop(Defaults d, int domain_id) {
   46.21 -        this.d = d;
   46.22 -        this.domain_id = domain_id;
   46.23 -    }
   46.24 -
   46.25 -    /**
   46.26 -     * @see org.xenoserver.control.Command#execute()
   46.27 -     */
   46.28 -    public String execute() throws CommandFailedException {
   46.29 -        Runtime r = Runtime.getRuntime();
   46.30 -        String output = null;
   46.31 -
   46.32 -        try {
   46.33 -            Process stop_p;
   46.34 -            String stop_cmdarray[] = new String[2];
   46.35 -            int stop_rc;
   46.36 -            stop_cmdarray[0] = d.xiToolsDir + "xi_stop";
   46.37 -            stop_cmdarray[1] = "" + domain_id;
   46.38 -
   46.39 -            if (Settings.TEST) {
   46.40 -                output = reportCommand(stop_cmdarray);
   46.41 -            } else {
   46.42 -                stop_p = r.exec(stop_cmdarray);
   46.43 -                stop_rc = stop_p.waitFor();
   46.44 -
   46.45 -                if (stop_rc != 0) {
   46.46 -                    throw CommandFailedException.xiCommandFailed(
   46.47 -                        "Could not stop domain",
   46.48 -                        stop_cmdarray);
   46.49 -                }
   46.50 -                output = "Stopped domain " + domain_id;
   46.51 -            }
   46.52 -        } catch (CommandFailedException e) {
   46.53 -            throw e;
   46.54 -        } catch (Exception e) {
   46.55 -            throw new CommandFailedException(
   46.56 -                "Could not stop new domain (" + e + ")",
   46.57 -                e);
   46.58 -        }
   46.59 -
   46.60 -        return output;
   46.61 -    }
   46.62 -}
    47.1 --- a/tools/control/src/org/xenoserver/control/CommandFailedException.java	Fri Nov 21 12:05:32 2003 +0000
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,41 +0,0 @@
    47.4 -package org.xenoserver.control;
    47.5 -
    47.6 -/**
    47.7 - * Thrown to indicate that a command failed to execute.
    47.8 - */
    47.9 -public class CommandFailedException extends Exception {
   47.10 -    /**
   47.11 -     * Construct an exception with a message.
   47.12 -     * @param message Message to use.
   47.13 -     */
   47.14 -    public CommandFailedException(String message) {
   47.15 -        super(message);
   47.16 -    }
   47.17 -
   47.18 -    /**
   47.19 -     * Construct an exception with a message and cause.
   47.20 -     * @param message Message to use.
   47.21 -     * @param cause Throwable cause.
   47.22 -     */
   47.23 -    public CommandFailedException(String message, Throwable cause) {
   47.24 -        super(message, cause);
   47.25 -    }
   47.26 -
   47.27 -    /**
   47.28 -     * Construct an exception for an XI command failure.
   47.29 -     * @param message Message to use
   47.30 -     * @param cmd_array Command array used to invoke xi command
   47.31 -     * @return Suitable exception.
   47.32 -     */
   47.33 -    public static CommandFailedException xiCommandFailed(
   47.34 -        String message,
   47.35 -        String cmd_array[]) {
   47.36 -        StringBuffer sb = new StringBuffer();
   47.37 -        int i;
   47.38 -        sb.append(message + " using: ");
   47.39 -        for (i = 0; i < cmd_array.length; i++) {
   47.40 -            sb.append(cmd_array[i] + " ");
   47.41 -        }
   47.42 -        return new CommandFailedException(sb.toString());
   47.43 -    }
   47.44 -}
    48.1 --- a/tools/control/src/org/xenoserver/control/CommandPartitionAdd.java	Fri Nov 21 12:05:32 2003 +0000
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,49 +0,0 @@
    48.4 -package org.xenoserver.control;
    48.5 -
    48.6 -/**
    48.7 - * Add a disk partition to the VirtualDiskManager as a XenoPartition.
    48.8 - */
    48.9 -public class CommandPartitionAdd extends Command {
   48.10 -    /** True to force creation. */
   48.11 -    private boolean force;
   48.12 -    /** Partition to add as a XenoPartition. */
   48.13 -    private String partition_name;
   48.14 -    /** Chunk size to split partition into (in bytes). */
   48.15 -    private long chunksize;
   48.16 -
   48.17 -    /**
   48.18 -     * Constructor for CommandPartitionAdd.
   48.19 -     * @param partition_name Partition to add.
   48.20 -     * @param chunksize Chunk size to split partition into (in bytes).
   48.21 -     * @param force True to force creation.
   48.22 -     */
   48.23 -    public CommandPartitionAdd(String partition_name, long chunksize, boolean force) {
   48.24 -        this.partition_name = partition_name;
   48.25 -        this.chunksize = chunksize;
   48.26 -        this.force = force;
   48.27 -    }
   48.28 -
   48.29 -    /**
   48.30 -     * @see org.xenoserver.control.Command#execute()
   48.31 -     */
   48.32 -    public String execute() throws CommandFailedException {
   48.33 -        Partition p = PartitionManager.IT.getPartition(partition_name);
   48.34 -        if (p == null) {
   48.35 -            throw new CommandFailedException(
   48.36 -                "Partition " + partition_name + " does not exist.");
   48.37 -        }
   48.38 -        // Check if this partition belongs to the VDM
   48.39 -        if (p.isXeno() && !force) {
   48.40 -          throw new CommandFailedException("Refusing to add partition as it is already allocated to the virtual disk manager. Use -f if you are sure.");
   48.41 -        }
   48.42 -        
   48.43 -        long size = chunksize / Settings.SECTOR_SIZE;
   48.44 -        if ( chunksize <= 0 ) {
   48.45 -          throw new CommandFailedException("Chunk size is smaller than sector size.");
   48.46 -        }
   48.47 -    
   48.48 -        VirtualDiskManager.IT.addPartition(p, size);
   48.49 -        PartitionManager.IT.addXenoPartition(p);
   48.50 -        return "Added partition " + p.getName();
   48.51 -    }
   48.52 -}
    49.1 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalGrant.java	Fri Nov 21 12:05:32 2003 +0000
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,105 +0,0 @@
    49.4 -package org.xenoserver.control;
    49.5 -
    49.6 -/**
    49.7 - * Grant physical access to a partition for a given domain.
    49.8 - */
    49.9 -public class CommandPhysicalGrant extends Command {
   49.10 -    /** Defaults instance to use */
   49.11 -    private Defaults d;
   49.12 -    /** Domain ID to grant access for */ 
   49.13 -    private int domain_id;
   49.14 -    /** Partition to grant access to */
   49.15 -    private String partition_name;
   49.16 -    /** Access mode to grant */
   49.17 -    private Mode mode;
   49.18 -    /** True to force grant */
   49.19 -    private boolean force;
   49.20 -    /** Number to substitute for + (-1 => use domain_id) */
   49.21 -    private int subst;
   49.22 -
   49.23 -    /**
   49.24 -     * Constructor for CommandPhysicalGrant.
   49.25 -     * @param d Defaults object to use.
   49.26 -     * @param domain_id Domain to grant access for.
   49.27 -     * @param partition Partition to grant access to.
   49.28 -     * @param mode Access mode to grant.
   49.29 -     * @param force True to force grant
   49.30 -     */
   49.31 -    public CommandPhysicalGrant(
   49.32 -        Defaults d,
   49.33 -        int domain_id,
   49.34 -        String partition,
   49.35 -        Mode mode,
   49.36 -        boolean force,
   49.37 -	int subst) {
   49.38 -        this.d = d;
   49.39 -        this.domain_id = domain_id;
   49.40 -        this.partition_name = partition;
   49.41 -        this.mode = mode;
   49.42 -        this.force = force;
   49.43 -	this.subst = subst;
   49.44 -    }
   49.45 -
   49.46 -    /**
   49.47 -     * @see org.xenoserver.control.Command#execute()
   49.48 -     */
   49.49 -    public String execute() throws CommandFailedException {
   49.50 -        Runtime r = Runtime.getRuntime();
   49.51 -        String output = null;
   49.52 -	String resolved = StringPattern.parse(partition_name).resolve(subst == -1 ? domain_id : subst);
   49.53 -	String resolved2 = d.runCommand(d.xiToolsDir + Settings.XI_HELPER + " expand " + resolved).trim();
   49.54 -        Partition partition = PartitionManager.IT.getPartition(resolved2);
   49.55 -    
   49.56 -        if ( partition == null ) {
   49.57 -          throw new CommandFailedException("Partition " + partition_name + " (resolved to " + resolved2 + ") does not exist.");
   49.58 -        }
   49.59 -    
   49.60 -        // Check if this partition belongs to the VDM
   49.61 -        if (partition.isXeno() && !force) {
   49.62 -          throw new CommandFailedException("Refusing to grant physical access as the given partition is allocated to the virtual disk manager. Use -f if you are sure.");
   49.63 -        }
   49.64 -         
   49.65 -        try {
   49.66 -            Process start_p;
   49.67 -            String start_cmdarray[] = new String[7];
   49.68 -            int start_rc;
   49.69 -            start_cmdarray[0] = d.xiToolsDir + "xi_phys_grant";
   49.70 -            if (mode == Mode.READ_WRITE) {
   49.71 -                start_cmdarray[1] = "rw";
   49.72 -            } else if (mode == Mode.READ_ONLY) {
   49.73 -                start_cmdarray[1] = "ro";
   49.74 -            } else {
   49.75 -                throw new CommandFailedException(
   49.76 -                    "Unknown access mode '" + mode + "'");
   49.77 -            }
   49.78 -            start_cmdarray[2] = Integer.toString(domain_id);
   49.79 -            Extent e = partition.toExtent();
   49.80 -            start_cmdarray[3] = Integer.toString(e.getDisk());
   49.81 -            start_cmdarray[4] = Long.toString(e.getOffset());
   49.82 -            start_cmdarray[5] = Long.toString(e.getSize());
   49.83 -            start_cmdarray[6] = Integer.toString(partition.getPartitionIndex());
   49.84 -
   49.85 -            if (Settings.TEST) {
   49.86 -                output = reportCommand(start_cmdarray);
   49.87 -            } else {
   49.88 -                start_p = r.exec(start_cmdarray);
   49.89 -                start_rc = start_p.waitFor();
   49.90 -                if (start_rc != 0) {
   49.91 -                    throw CommandFailedException.xiCommandFailed(
   49.92 -                        "Could not grant physical access",
   49.93 -                        start_cmdarray);
   49.94 -                }
   49.95 -                output = "Granted physical access to domain " + domain_id;
   49.96 -            }
   49.97 -        } catch (CommandFailedException e) {
   49.98 -            throw e;
   49.99 -        } catch (Exception e) {
  49.100 -            throw new CommandFailedException(
  49.101 -                "Could not grant physical access (" + e + ")",
  49.102 -                e);
  49.103 -        }
  49.104 -
  49.105 -        return output;
  49.106 -    }
  49.107 -
  49.108 -}
    50.1 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalList.java	Fri Nov 21 12:05:32 2003 +0000
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,119 +0,0 @@
    50.4 -package org.xenoserver.control;
    50.5 -
    50.6 -import java.io.BufferedReader;
    50.7 -import java.io.InputStreamReader;
    50.8 -import java.util.HashMap;
    50.9 -import java.util.Map;
   50.10 -import java.util.StringTokenizer;
   50.11 -
   50.12 -/**
   50.13 - * Lists details of all extents the given domain has access to.
   50.14 - * After execute() has been called, call extents() to get the map of extents
   50.15 - * to modes.
   50.16 - */
   50.17 -public class CommandPhysicalList extends Command {
   50.18 -    /** Domain to list details for */
   50.19 -    private int domain_id;
   50.20 -    /** Defaults instance to use. */
   50.21 -    private Defaults d;
   50.22 -    /** Map of extents to access modes */
   50.23 -    private Map map = new HashMap();
   50.24 -
   50.25 -    /**
   50.26 -     * Constructor for CommandDomainList.
   50.27 -     * @param d Defaults object to use.
   50.28 -     * @param domain_id Domain ID to query for
   50.29 -     */
   50.30 -    public CommandPhysicalList(Defaults d, int domain_id) {
   50.31 -        this.d = d;
   50.32 -        this.domain_id = domain_id;
   50.33 -    }
   50.34 -
   50.35 -    /**
   50.36 -     * Retrieves the list of extents.
   50.37 -     * @return null, call extents() to get the list.
   50.38 -     * @throws CommandFailedException if the list could not be retrieved.
   50.39 -     */
   50.40 -    public String execute() throws CommandFailedException {
   50.41 -        Runtime r = Runtime.getRuntime();
   50.42 -        String outline;
   50.43 -        BufferedReader in;
   50.44 -        String output = null;
   50.45 -
   50.46 -        try {
   50.47 -            Process start_p;
   50.48 -            String start_cmdarray[] = new String[2];
   50.49 -            int start_rc;
   50.50 -            start_cmdarray[0] = d.xiToolsDir + "xi_phys_probe";
   50.51 -            start_cmdarray[1] = Integer.toString(domain_id);
   50.52 -
   50.53 -            if (Settings.TEST) {
   50.54 -                output = reportCommand(start_cmdarray);
   50.55 -            } else {
   50.56 -                start_p = r.exec(start_cmdarray);
   50.57 -                start_rc = start_p.waitFor();
   50.58 -                if (start_rc != 0) {
   50.59 -                    throw CommandFailedException.xiCommandFailed(
   50.60 -                        "Could not get extent list",
   50.61 -                        start_cmdarray);
   50.62 -                }
   50.63 -
   50.64 -                in =
   50.65 -                    new BufferedReader(
   50.66 -                        new InputStreamReader(start_p.getInputStream()));
   50.67 -
   50.68 -                outline = in.readLine();
   50.69 -                while (outline != null) {
   50.70 -                    int disk = -1;
   50.71 -                    int partition_no = -1;
   50.72 -                    long offset = -1;
   50.73 -                    long size = -1;
   50.74 -
   50.75 -                    StringTokenizer st = new StringTokenizer(outline);
   50.76 -                    if (st.hasMoreTokens()) {
   50.77 -                        disk = Integer.parseInt(st.nextToken(), 16);
   50.78 -                    }
   50.79 -                    if (st.hasMoreTokens()) {
   50.80 -                        partition_no = Integer.parseInt(st.nextToken(), 16);
   50.81 -                    }
   50.82 -                    if (st.hasMoreTokens()) {
   50.83 -                        offset = Long.parseLong(st.nextToken(), 16);
   50.84 -                    }
   50.85 -                    if (st.hasMoreTokens()) {
   50.86 -                        size = Long.parseLong(st.nextToken(), 16);
   50.87 -                    }
   50.88 -                    if (st.hasMoreTokens()) {
   50.89 -                        String mode = st.nextToken();
   50.90 -                        Extent extent = new Extent(disk, offset, size, partition_no);
   50.91 -                        if (mode.equals("rw")) {
   50.92 -                            map.put(extent, Mode.READ_WRITE);
   50.93 -                        } else if (mode.equals("r")) {
   50.94 -                            map.put(extent, Mode.READ_ONLY);
   50.95 -                        } else {
   50.96 -                            throw new CommandFailedException(
   50.97 -                                "Could not parse access mode " + mode);
   50.98 -                        }
   50.99 -                    }
  50.100 -
  50.101 -                    outline = in.readLine();
  50.102 -                }
  50.103 -
  50.104 -            }
  50.105 -        } catch (CommandFailedException e) {
  50.106 -            throw e;
  50.107 -        } catch (Exception e) {
  50.108 -            throw new CommandFailedException(
  50.109 -                "Could not get extent list(" + e + ")",
  50.110 -                e);
  50.111 -        }
  50.112 -
  50.113 -        return output;
  50.114 -    }
  50.115 -
  50.116 -    /**
  50.117 -     * @return Map of extents to access modes.
  50.118 -     */
  50.119 -    public Map extents() {
  50.120 -        return map;
  50.121 -    }
  50.122 -}
    51.1 --- a/tools/control/src/org/xenoserver/control/CommandPhysicalRevoke.java	Fri Nov 21 12:05:32 2003 +0000
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,77 +0,0 @@
    51.4 -package org.xenoserver.control;
    51.5 -
    51.6 -/**
    51.7 - * Revoke physical access to a partition from a domain.
    51.8 - */
    51.9 -public class CommandPhysicalRevoke extends Command {
   51.10 -    /** Defaults instance to use. */
   51.11 -    private Defaults d;
   51.12 -    /** Domain to revoke access from */
   51.13 -    private int domain_id;
   51.14 -    /** Partition to revoke access to */
   51.15 -    private String partition_name;
   51.16 -    /** Number to substitute for + (-1 => use domain_id) */
   51.17 -    private int subst;
   51.18 -
   51.19 -    /**
   51.20 -     * Constructor for CommandPhysicalRevoke.
   51.21 -     * @param d Defaults object to use.
   51.22 -     * @param domain_id Domain to revoke access from.
   51.23 -     * @param partition Partition to revoke access to.
   51.24 -     */
   51.25 -    public CommandPhysicalRevoke(Defaults d, int domain_id, String partition, int subst) {
   51.26 -        this.d = d;
   51.27 -        this.domain_id = domain_id;
   51.28 -        this.partition_name = partition;
   51.29 -	this.subst = subst;
   51.30 -    }
   51.31 -
   51.32 -    /**
   51.33 -     * @see org.xenoserver.control.Command#execute()
   51.34 -     */
   51.35 -    public String execute() throws CommandFailedException {
   51.36 -        Runtime r = Runtime.getRuntime();
   51.37 -        String output = null;
   51.38 -	String resolved = StringPattern.parse(partition_name).resolve(subst == -1 ? domain_id : subst);
   51.39 -	String resolved2 = d.runCommand(d.xiToolsDir + Settings.XI_HELPER + " expand " + resolved).trim();
   51.40 -        Partition partition = PartitionManager.IT.getPartition(resolved2);
   51.41 -
   51.42 -        if (partition == null) {
   51.43 -          throw new CommandFailedException("Partition " + partition_name + " (resolved to " + resolved2 + ") does not exist.");
   51.44 -        }
   51.45 -
   51.46 -        try {
   51.47 -            Process start_p;
   51.48 -            String start_cmdarray[] = new String[5];
   51.49 -            int start_rc;
   51.50 -            start_cmdarray[0] = d.xiToolsDir + "xi_phys_revoke";
   51.51 -            start_cmdarray[1] = Integer.toString(domain_id);
   51.52 -            Extent e = partition.toExtent();
   51.53 -            start_cmdarray[2] = Integer.toString(e.getDisk());
   51.54 -            start_cmdarray[3] = Long.toString(e.getOffset());
   51.55 -            start_cmdarray[4] = Long.toString(e.getSize());
   51.56 -
   51.57 -            if (Settings.TEST) {
   51.58 -                output = reportCommand(start_cmdarray);
   51.59 -            } else {
   51.60 -                start_p = r.exec(start_cmdarray);
   51.61 -                start_rc = start_p.waitFor();
   51.62 -                if (start_rc != 0) {
   51.63 -                    throw CommandFailedException.xiCommandFailed(
   51.64 -                        "Could not revoke physical access",
   51.65 -                        start_cmdarray);
   51.66 -                }
   51.67 -                output = "Revoked physical access from domain " + domain_id;
   51.68 -            }
   51.69 -        } catch (CommandFailedException e) {
   51.70 -            throw e;
   51.71 -        } catch (Exception e) {
   51.72 -            throw new CommandFailedException(
   51.73 -                "Could not revoke physical access (" + e + ")",
   51.74 -                e);
   51.75 -        }
   51.76 -
   51.77 -        return output;
   51.78 -    }
   51.79 -
   51.80 -}
    52.1 --- a/tools/control/src/org/xenoserver/control/CommandVbdCreate.java	Fri Nov 21 12:05:32 2003 +0000
    52.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.3 @@ -1,69 +0,0 @@
    52.4 -package org.xenoserver.control;
    52.5 -
    52.6 -import java.io.FileWriter;
    52.7 -import java.io.IOException;
    52.8 -
    52.9 -/**
   52.10 - * Create a virtual block device.
   52.11 - */
   52.12 -public class CommandVbdCreate extends Command {
   52.13 -    /** Virtual disk to map to. */
   52.14 -    private String vd_key;
   52.15 -    /** Domain to create VBD for. */
   52.16 -    private int domain_id;
   52.17 -    /** VBD number to use. */
   52.18 -    private int vbd_num;
   52.19 -    /** Access mode to grant. */
   52.20 -    private Mode mode;
   52.21 -
   52.22 -    /**
   52.23 -     * Constructor for CommandVbdCreate.
   52.24 -     * @param vd VirtualDisk to map to.
   52.25 -     * @param domain_id Domain to map for.
   52.26 -     * @param vbd_num VBD number within domain.
   52.27 -     * @param mode Access mode to grant.
   52.28 -     */
   52.29 -    public CommandVbdCreate(
   52.30 -        String vd,
   52.31 -        int domain_id,
   52.32 -        int vbd_num,
   52.33 -        Mode mode) {
   52.34 -        this.vd_key = vd;
   52.35 -        this.domain_id = domain_id;
   52.36 -        this.vbd_num = vbd_num;
   52.37 -        this.mode = mode;
   52.38 -    }
   52.39 -
   52.40 -    /**
   52.41 -     * @see org.xenoserver.control.Command#execute()
   52.42 -     */
   52.43 -    public String execute() throws CommandFailedException {
   52.44 -        VirtualDisk vd = VirtualDiskManager.IT.getVirtualDisk(vd_key);
   52.45 -        if (vd == null) {
   52.46 -            throw new CommandFailedException(
   52.47 -                "No virtual disk with key " + vd_key);
   52.48 -        }
   52.49 -
   52.50 -        VirtualBlockDevice vbd =
   52.51 -            new VirtualBlockDevice(
   52.52 -                vd,
   52.53 -                domain_id,
   52.54 -                vbd_num,
   52.55 -                mode);
   52.56 -        String command = vd.dumpForXen(vbd);
   52.57 -
   52.58 -        try {
   52.59 -            FileWriter fw = new FileWriter("/proc/xeno/vhd");
   52.60 -            fw.write(command);
   52.61 -            fw.flush();
   52.62 -            fw.close();
   52.63 -        } catch (IOException e) {
   52.64 -            throw new CommandFailedException("Could not write VBD details to /proc/xeno/vhd", e);
   52.65 -        }
   52.66 -
   52.67 -        return "Created virtual block device "
   52.68 -            + vbd_num
   52.69 -            + " for domain "
   52.70 -            + domain_id;
   52.71 -    }
   52.72 -}
    53.1 --- a/tools/control/src/org/xenoserver/control/CommandVbdCreatePhysical.java	Fri Nov 21 12:05:32 2003 +0000
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,81 +0,0 @@
    53.4 -package org.xenoserver.control;
    53.5 -
    53.6 -import java.io.FileWriter;
    53.7 -import java.io.IOException;
    53.8 -
    53.9 -/**
   53.10 - * Create a virtual block device.
   53.11 - */
   53.12 -public class CommandVbdCreatePhysical extends Command {
   53.13 -    /** Defaults instance to use. */
   53.14 -    private Defaults d;
   53.15 -    /** Virtual disk to map to. */
   53.16 -    private String partition_name;
   53.17 -    /** Domain to create VBD for. */
   53.18 -    private int domain_id;
   53.19 -    /** VBD number to use. */
   53.20 -    private int vbd_num;
   53.21 -    /** Access mode to grant. */
   53.22 -    private Mode mode;
   53.23 -    /** Number to substitute for + (-1 => use domain_id) */
   53.24 -    private int subst;
   53.25 -
   53.26 -    /**
   53.27 -     * Constructor for CommandVbdCreate.
   53.28 -     * @param partition Partition to map to.
   53.29 -     * @param domain_id Domain to map for.
   53.30 -     * @param vbd_num VBD number within domain.
   53.31 -     * @param mode Access mode to grant.
   53.32 -     */
   53.33 -    public CommandVbdCreatePhysical(
   53.34 -        Defaults d, 
   53.35 -	String partition,
   53.36 -        int domain_id,
   53.37 -        int vbd_num,
   53.38 -        Mode mode,
   53.39 -	int subst) {
   53.40 -        this.d = d;
   53.41 -        this.partition_name = partition;
   53.42 -        this.domain_id = domain_id;
   53.43 -        this.vbd_num = vbd_num;
   53.44 -        this.mode = mode;
   53.45 -	this.subst = subst;
   53.46 -    }
   53.47 -
   53.48 -    /**
   53.49 -     * @see org.xenoserver.control.Command#execute()
   53.50 -     */
   53.51 -    public String execute() throws CommandFailedException {
   53.52 -        String resolved = StringPattern.parse(partition_name).resolve(subst == -1 ? domain_id : subst);
   53.53 -	String resolved2 = d.runCommand(d.xiToolsDir + Settings.XI_HELPER + " expand " + resolved).trim();
   53.54 -        Partition partition = PartitionManager.IT.getPartition(resolved2);
   53.55 -        if (partition == null) {
   53.56 -            throw new CommandFailedException(
   53.57 -                "No partition " + partition_name + " (resolved to " + resolved2 + ") exists");
   53.58 -        }
   53.59 -
   53.60 -        VirtualDisk vd = new VirtualDisk("vbd:" + partition.getName());
   53.61 -        vd.addPartition(partition, partition.getNumSects());
   53.62 -
   53.63 -        VirtualBlockDevice vbd =
   53.64 -            new VirtualBlockDevice(vd, domain_id, vbd_num, mode);
   53.65 -
   53.66 -        String command = vd.dumpForXen(vbd);
   53.67 -
   53.68 -        try {
   53.69 -            FileWriter fw = new FileWriter("/proc/xeno/vhd");
   53.70 -            fw.write(command);
   53.71 -            fw.flush();
   53.72 -            fw.close();
   53.73 -        } catch (IOException e) {
   53.74 -            throw new CommandFailedException(
   53.75 -                "Could not write VBD details to /proc/xeno/vhd",
   53.76 -                e);
   53.77 -        }
   53.78 -
   53.79 -        return "Created virtual block device "
   53.80 -            + vbd_num
   53.81 -            + " for domain "
   53.82 -            + domain_id;
   53.83 -    }
   53.84 -}
    54.1 --- a/tools/control/src/org/xenoserver/control/CommandVbdList.java	Fri Nov 21 12:05:32 2003 +0000
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,66 +0,0 @@
    54.4 -package org.xenoserver.control;
    54.5 -
    54.6 -import java.io.BufferedReader;
    54.7 -import java.io.FileReader;
    54.8 -import java.io.IOException;
    54.9 -import java.util.StringTokenizer;
   54.10 -import java.util.Vector;
   54.11 -
   54.12 -public class CommandVbdList extends Command {
   54.13 -    /** Array of virtual block devices returned */
   54.14 -    private VirtualBlockDevice[] array;
   54.15 -
   54.16 -    public String execute() throws CommandFailedException {
   54.17 -        Vector v = new Vector();
   54.18 -        BufferedReader in;
   54.19 -        String line;
   54.20 -
   54.21 -        try {
   54.22 -            in = new BufferedReader(new FileReader("/proc/xeno/vhd"));
   54.23 -            line = in.readLine();
   54.24 -            while (line != null) {
   54.25 -                int domain = -1;
   54.26 -                int vbdnum = -1;
   54.27 -                String key = "";
   54.28 -                Mode mode = Mode.READ_ONLY;
   54.29 -
   54.30 -                StringTokenizer st = new StringTokenizer(line);
   54.31 -                if (st.hasMoreTokens()) {
   54.32 -                    domain = Integer.parseInt(st.nextToken());
   54.33 -                }
   54.34 -                if (st.hasMoreTokens()) {
   54.35 -                    vbdnum = Integer.parseInt(st.nextToken());
   54.36 -                }
   54.37 -                if (st.hasMoreTokens()) {
   54.38 -                    key = st.nextToken();
   54.39 -                }
   54.40 -                if (st.hasMoreTokens()) {
   54.41 -                    if (Integer.parseInt(st.nextToken()) == 1) {
   54.42 -                        mode = Mode.READ_WRITE;
   54.43 -                    }
   54.44 -                }
   54.45 -
   54.46 -                VirtualDisk vd = VirtualDiskManager.IT.getVirtualDisk(key);
   54.47 -                if (vd == null) {
   54.48 -                    throw new CommandFailedException(
   54.49 -                        "Key " + key + " has no matching virtual disk");
   54.50 -                }
   54.51 -                VirtualBlockDevice vbd =
   54.52 -                    new VirtualBlockDevice(vd, domain, vbdnum, mode);
   54.53 -                v.add(vbd);
   54.54 -
   54.55 -                line = in.readLine();
   54.56 -            }
   54.57 -        } catch (IOException e) {
   54.58 -            throw new CommandFailedException("Could not read VBD file", e);
   54.59 -        }
   54.60 -
   54.61 -        array = new VirtualBlockDevice[v.size()];
   54.62 -        v.toArray(array);
   54.63 -        return null;
   54.64 -    }
   54.65 -    
   54.66 -    public VirtualBlockDevice[] vbds() {
   54.67 -        return array;
   54.68 -    }
   54.69 -}
    55.1 --- a/tools/control/src/org/xenoserver/control/CommandVdCreate.java	Fri Nov 21 12:05:32 2003 +0000
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,42 +0,0 @@
    55.4 -package org.xenoserver.control;
    55.5 -
    55.6 -import java.util.Date;
    55.7 -
    55.8 -/**
    55.9 - * Create a virtual disk.
   55.10 - */
   55.11 -public class CommandVdCreate extends Command {
   55.12 -    /** Name of new disk. */
   55.13 -    private String name;
   55.14 -    /** Size of new disk in bytes. */
   55.15 -    private long size;
   55.16 -    /** Expiry date of new disk. */
   55.17 -    private Date expiry;
   55.18 -
   55.19 -    /**
   55.20 -     * Constructor for CommandVdCreate.
   55.21 -     * @param name Name of new virtual disk.
   55.22 -     * @param size Size in bytes.
   55.23 -     * @param expiry Expiry time, or null for never.
   55.24 -     */
   55.25 -    public CommandVdCreate(String name, long size, Date expiry) {
   55.26 -        this.name = name;
   55.27 -        this.size = size;
   55.28 -        this.expiry = expiry;
   55.29 -    }
   55.30 -
   55.31 -    /**
   55.32 -     * @see org.xenoserver.control.Command#execute()
   55.33 -     */
   55.34 -    public String execute() throws CommandFailedException {
   55.35 -        VirtualDisk vd =
   55.36 -            VirtualDiskManager.IT.createVirtualDisk(
   55.37 -                name,
   55.38 -                size / Settings.SECTOR_SIZE,
   55.39 -                expiry);
   55.40 -        if (vd == null) {
   55.41 -            throw new CommandFailedException("Not enough free space to create disk");
   55.42 -        }
   55.43 -        return "Virtual Disk created with key: " + vd.getKey();
   55.44 -    }
   55.45 -}
    56.1 --- a/tools/control/src/org/xenoserver/control/CommandVdDelete.java	Fri Nov 21 12:05:32 2003 +0000
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,43 +0,0 @@
    56.4 -package org.xenoserver.control;
    56.5 -
    56.6 -/**
    56.7 - * Delete virtual disk.
    56.8 - */
    56.9 -public class CommandVdDelete extends Command {
   56.10 -    /** Key of disk to delete. */
   56.11 -    private String key;
   56.12 -    /** Force deletion? */
   56.13 -    private boolean force;
   56.14 -
   56.15 -    /**
   56.16 -     * Constructor for CommandVdDelete.
   56.17 -     * @param key The key of the disk to delete.
   56.18 -     */
   56.19 -    public CommandVdDelete(String key,boolean force) {
   56.20 -        this.key = key;
   56.21 -        this.force = force;
   56.22 -    }
   56.23 -
   56.24 -    /**
   56.25 -     * @see org.xenoserver.control.Command#execute()
   56.26 -     */
   56.27 -    public String execute() throws CommandFailedException {
   56.28 -        if (VirtualDiskManager.IT.getVirtualDisk(key) == null) {
   56.29 -            throw new CommandFailedException(
   56.30 -                "Virtual disk " + key + " does not exist");
   56.31 -        }
   56.32 -        if ( !force ) {
   56.33 -            CommandVbdList list = new CommandVbdList();
   56.34 -            list.execute();
   56.35 -            VirtualBlockDevice[] vbds = list.vbds();
   56.36 -            for (int i=0;i<vbds.length;i++) {
   56.37 -                if (vbds[i].getVirtualDisk().getKey().equals(key)) {
   56.38 -                    throw new CommandFailedException("Virtual disk " + key + " is in use.");
   56.39 -                }
   56.40 -            }
   56.41 -        }
   56.42 -
   56.43 -        VirtualDiskManager.IT.deleteVirtualDisk(key);
   56.44 -        return "Deleted virtual disk " + key;
   56.45 -    }
   56.46 -}
    57.1 --- a/tools/control/src/org/xenoserver/control/CommandVdRefresh.java	Fri Nov 21 12:05:32 2003 +0000
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,35 +0,0 @@
    57.4 -package org.xenoserver.control;
    57.5 -
    57.6 -import java.util.Date;
    57.7 -
    57.8 -/**
    57.9 - * Refresh the expiry time on a virtual disk.
   57.10 - */
   57.11 -public class CommandVdRefresh extends Command {
   57.12 -    /** Key of disk to refresh */
   57.13 -    private String key;
   57.14 -    /** New expiry */
   57.15 -    private Date expiry;
   57.16 -
   57.17 -    /**
   57.18 -     * Constructor for CommandVdRefresh.
   57.19 -     * @param key Key to refresh.
   57.20 -     * @param expiry New expiry (null for no expiry).
   57.21 -     */
   57.22 -    public CommandVdRefresh(String key, Date expiry) {
   57.23 -        this.key = key;
   57.24 -        this.expiry = expiry;
   57.25 -    }
   57.26 -
   57.27 -    /**
   57.28 -     * @see org.xenoserver.control.Command#execute()
   57.29 -     */
   57.30 -    public String execute() throws CommandFailedException {
   57.31 -        VirtualDisk vd = VirtualDiskManager.IT.getVirtualDisk(key);
   57.32 -        if (vd == null) {
   57.33 -            throw new CommandFailedException("No such virtual disk " + key);
   57.34 -        }
   57.35 -        vd.refreshExpiry(expiry);
   57.36 -        return "Refreshed virtual disk " + key;
   57.37 -    }
   57.38 -}
    58.1 --- a/tools/control/src/org/xenoserver/control/Defaults.java	Fri Nov 21 12:05:32 2003 +0000
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,246 +0,0 @@
    58.4 -package org.xenoserver.control;
    58.5 -
    58.6 -import java.io.BufferedReader;
    58.7 -import java.io.File;
    58.8 -import java.io.FileReader;
    58.9 -import java.io.IOException;
   58.10 -import java.io.InputStreamReader;
   58.11 -
   58.12 -import org.xml.sax.Attributes;
   58.13 -import org.xml.sax.InputSource;
   58.14 -import org.xml.sax.XMLReader;
   58.15 -import org.xml.sax.helpers.DefaultHandler;
   58.16 -
   58.17 -/**
   58.18 - * The Defaults class stores the default settings to be used by the
   58.19 - * management utilities. On construction it parses the defaults file
   58.20 - * located through the Settings class.
   58.21 - */
   58.22 -public class Defaults {
   58.23 -    /** Default domain name. */
   58.24 -    public String domainName;
   58.25 -    /** Default domain memory size in KB. */
   58.26 -    public int domainSizeKB;
   58.27 -    /** Default domain kernel image. */
   58.28 -    public String domainImage;
   58.29 -    /** Default domain initrd. */
   58.30 -    public String domainInitRD;
   58.31 -    /** Default number of virtual interfaces. */
   58.32 -    public int domainVIFs;
   58.33 -    /** Default root device. */
   58.34 -    public String rootDevice;
   58.35 -    /** Default root mount args */
   58.36 -    public String rootArgs;
   58.37 -    /** Default usr device. */
   58.38 -    public String usrDevice;
   58.39 -    /** Default IP address pattern. */
   58.40 -    public String nwIP;
   58.41 -    /** Default gateway pattern. */
   58.42 -    public String nwGateway;
   58.43 -    /** Default netmask patterh. */
   58.44 -    public String nwMask;
   58.45 -    /** Default hostname pattern. */
   58.46 -    public String nwHost;
   58.47 -    /** Default NFS server pattern. */
   58.48 -    public String nwNFSServer;
   58.49 -    /** Default NFS root pattern. */
   58.50 -    public String nwNFSRoot;
   58.51 -    /** Maximum domain number. */
   58.52 -    public int maxDomainNumber = Integer.MAX_VALUE;
   58.53 -    /** Default boot arguments. */
   58.54 -    public String args = "";
   58.55 -    /** Directory to find XI tools. */
   58.56 -    public String xiToolsDir = "";
   58.57 -    /** Domain number */
   58.58 -    public int domainNumber;
   58.59 -
   58.60 -    
   58.61 -    /**
   58.62 -     * Create defaults instance and parse the defaults file.
   58.63 -     */
   58.64 -    public Defaults() {
   58.65 -        File f = Settings.getDefaultsFile();
   58.66 -
   58.67 -        if (f == null) {
   58.68 -            return;
   58.69 -        }
   58.70 -
   58.71 -        try {
   58.72 -            XMLReader xr = new org.apache.crimson.parser.XMLReaderImpl();
   58.73 -            Handler handler = new Handler();
   58.74 -            xr.setContentHandler(handler);
   58.75 -            xr.setErrorHandler(handler);
   58.76 -            xr.parse(new InputSource(new FileReader(f)));
   58.77 -        } catch (Exception e) {
   58.78 -            System.err.println(
   58.79 -                "Could not read defaults file " + f + "\nException: " + e);
   58.80 -            e.printStackTrace();
   58.81 -            return;
   58.82 -        }
   58.83 -    }
   58.84 -
   58.85 -    /**
   58.86 -     * Describe the defaults to System.out
   58.87 -     */
   58.88 -    public void describe() {
   58.89 -        System.out.println("Domain defaults:");
   58.90 -        System.out.println("   name            " + domainName);
   58.91 -        System.out.println("   size            " + domainSizeKB);
   58.92 -        System.out.println("   vifs            " + domainVIFs);
   58.93 -        System.out.println("   domainImage     " + domainImage);
   58.94 -        System.out.println("   domainInitRD    " + domainInitRD);
   58.95 -        System.out.println("   rootDevice      " + rootDevice);
   58.96 -        System.out.println("   rootArgs        " + rootArgs);
   58.97 -        System.out.println("   usrDevice       " + usrDevice);
   58.98 -        System.out.println("   NWIP            " + nwIP);
   58.99 -        System.out.println("   NWGW            " + nwGateway);
  58.100 -        System.out.println("   NWMask          " + nwMask);
  58.101 -        System.out.println("   MaxDomainNumber " + maxDomainNumber);
  58.102 -        System.out.println("   NWNFSServer     " + nwNFSServer);
  58.103 -        System.out.println("   NWNFSRoot       " + nwNFSRoot);
  58.104 -        System.out.println("   XIToolsDir      " + xiToolsDir);
  58.105 -        System.out.println("   args            " + args);
  58.106 -    }
  58.107 -
  58.108 -    /**
  58.109 -     * SAX event handler.
  58.110 -     */
  58.111 -    private class Handler extends DefaultHandler {
  58.112 -        /** Are we inside the defaults node. */
  58.113 -        boolean inDomctlDefaults;
  58.114 -        /** Last element name read. */
  58.115 -        String lastName;
  58.116 -
  58.117 -        /**
  58.118 -         * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
  58.119 -         */
  58.120 -        public void startElement(
  58.121 -            String uri,
  58.122 -            String name,
  58.123 -            String qname,
  58.124 -            Attributes atts) {
  58.125 -            if (qname.equals("domctl_defaults")) {
  58.126 -                inDomctlDefaults = true;
  58.127 -            } else {
  58.128 -                lastName = qname;
  58.129 -            }
  58.130 -        }
  58.131 -
  58.132 -        /**
  58.133 -         * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
  58.134 -         */
  58.135 -        public void endElement(String uri, String name, String qname) {
  58.136 -            lastName = "";
  58.137 -            if (qname.equals("domctl_defaults")) {
  58.138 -                inDomctlDefaults = false;
  58.139 -            }
  58.140 -        }
  58.141 -
  58.142 -        /**
  58.143 -         * @see org.xml.sax.ContentHandler#characters(char[], int, int)
  58.144 -         */
  58.145 -        public void characters(char ch[], int start, int length) {
  58.146 -            String s = new String(ch, start, length);
  58.147 -            if (lastName != null) {
  58.148 -                if (lastName.equals("domain_size_kb")) {
  58.149 -                    domainSizeKB = Integer.parseInt(s);
  58.150 -                } else if (lastName.equals("domain_image")) {
  58.151 -                    domainImage = s;
  58.152 -                } else if (lastName.equals("domain_name")) {
  58.153 -                    domainName = s;
  58.154 -                } else if (lastName.equals("domain_number")) {
  58.155 -                    domainNumber = Integer.parseInt(s);
  58.156 -                } else if (lastName.equals("domain_init_rd")) {
  58.157 -                    domainInitRD = s;
  58.158 -                } else if (lastName.equals("domain_vifs")) {
  58.159 -                    domainVIFs = Integer.parseInt(s);
  58.160 -                } else if (lastName.equals("root_device")) {
  58.161 -                    rootDevice = s;
  58.162 -                } else if (lastName.equals("root_args")) {
  58.163 -                    rootArgs = s;
  58.164 -                } else if (lastName.equals("usr_device")) {
  58.165 -                    usrDevice = s;
  58.166 -                } else if (lastName.equals("nw_ip")) {
  58.167 -                    nwIP =
  58.168 -                        expandDefault(
  58.169 -                            s,
  58.170 -                            runCommand(xiToolsDir + Settings.XI_HELPER + " ip")
  58.171 -                                .trim());
  58.172 -                } else if (lastName.equals("nw_gw")) {
  58.173 -                    nwGateway =
  58.174 -                        expandDefault(
  58.175 -                            s,
  58.176 -                            runCommand(
  58.177 -                                xiToolsDir + Settings.XI_HELPER + " route")
  58.178 -                                .trim());
  58.179 -                } else if (lastName.equals("nw_mask")) {
  58.180 -                    nwMask =
  58.181 -                        expandDefault(
  58.182 -                            s,
  58.183 -                            runCommand(
  58.184 -                                xiToolsDir + Settings.XI_HELPER + " mask")
  58.185 -                                .trim());
  58.186 -                } else if (lastName.equals("nw_host")) {
  58.187 -                    nwHost = s;
  58.188 -                } else if (lastName.equals("nw_nfs_server")) {
  58.189 -                    nwNFSServer = s;
  58.190 -                } else if (lastName.equals("nw_nfs_root")) {
  58.191 -                    nwNFSRoot = s;
  58.192 -                } else if (lastName.equals("args")) {
  58.193 -                    args = s;
  58.194 -                } else if (lastName.equals("max_domain_number")) {
  58.195 -                    maxDomainNumber = Integer.parseInt(s);
  58.196 -                } else if (lastName.equals("xi_tools_dir")) {
  58.197 -                    xiToolsDir = s;
  58.198 -                }
  58.199 -            }
  58.200 -        }
  58.201 -    }
  58.202 -
  58.203 -    /**
  58.204 -     * Expand a defaults pattern.
  58.205 -     * @param supplied Supplied pattern.
  58.206 -     * @param self Own value for variable.
  58.207 -     * @return Appropriate value.
  58.208 -     */
  58.209 -    private String expandDefault(String supplied, String self) {
  58.210 -        if (supplied.startsWith("=")) {
  58.211 -            if (supplied.length() > 1) {
  58.212 -                return self + supplied.substring(1, supplied.length());
  58.213 -            } else {
  58.214 -                return self;
  58.215 -            }
  58.216 -        } else {
  58.217 -            return supplied;
  58.218 -        }
  58.219 -    }
  58.220 -
  58.221 -    /**
  58.222 -     * Run a command for the Defaults object.
  58.223 -     * @param command Command string to run.
  58.224 -     * @return Command's output.
  58.225 -     */
  58.226 -    String runCommand(String command) {
  58.227 -        Runtime runtime = Runtime.getRuntime();
  58.228 -        String outline;
  58.229 -        StringBuffer output = new StringBuffer();
  58.230 -
  58.231 -        try {
  58.232 -            Process process = runtime.exec(command);
  58.233 -            BufferedReader in =
  58.234 -                new BufferedReader(
  58.235 -                    new InputStreamReader(process.getInputStream()));
  58.236 -
  58.237 -            outline = in.readLine();
  58.238 -            while (outline != null) {
  58.239 -                output.append("\n" + outline);
  58.240 -                outline = in.readLine();
  58.241 -            }
  58.242 -        } catch (IOException e) {
  58.243 -            return e.toString();
  58.244 -        }
  58.245 -
  58.246 -        return output.toString();
  58.247 -    }
  58.248 -
  58.249 -}
    59.1 --- a/tools/control/src/org/xenoserver/control/Domain.java	Fri Nov 21 12:05:32 2003 +0000
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,42 +0,0 @@
    59.4 -package org.xenoserver.control;
    59.5 -
    59.6 -/**
    59.7 - * A Domain object holds the details of one domain suitable for returning
    59.8 - * from methods enquiring about domain status. As it's only used to pass
    59.9 - * return values back from DomainList, the fields are left public for
   59.10 - * convenience.
   59.11 - */
   59.12 -public class Domain {
   59.13 -    /** Domain ID. */
   59.14 -    public int id;
   59.15 -    /** Processor index. */
   59.16 -    public int processor;
   59.17 -    /** Has the CPU at the moment? */
   59.18 -    public boolean cpu;
   59.19 -    /** State index. */
   59.20 -    public int nstate;
   59.21 -    /** State string. */
   59.22 -    public String state;
   59.23 -    /** State string. */
   59.24 -    public int ev;
   59.25 -    /** MCU advances. */
   59.26 -    public int mcu;
   59.27 -    /** Total pages. */
   59.28 -    public int pages;
   59.29 -    /** Name. */
   59.30 -    public String name;
   59.31 -
   59.32 -    /**
   59.33 -     * Domain constructor, with default values.
   59.34 -     */
   59.35 -    Domain() {
   59.36 -        id = 0;
   59.37 -        processor = 0;
   59.38 -        cpu = false;
   59.39 -        nstate = 0;
   59.40 -        state = "";
   59.41 -        mcu = 0;
   59.42 -        pages = 0;
   59.43 -        name = "none";
   59.44 -    }
   59.45 -}
    60.1 --- a/tools/control/src/org/xenoserver/control/Extent.java	Fri Nov 21 12:05:32 2003 +0000
    60.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.3 @@ -1,88 +0,0 @@
    60.4 -/*
    60.5 - * Extent.java
    60.6 - * 03.03.26 aho creation
    60.7 - */
    60.8 -
    60.9 -package org.xenoserver.control;
   60.10 -
   60.11 -/**
   60.12 - * Represents an extent on physical disk.
   60.13 - */
   60.14 -public class Extent {
   60.15 -    /** Disk number; 16-bit major:minor pair with no partition number. */
   60.16 -    private int disk;
   60.17 -    /** Offset into disk in sectors. */
   60.18 -    private long offset;
   60.19 -    /** Size of extent in sectors. */
   60.20 -    private long size;
   60.21 -    /** Partition number, if one is allocated. */
   60.22 -    private int partition_no;
   60.23 -
   60.24 -    /**
   60.25 -     * Constructor for Extent.
   60.26 -     * @param disk Disk number.
   60.27 -     * @param offset Offset into disk.
   60.28 -     * @param size Size of extent.
   60.29 -     */
   60.30 -    Extent(int disk, long offset, long size) {
   60.31 -        this.disk = disk;
   60.32 -        this.offset = offset;
   60.33 -        this.size = size;
   60.34 -    }
   60.35 -    
   60.36 -    /**
   60.37 -     * Constructor for Extent.
   60.38 -     * @param disk Disk number.
   60.39 -     * @param offset Offset into disk.
   60.40 -     * @param size Size of extent.
   60.41 -     * @param partition_no Partition number.
   60.42 -     */
   60.43 -    Extent(int disk, long offset, long size,int partition_no) {
   60.44 -        this.disk = disk;
   60.45 -        this.offset = offset;
   60.46 -        this.size = size;
   60.47 -        this.partition_no = partition_no;
   60.48 -    }
   60.49 -
   60.50 -    /**
   60.51 -     * @return Disk number.
   60.52 -     */
   60.53 -    public int getDisk() {
   60.54 -        return disk;
   60.55 -    }
   60.56 -
   60.57 -    /**
   60.58 -     * @return Offset into disk.
   60.59 -     */
   60.60 -    public long getOffset() {
   60.61 -        return offset;
   60.62 -    }
   60.63 -
   60.64 -    /**
   60.65 -     * @return Size of extent.
   60.66 -     */
   60.67 -    public long getSize() {
   60.68 -        return size;
   60.69 -    }
   60.70 -
   60.71 -    /**
   60.72 -     * @return Major number of disk.
   60.73 -     */
   60.74 -    public int getMajor() {
   60.75 -        return disk >> 8;
   60.76 -    }
   60.77 -
   60.78 -    /**
   60.79 -     * @return Minor number of disk, not including partition.
   60.80 -     */
   60.81 -    public int getMinor() {
   60.82 -        return disk & 0xFF;
   60.83 -    }
   60.84 -    
   60.85 -    /**
   60.86 -     * @return Partition number of this extent.
   60.87 -     */
   60.88 -    public int getPartitionNo() {
   60.89 -        return partition_no;
   60.90 -    }
   60.91 -}
    61.1 --- a/tools/control/src/org/xenoserver/control/InetAddressPattern.java	Fri Nov 21 12:05:32 2003 +0000
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,79 +0,0 @@
    61.4 -package org.xenoserver.control;
    61.5 -
    61.6 -import java.net.InetAddress;
    61.7 -import java.net.UnknownHostException;
    61.8 -
    61.9 -/**
   61.10 - * This utility class expands configuration file patterns.
   61.11 - */
   61.12 -public class InetAddressPattern {
   61.13 -    /** The base InetAddress for this pattern. */
   61.14 -    private InetAddress base;
   61.15 -    /** If true, add the domain number to the base address. */
   61.16 -    private boolean addDom;
   61.17 -
   61.18 -    /**
   61.19 -     * Parse a pattern string into an InetAddressPattern.
   61.20 -     * @param t The pattern string.
   61.21 -     * @return The parsed pattern object.
   61.22 -     */
   61.23 -    static InetAddressPattern parse(String t) {
   61.24 -        InetAddressPattern result = new InetAddressPattern();
   61.25 -        char[] ca = t.toCharArray();
   61.26 -        int len = ca.length;
   61.27 -
   61.28 -        try {
   61.29 -            if (len == 0) {
   61.30 -                result.base = null;
   61.31 -                result.addDom = false;
   61.32 -            } else if (ca[len - 1] == '+') {
   61.33 -                result.base = InetAddress.getByName(t.substring(0, len - 1));
   61.34 -                result.addDom = true;
   61.35 -            } else {
   61.36 -                result.base = InetAddress.getByName(t);
   61.37 -                result.addDom = false;
   61.38 -            }
   61.39 -        } catch (UnknownHostException uhe) {
   61.40 -            result.base = null;
   61.41 -            result.addDom = false;
   61.42 -        }
   61.43 -
   61.44 -        return result;
   61.45 -    }
   61.46 -
   61.47 -    /**
   61.48 -     * Resolve the pattern for the given domain.
   61.49 -     * @param domain_id The domain ID.
   61.50 -     * @return The resolved string.
   61.51 -     */
   61.52 -    String resolve(int domain_id) {
   61.53 -        byte[] b = base.getAddress();
   61.54 -        if (addDom) {
   61.55 -            if (((int) b[3]) + domain_id > 255) {
   61.56 -                if (((int) b[2]) + domain_id > 255) {
   61.57 -                    if (((int) b[1]) + domain_id > 255) {
   61.58 -                        b[0]++;
   61.59 -                    }
   61.60 -                    b[1]++;
   61.61 -                }
   61.62 -                b[2]++;
   61.63 -            }
   61.64 -            b[3] += domain_id;
   61.65 -        }
   61.66 -        return ""
   61.67 -            + (b[0] + (b[0] < 0 ? 256 : 0))
   61.68 -            + "."
   61.69 -            + (b[1] + (b[1] < 0 ? 256 : 0))
   61.70 -            + "."
   61.71 -            + (b[2] + (b[2] < 0 ? 256 : 0))
   61.72 -            + "."
   61.73 -            + (b[3] + (b[3] < 0 ? 256 : 0));
   61.74 -    }
   61.75 -
   61.76 -    /**
   61.77 -     * @see java.lang.Object#toString()
   61.78 -     */
   61.79 -    public String toString() {
   61.80 -        return "[" + base + (addDom ? "+dom_id" : "") + "]";
   61.81 -    }
   61.82 -}
    62.1 --- a/tools/control/src/org/xenoserver/control/Library.java	Fri Nov 21 12:05:32 2003 +0000
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,148 +0,0 @@
    62.4 -/*
    62.5 - * Library.java
    62.6 - * 03.03.28 aho creation
    62.7 - */
    62.8 -
    62.9 -package org.xenoserver.control;
   62.10 -
   62.11 -/**
   62.12 - * Library functions.
   62.13 - */
   62.14 -public class Library {
   62.15 -    /**
   62.16 -     * Convert a number to a fixed width string.
   62.17 -     * @param input The number to convert.
   62.18 -     * @param width The width desired.
   62.19 -     * @param leftAlign True to left-align the number.
   62.20 -     * @return The formatted string.
   62.21 -     */
   62.22 -    public static String format(long input, int width, boolean leftAlign) {
   62.23 -        String sss = Long.toString(input);
   62.24 -        String space = "                                ";
   62.25 -
   62.26 -        if (width < sss.length()) {
   62.27 -            width = sss.length();
   62.28 -        }
   62.29 -
   62.30 -        if (leftAlign) {
   62.31 -            return sss + space.substring(0, width - sss.length());
   62.32 -        } else {
   62.33 -            return space.substring(0, width - sss.length()) + sss;
   62.34 -        }
   62.35 -    }
   62.36 -
   62.37 -    /**
   62.38 -     * Convert a string to a fixed-width string.
   62.39 -     * @param input Input string.
   62.40 -     * @param width Width desired.
   62.41 -     * @param leftAlign True to left-align the string.
   62.42 -     * @return The formatted string.
   62.43 -     */
   62.44 -    public static String format(String input, int width, boolean leftAlign) {
   62.45 -        String space = "                                ";
   62.46 -
   62.47 -        if (width < input.length()) {
   62.48 -            width = input.length();
   62.49 -        }
   62.50 -
   62.51 -        if (leftAlign) {
   62.52 -            return input + space.substring(0, width - input.length());
   62.53 -        } else {
   62.54 -            return space.substring(0, width - input.length()) + input;
   62.55 -        }
   62.56 -    }
   62.57 -
   62.58 -    /**
   62.59 -     * Parse a size which may have a k/m/g suffix into a number.
   62.60 -     * @param size The size string to parse.
   62.61 -     * @return The equivalent number.
   62.62 -     */
   62.63 -    public static long parseSize(String size) {
   62.64 -        String substring = size;
   62.65 -        int suffix = 1;
   62.66 -        long value = 0;
   62.67 -
   62.68 -        if (size == null) {
   62.69 -            return 0;
   62.70 -        }
   62.71 -
   62.72 -        if ((substring = check(size, 'm')) != null) {
   62.73 -            suffix = 1024 * 1024;
   62.74 -        } else if ((substring = check(size, 'M')) != null) {
   62.75 -            suffix = 1024 * 1024;
   62.76 -        } else if ((substring = check(size, 'k')) != null) {
   62.77 -            suffix = 1024;
   62.78 -        } else if ((substring = check(size, 'K')) != null) {
   62.79 -            suffix = 1024;
   62.80 -        } else if ((substring = check(size, 'g')) != null) {
   62.81 -            suffix = 1024 * 1024 * 1024;
   62.82 -        } else if ((substring = check(size, 'G')) != null) {
   62.83 -            suffix = 1024 * 1024 * 1024;
   62.84 -        } else {
   62.85 -            substring = size;
   62.86 -        }
   62.87 -
   62.88 -        try {
   62.89 -            value = Long.decode(substring).longValue() * suffix;
   62.90 -        } catch (NumberFormatException e) {
   62.91 -            value = 0;
   62.92 -        }
   62.93 -
   62.94 -        return value;
   62.95 -    }
   62.96 -
   62.97 -    /**
   62.98 -     * Check if the given size has the specified suffix.
   62.99 -     * @param size Size string.
  62.100 -     * @param suffix Test suffix.
  62.101 -     * @return Number part of string, or null if suffix does not match.
  62.102 -     */
  62.103 -    private static String check(String size, char suffix) {
  62.104 -        int index = size.indexOf(suffix);
  62.105 -
  62.106 -        if (index != -1) {
  62.107 -            return size.substring(0, index);
  62.108 -        } else {
  62.109 -            return null;
  62.110 -        }
  62.111 -    }
  62.112 -
  62.113 -    /**
  62.114 -     * Formats a number of bytes in whichever way makes most sense based
  62.115 -     * on magnitude and width.
  62.116 -     * 
  62.117 -     * @param size Number of bytes.
  62.118 -     * @param width Width of field - at least 5, plz.
  62.119 -     * @param leftAlign True for left-align.
  62.120 -     * @return The formatted string.
  62.121 -     */
  62.122 -    public static String formatSize(long size, int width, boolean leftAlign) {
  62.123 -        char[] suffixes = { ' ', 'k', 'M', 'G' };
  62.124 -        int suffix = 0;
  62.125 -        long before = size;
  62.126 -        float after = 0;
  62.127 -
  62.128 -        while (before > 10000) {
  62.129 -            after = ((float) (before % 1024)) / 1024;
  62.130 -            before /= 1024;
  62.131 -            suffix++;
  62.132 -        }
  62.133 -
  62.134 -        StringBuffer num = new StringBuffer(width);
  62.135 -        num.append(Long.toString(before));
  62.136 -        if (after != 0) {
  62.137 -            int space = width - num.length() - 2;
  62.138 -            if (space > 0) {
  62.139 -                num.append('.');
  62.140 -                if (space > 3) {
  62.141 -                    space = 3;
  62.142 -                }
  62.143 -                num.append(
  62.144 -                    Integer.toString((int) (after * Math.pow(10, space))));
  62.145 -            }
  62.146 -        }
  62.147 -        num.append(suffixes[suffix]);
  62.148 -
  62.149 -        return format(num.toString(), width, leftAlign);
  62.150 -    }
  62.151 -}
    63.1 --- a/tools/control/src/org/xenoserver/control/Mode.java	Fri Nov 21 12:05:32 2003 +0000
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,36 +0,0 @@
    63.4 -/*
    63.5 - * Mode.java
    63.6 - * 03.03.27 aho creation
    63.7 - *
    63.8 - * until we have jdk1.5, we're left with this mess...
    63.9 - */
   63.10 -
   63.11 -package org.xenoserver.control;
   63.12 -
   63.13 -/**
   63.14 - * Enumeration to represent an access mode.
   63.15 - */
   63.16 -public class Mode {
   63.17 -    /** name of this mode */
   63.18 -    private final String name;
   63.19 -
   63.20 -    /**
   63.21 -     * Construct a mode
   63.22 -     * @param name Name to use.
   63.23 -     */
   63.24 -    private Mode(String name) {
   63.25 -        this.name = name;
   63.26 -    }
   63.27 -
   63.28 -    /**
   63.29 -     * @see java.lang.Object#toString()
   63.30 -     */
   63.31 -    public String toString() {
   63.32 -        return name;
   63.33 -    }
   63.34 -
   63.35 -    /** Single read-only mode instance. */
   63.36 -    public static final Mode READ_ONLY = new Mode("ro");
   63.37 -    /** Single read-write mode instance. */
   63.38 -    public static final Mode READ_WRITE = new Mode("rw");
   63.39 -}
    64.1 --- a/tools/control/src/org/xenoserver/control/Partition.java	Fri Nov 21 12:05:32 2003 +0000
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,200 +0,0 @@
    64.4 -/*
    64.5 - * Partition.java
    64.6 - * 03.03.26 aho creation
    64.7 - */
    64.8 -
    64.9 -package org.xenoserver.control;
   64.10 -
   64.11 -import java.io.PrintWriter;
   64.12 -
   64.13 -/**
   64.14 - * Represents a single real partition.
   64.15 - */
   64.16 -public class Partition {
   64.17 -    /** Major device number as seen by Linux. */
   64.18 -    private int major;
   64.19 -    /** Minor device number as seen by Linux. */
   64.20 -    private int minor;
   64.21 -    /** Number of blocks in the partition. */
   64.22 -    private long blocks;
   64.23 -    /** Start sector of the partition. */
   64.24 -    private long start_sect;
   64.25 -    /** Number of sectors in the partition. */
   64.26 -    private long nr_sects;
   64.27 -    /** Name of the partition. */
   64.28 -    private String name;
   64.29 -    /** True if this partition is a XenoPartition. */
   64.30 -    private boolean xeno;
   64.31 -
   64.32 -    /**
   64.33 -     * Mark this partition as a XenoPartition.
   64.34 -     */
   64.35 -    void makeXeno() {
   64.36 -        xeno = true;
   64.37 -    }
   64.38 -
   64.39 -    /**
   64.40 -     * Constructor for Partition.
   64.41 -     * @param major Major number
   64.42 -     * @param minor Minor number
   64.43 -     * @param blocks Size in blocks
   64.44 -     * @param start_sect Start sector
   64.45 -     * @param nr_sects Number of sectors
   64.46 -     * @param name Name of partition
   64.47 -     * @param xeno True if XenoPartition
   64.48 -     */
   64.49 -    Partition(
   64.50 -        int major,
   64.51 -        int minor,
   64.52 -        long blocks,
   64.53 -        long start_sect,
   64.54 -        long nr_sects,
   64.55 -        String name,
   64.56 -        boolean xeno) {
   64.57 -        this.major = major;
   64.58 -        this.minor = minor;
   64.59 -        this.blocks = blocks;
   64.60 -        this.start_sect = start_sect;
   64.61 -        this.nr_sects = nr_sects;
   64.62 -        this.name = name;
   64.63 -        this.xeno = xeno;
   64.64 -    }
   64.65 -
   64.66 -    /**
   64.67 -     * Dump this partition as XML.
   64.68 -     * @param out The writer to dump to.
   64.69 -     */
   64.70 -    void dumpAsXML(PrintWriter out) {
   64.71 -        out.println(
   64.72 -            "  <partition>\n"
   64.73 -                + "    <major>"
   64.74 -                + major
   64.75 -                + "</major>\n"
   64.76 -                + "    <minor>"
   64.77 -                + minor
   64.78 -                + "</minor>\n"
   64.79 -                + "    <blocks>"
   64.80 -                + blocks
   64.81 -                + "</blocks>\n"
   64.82 -                + "    <start_sect>"
   64.83 -                + start_sect
   64.84 -                + "</start_sect>\n"
   64.85 -                + "    <nr_sects>"
   64.86 -                + nr_sects
   64.87 -                + "</nr_sects>\n"
   64.88 -                + "    <name>"
   64.89 -                + name
   64.90 -                + "</name>\n"
   64.91 -                + "  </partition>");
   64.92 -    }
   64.93 -
   64.94 -    /**
   64.95 -     * @return Major device number.
   64.96 -     */
   64.97 -    public int getMajor() {
   64.98 -        return major;
   64.99 -    }
  64.100 -
  64.101 -    /**
  64.102 -     * @return Minor device number.
  64.103 -     */
  64.104 -    public int getMinor() {
  64.105 -        return minor;
  64.106 -    }
  64.107 -
  64.108 -    /**
  64.109 -     * @return Number of blocks.
  64.110 -     */
  64.111 -    public long getBlocks() {
  64.112 -        return blocks;
  64.113 -    }
  64.114 -
  64.115 -    /**
  64.116 -     * @return Starting sector.
  64.117 -     */
  64.118 -    public long getStartSect() {
  64.119 -        return start_sect;
  64.120 -    }
  64.121 -
  64.122 -    /**
  64.123 -     * @return Number of sectors.
  64.124 -     */
  64.125 -    public long getNumSects() {
  64.126 -        return nr_sects;
  64.127 -    }
  64.128 -
  64.129 -    /**
  64.130 -     * @return Name of partition.
  64.131 -     */
  64.132 -    public String getName() {
  64.133 -        return name;
  64.134 -    }
  64.135 -
  64.136 -    /**
  64.137 -     * @return True if this is a XenoPartition.
  64.138 -     */
  64.139 -    public boolean isXeno() {
  64.140 -        return xeno;
  64.141 -    }
  64.142 -
  64.143 -    /**
  64.144 -     * Is this partition identical to the other?
  64.145 -     * @param other Other partition to compare to.
  64.146 -     * @return True if they are identical.
  64.147 -     */
  64.148 -    boolean identical(Partition other) {
  64.149 -        return this.major == other.major
  64.150 -            && this.minor == other.minor
  64.151 -            && this.blocks == other.blocks
  64.152 -            && this.start_sect == other.start_sect
  64.153 -            && this.nr_sects == other.nr_sects
  64.154 -            && this.name.equals(other.name);
  64.155 -    }
  64.156 -
  64.157 -    /**
  64.158 -     * @return An Extent covering this partiton.
  64.159 -     */
  64.160 -    Extent toExtent() {
  64.161 -        return new Extent(getDisk(),start_sect,nr_sects);
  64.162 -    }
  64.163 -
  64.164 -    /**
  64.165 -     * @param e Extent to compare this partition to.
  64.166 -     * @return True if this partition covers the same disk area as the given extent.
  64.167 -     */
  64.168 -    boolean matchesExtent(Extent e) {
  64.169 -        return e.getDisk() == getDisk()
  64.170 -            && e.getOffset() == start_sect
  64.171 -            && e.getSize() == nr_sects;
  64.172 -    }
  64.173 -    
  64.174 -    /**
  64.175 -     * @return Disk number for this partition.
  64.176 -     */
  64.177 -    public int getDisk() {
  64.178 -        if ( name.startsWith("hd") ) {
  64.179 -            // High 8 bits are major, low 8 bits are minor, with bottom 6 clear
  64.180 -            return (major << 8) | (minor & 0xC0); 
  64.181 -        } else if ( name.startsWith("sd") ) {
  64.182 -            // High 8 bits are major, low 8 bits are minor, with bottom 4 clear
  64.183 -            return (major << 8) | (minor & 0xF0);
  64.184 -        } else {
  64.185 -            throw new IllegalArgumentException("Don't know how to convert " + name + "into a disk number");
  64.186 -        }
  64.187 -    }
  64.188 -    
  64.189 -    /**
  64.190 -     * @return Partition index on disk for this partition.
  64.191 -     */
  64.192 -    public int getPartitionIndex() {
  64.193 -        if ( name.startsWith("hd") ) {
  64.194 -            // low 6 bits of minor are partition no
  64.195 -            return minor & 0x3F; 
  64.196 -        } else if ( name.startsWith("sd") ) {
  64.197 -            // low 4 bits of minor are partition no
  64.198 -            return minor & 0x0F;
  64.199 -        } else {
  64.200 -            throw new IllegalArgumentException("Don't know how to convert " + name + "into a partition number");
  64.201 -        }
  64.202 -    }
  64.203 -}
    65.1 --- a/tools/control/src/org/xenoserver/control/PartitionManager.java	Fri Nov 21 12:05:32 2003 +0000
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,171 +0,0 @@
    65.4 -/*
    65.5 - * PartitionManager.java
    65.6 - * 03.03.26 aho creation
    65.7 - */
    65.8 -
    65.9 -package org.xenoserver.control;
   65.10 -
   65.11 -import java.io.BufferedReader;
   65.12 -import java.io.FileReader;
   65.13 -import java.io.IOException;
   65.14 -import java.io.PrintWriter;
   65.15 -import java.util.Enumeration;
   65.16 -import java.util.Iterator;
   65.17 -import java.util.Vector;
   65.18 -
   65.19 -/**
   65.20 - * PartitionManager manages the partitions on the machine. It is a Singleton
   65.21 - * which automatically initialises itself on first class reference.
   65.22 - */
   65.23 -public class PartitionManager {
   65.24 -    /** The proc header string, used to check that this is a suitable proc file. */
   65.25 -    private static final String PROC_TEMPLATE =
   65.26 -        "major minor start_sector  num_sectors name";
   65.27 -
   65.28 -    /** The single PartitionManager reference. */
   65.29 -    public static final PartitionManager IT =
   65.30 -        new PartitionManager(Settings.PARTITIONS_FILE);
   65.31 -
   65.32 -    /** The list of partitions. */
   65.33 -    private Vector partition_map;
   65.34 -
   65.35 -    /**
   65.36 -     * Initialize partition manager with source file.
   65.37 -     * Normally we read from /proc/partitions, but we can
   65.38 -     * specify an alternative file for debugging.
   65.39 -     * @param filename The file to read partition data from.
   65.40 -     */
   65.41 -    private PartitionManager(String filename) {
   65.42 -        String str;
   65.43 -        BufferedReader in;
   65.44 -
   65.45 -        partition_map = new Vector(100, 10);
   65.46 -
   65.47 -        try {
   65.48 -            in = new BufferedReader(new FileReader(filename));
   65.49 -
   65.50 -            str = in.readLine(); /* skip headings */
   65.51 -            if (str.length() < PROC_TEMPLATE.length()
   65.52 -                || !str.substring(0, PROC_TEMPLATE.length()).equals(
   65.53 -                    PROC_TEMPLATE)) {
   65.54 -                System.err.println("Error: Incorrect /proc/partitions.");
   65.55 -                System.err.println("       Is this Xeno?");
   65.56 -                System.exit(1);
   65.57 -            }
   65.58 -
   65.59 -            str = in.readLine(); /* skip blank line */
   65.60 -
   65.61 -            str = in.readLine();
   65.62 -            while (str != null) {
   65.63 -                Partition partition =
   65.64 -                    new Partition(
   65.65 -                        Integer.parseInt(str.substring( 0,  5).trim()),
   65.66 -                        Integer.parseInt(str.substring( 6, 11).trim()),
   65.67 -                        Integer.parseInt(str.substring(25, 37).trim())/2,
   65.68 -                        Integer.parseInt(str.substring(12, 24).trim()),
   65.69 -                        Integer.parseInt(str.substring(25, 37).trim()),
   65.70 -                        str.substring(38).trim(),
   65.71 -                        false);
   65.72 -
   65.73 -                partition_map.add(partition);
   65.74 -                str = in.readLine();
   65.75 -            }
   65.76 -        } catch (IOException io) {
   65.77 -            System.err.println(
   65.78 -                "PartitionManager: error reading partition file ["
   65.79 -                    + filename
   65.80 -                    + "]");
   65.81 -            System.err.println(io);
   65.82 -        }
   65.83 -    }
   65.84 -
   65.85 -    /**
   65.86 -     * Find a partition with the specified name.
   65.87 -     * @param name The name to search for.
   65.88 -     * @return The partition found, or null if no such partition.
   65.89 -     */
   65.90 -    public Partition getPartition(String name) {
   65.91 -        Partition partition = null;
   65.92 -        for (Enumeration e = partition_map.elements(); e.hasMoreElements();) {
   65.93 -            partition = (Partition) e.nextElement();
   65.94 -            if (partition.getName().equals(name)) {
   65.95 -                return partition;
   65.96 -            }
   65.97 -        }
   65.98 -        return null;
   65.99 -    }
  65.100 -
  65.101 -    /**
  65.102 -     * Finds the partition that matches the given extent, if any.
  65.103 -     * @param extent The extent to compare to.
  65.104 -     * @return The first matching partition, or null if none.
  65.105 -     */
  65.106 -    public Partition getPartition(Extent extent) {
  65.107 -        Partition partition = null;
  65.108 -        for (Enumeration e = partition_map.elements(); e.hasMoreElements();) {
  65.109 -            partition = (Partition) e.nextElement();
  65.110 -            if (partition.matchesExtent(extent)) {
  65.111 -                return partition;
  65.112 -            }
  65.113 -        }
  65.114 -        return null;
  65.115 -    }
  65.116 -    
  65.117 -    /**
  65.118 -     * Find the ith partition in the partition list.
  65.119 -     * @param i Index number.
  65.120 -     * @return The partition, or null if out of range.
  65.121 -     */
  65.122 -    public Partition getPartition(int i) {
  65.123 -        if ( i >= partition_map.size() ) {
  65.124 -          return null;
  65.125 -        }
  65.126 -        return (Partition) partition_map.elementAt( i );
  65.127 -    }
  65.128 -
  65.129 -    /**
  65.130 -     * Adds the given partition as a XenoPartition.
  65.131 -     * @param p The partition to add.
  65.132 -     */
  65.133 -    void addXenoPartition(Partition p) {
  65.134 -        for (Enumeration e = partition_map.elements(); e.hasMoreElements();) {
  65.135 -            Partition partition = (Partition) e.nextElement();
  65.136 -            if (partition.identical(p)) {
  65.137 -                partition.makeXeno();
  65.138 -            }
  65.139 -        }
  65.140 -    }
  65.141 -
  65.142 -    /**
  65.143 -     * Dump the XenoPartition list as XML.
  65.144 -     * @param out Writer to dump to.
  65.145 -     */
  65.146 -    void dumpAsXML(PrintWriter out) {
  65.147 -        out.println("<partitions>");
  65.148 -        for (Enumeration e = partition_map.elements(); e.hasMoreElements();) {
  65.149 -            Partition partition = (Partition) e.nextElement();
  65.150 -            if (partition.isXeno()) {
  65.151 -                partition.dumpAsXML(out);
  65.152 -            }
  65.153 -        }
  65.154 -
  65.155 -        out.println("</partitions>");
  65.156 -
  65.157 -        return;
  65.158 -    }
  65.159 -
  65.160 -    /**
  65.161 -     * @return The number of partitions. 
  65.162 -     */
  65.163 -    public int getPartitionCount() {
  65.164 -        return partition_map.size();
  65.165 -    }
  65.166 -
  65.167 -    /**
  65.168 -     * Get an iterator over all the partitions.
  65.169 -     * @return An iterator over Partition objects.
  65.170 -     */
  65.171 -    public Iterator iterator() {
  65.172 -        return partition_map.iterator();
  65.173 -    }
  65.174 -}
    66.1 --- a/tools/control/src/org/xenoserver/control/Settings.java	Fri Nov 21 12:05:32 2003 +0000
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,63 +0,0 @@
    66.4 -package org.xenoserver.control;
    66.5 -
    66.6 -import java.io.File;
    66.7 -import java.util.StringTokenizer;
    66.8 -
    66.9 -/**
   66.10 - * The Settings class is a repository for global settings such as the IP of
   66.11 - * the machine and the location of the defaults file.
   66.12 - */
   66.13 -public final class Settings {
   66.14 -    /** Filename for the defaults file. */
   66.15 -    public static final String DEFAULTS_FILE =
   66.16 -        System.getProperty("DEFAULTS_FILE", "xenctl.xml");
   66.17 -    /** Path to search for the defaults file. */
   66.18 -    public static final String DEFAULTS_PATH =
   66.19 -        System.getProperty("DEFAULTS_PATH", ".:/etc:/var/lib/xen");
   66.20 -    /** If set, do not call any xi_ commands, just print their command lines. */
   66.21 -    public static final boolean TEST = (System.getProperty("TEST") != null);
   66.22 -    /** Name of xi_helper utility. */
   66.23 -    public static final String XI_HELPER =
   66.24 -        System.getProperty("XI_HELPER", "xi_helper");
   66.25 -    /** File to parse to get partition info. */
   66.26 -    public static final String PARTITIONS_FILE =
   66.27 -        System.getProperty("PARTITIONS_FILE", "/proc/xeno/blkdev_info");
   66.28 -    /** File to load virtual disk state from. */
   66.29 -    public static final String STATE_INPUT_FILE =
   66.30 -        System.getProperty("STATE_INPUT_FILE", "/var/lib/xen/vdstate.xml");
   66.31 -    /** File to save virtual disk state to. */
   66.32 -    public static final String STATE_OUTPUT_FILE =
   66.33 -        System.getProperty("STATE_OUTPUT_FILE", "/var/lib/xen/vdstate.xml");
   66.34 -    /** Size of a sector in bytes. */
   66.35 -    public static final int SECTOR_SIZE =
   66.36 -        Integer.parseInt(System.getProperty("SECTOR_SIZE", "512"));
   66.37 -
   66.38 -    /**
   66.39 -     * Search for the defaults file in the path configured in DEFAULTS_PATH.
   66.40 -     * @return Reference to the defaults file.
   66.41 -     */
   66.42 -    public static File getDefaultsFile() {
   66.43 -        StringTokenizer tok = new StringTokenizer(DEFAULTS_PATH, ":");
   66.44 -        File result = null;
   66.45 -        File probe;
   66.46 -
   66.47 -        while (tok.hasMoreTokens()) {
   66.48 -            String probe_dir = tok.nextToken();
   66.49 -            probe = new File(probe_dir, DEFAULTS_FILE);
   66.50 -            if (probe.exists()) {
   66.51 -                result = probe;
   66.52 -                break;
   66.53 -            }
   66.54 -        }
   66.55 -
   66.56 -        if (result == null) {
   66.57 -            System.err.println(
   66.58 -                "Could not find "
   66.59 -                    + DEFAULTS_FILE
   66.60 -                    + " in path "
   66.61 -                    + DEFAULTS_PATH);
   66.62 -        }
   66.63 -
   66.64 -        return result;
   66.65 -    }
   66.66 -}
    67.1 --- a/tools/control/src/org/xenoserver/control/StringPattern.java	Fri Nov 21 12:05:32 2003 +0000
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,78 +0,0 @@
    67.4 -package org.xenoserver.control;
    67.5 -
    67.6 -/**
    67.7 - * This utility class expands configuration file patterns.
    67.8 - */
    67.9 -public class StringPattern {
   67.10 -    /** The base string for this pattern. */
   67.11 -    private String base;
   67.12 -    /** The base number for this pattern. */
   67.13 -    private int bn;
   67.14 -    /** If true, add the domain number to the base number and append. */
   67.15 -    private boolean addDom;
   67.16 -    /** If true, append the domain number to the base string. */
   67.17 -    private boolean appendDom;
   67.18 -
   67.19 -    /**
   67.20 -     * Parse a string into a pattern.
   67.21 -     * @param t The pattern string to parse.
   67.22 -     * @return A usable pattern object.
   67.23 -     */
   67.24 -    public static StringPattern parse(String t) {
   67.25 -        StringPattern result = new StringPattern();
   67.26 -        char[] ca = t.toCharArray();
   67.27 -        int idx = 0;
   67.28 -        int len = ca.length;
   67.29 -
   67.30 -        if (len == 0) {
   67.31 -            result.base = "";
   67.32 -            result.bn = 0;
   67.33 -            result.addDom = false;
   67.34 -        } else if (ca[len - 1] == '+') {
   67.35 -            idx = len - 2;
   67.36 -            if ((idx >= 0) && (ca[idx] >= '0') && (ca[idx] <= '9')) {
   67.37 -                while ((idx >= 0) && (ca[idx] >= '0') && (ca[idx] <= '9')) {
   67.38 -                    idx--;
   67.39 -                }
   67.40 -                result.base = t.substring(0, idx + 1);
   67.41 -                result.bn = Integer.parseInt(t.substring(idx + 1, len - 1));
   67.42 -                result.addDom = true;
   67.43 -            } else {
   67.44 -                result.base = t.substring(0, len - 1);
   67.45 -                result.appendDom = true;
   67.46 -            }
   67.47 -        } else {
   67.48 -            result.base = t;
   67.49 -        }
   67.50 -
   67.51 -        return result;
   67.52 -    }
   67.53 -
   67.54 -    /**
   67.55 -     * Resolve the pattern for the given domain number.
   67.56 -     * @param domain The domain number to use.
   67.57 -     * @return The expanded pattern for the given domain.
   67.58 -     */
   67.59 -    public String resolve(int domain) {
   67.60 -        if (addDom) {
   67.61 -            return base + (bn + domain);
   67.62 -        } else if (appendDom) {
   67.63 -            return base + domain;
   67.64 -        } else {
   67.65 -            return base;
   67.66 -        }
   67.67 -    }
   67.68 -
   67.69 -    /**
   67.70 -     * @see java.lang.Object#toString()
   67.71 -     */
   67.72 -    public String toString() {
   67.73 -        return (
   67.74 -            "["
   67.75 -                + base
   67.76 -                + (addDom ? "+" + bn : "")
   67.77 -                + ((addDom || appendDom) ? "+ID" : "")
   67.78 -                + "]");
   67.79 -    }
   67.80 -
   67.81 -}
    68.1 --- a/tools/control/src/org/xenoserver/control/VirtualBlockDevice.java	Fri Nov 21 12:05:32 2003 +0000
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,67 +0,0 @@
    68.4 -/*
    68.5 - * VirtualBlockDevice.java
    68.6 - * 03.03.27 aho creation
    68.7 - */
    68.8 -
    68.9 -package org.xenoserver.control;
   68.10 -
   68.11 -/**
   68.12 - * A virtual block device; a mapping from a domain-specific number to a virtual
   68.13 - * disk with associated access mode.
   68.14 - */
   68.15 -public class VirtualBlockDevice {
   68.16 -    /** The virtual disk which this block device maps onto. */
   68.17 -    private VirtualDisk vd;
   68.18 -    /** The domain in which this block device exists. */
   68.19 -    private int domain;
   68.20 -    /** The block device number in that domain. */
   68.21 -    private int vbdNum;
   68.22 -    /** The access mode within that domain. */
   68.23 -    private Mode mode;
   68.24 -
   68.25 -    /**
   68.26 -     * Constructor for VirtualBlockDevice.
   68.27 -     * @param vd The virtual disk to map to.
   68.28 -     * @param domain The domain to create the device in.
   68.29 -     * @param vbdNum The number for the device.
   68.30 -     * @param mode The access mode.
   68.31 -     */
   68.32 -    VirtualBlockDevice(
   68.33 -        VirtualDisk vd,
   68.34 -        int domain,
   68.35 -        int vbdNum,
   68.36 -        Mode mode) {
   68.37 -        this.vd = vd;
   68.38 -        this.domain = domain;
   68.39 -        this.vbdNum = vbdNum;
   68.40 -        this.mode = mode;
   68.41 -    }
   68.42 -
   68.43 -    /**
   68.44 -     * @return This device's virtual disk.
   68.45 -     */
   68.46 -    public VirtualDisk getVirtualDisk() {
   68.47 -        return vd;
   68.48 -    }
   68.49 -
   68.50 -    /**
   68.51 -     * @return The domain this device exists in.
   68.52 -     */
   68.53 -    public int getDomain() {
   68.54 -        return domain;
   68.55 -    }
   68.56 -
   68.57 -    /**
   68.58 -     * @return The device number within its domain.
   68.59 -     */
   68.60 -    public int getVbdNum() {
   68.61 -        return vbdNum;
   68.62 -    }
   68.63 -
   68.64 -    /**
   68.65 -     * @return This device's access mode.
   68.66 -     */
   68.67 -    public Mode getMode() {
   68.68 -        return mode;
   68.69 -    }
   68.70 -}
    69.1 --- a/tools/control/src/org/xenoserver/control/VirtualDisk.java	Fri Nov 21 12:05:32 2003 +0000
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,236 +0,0 @@
    69.4 -/*
    69.5 - * VirtualDisk.java
    69.6 - * 03.03.26 aho creation
    69.7 - */
    69.8 -
    69.9 -package org.xenoserver.control;
   69.10 -
   69.11 -import java.io.PrintWriter;
   69.12 -import java.util.Date;
   69.13 -import java.util.Iterator;
   69.14 -import java.util.Vector;
   69.15 -
   69.16 -/**
   69.17 - * A single virtual disk. This may be used by multiple virtual block devices.
   69.18 - */
   69.19 -public class VirtualDisk {
   69.20 -    /** The name of this virtual disk. */
   69.21 -    private String name;
   69.22 -    /** The key of this virtual disk (unique). */
   69.23 -    private String key;
   69.24 -    /** The expiry time of this virtual disk, or null for never. */
   69.25 -    private Date expiry;
   69.26 -    /** The extent list for this virtual disk. */
   69.27 -    private Vector extents;
   69.28 -
   69.29 -    /**
   69.30 -     * Construct a new virtual disk, specifying all parameters.
   69.31 -     * @param name Name of the new disk.
   69.32 -     * @param expiry Expiry time, or null for never.
   69.33 -     * @param key Key for the new disk, or null to autogenerate.
   69.34 -     */
   69.35 -    VirtualDisk(String name, Date expiry, String key) {
   69.36 -        this.name = name;
   69.37 -        if (key == null) {
   69.38 -            this.key = generateKey();
   69.39 -        } else {
   69.40 -            this.key = key;
   69.41 -        }
   69.42 -        this.expiry = expiry;
   69.43 -        extents = new Vector();
   69.44 -    }
   69.45 -
   69.46 -    /**
   69.47 -     * Construct a new virtual disk, with automatically generated key and no expiry.
   69.48 -     * @param name Name of the new disk.
   69.49 -     */
   69.50 -    VirtualDisk(String name) {
   69.51 -        this(name, null, null);
   69.52 -    }
   69.53 -
   69.54 -    /**
   69.55 -     * Construct a new virtual disk, with automatically generated key.
   69.56 -     * @param name Name of the new disk.
   69.57 -     * @param expiry Expiry time, or null for never.
   69.58 -     */
   69.59 -    VirtualDisk(String name, Date expiry) {
   69.60 -        this(name, expiry, null);
   69.61 -    }
   69.62 -
   69.63 -    /**
   69.64 -     * Generate a unique key for this virtual disk.
   69.65 -     * For now, just generate a 10 digit number.
   69.66 -     * @return A unique key.
   69.67 -     */
   69.68 -    private static String generateKey() {
   69.69 -        return Long.toString(
   69.70 -            1000000000L + (long) (Math.random() * 8999999999L));
   69.71 -    }
   69.72 -
   69.73 -    /**
   69.74 -     * Add an extent to this disk.
   69.75 -     * @param extent The extent to add.
   69.76 -     */
   69.77 -    void addExtent(Extent extent) {
   69.78 -        extents.add(extent);
   69.79 -    }
   69.80 -
   69.81 -    /**
   69.82 -     * Remove the first extent from this disk.
   69.83 -     * @return The extent removed, or null if there are no extents.
   69.84 -     */
   69.85 -    Extent removeExtent() {
   69.86 -        Extent e;
   69.87 -
   69.88 -        if (extents.size() > 0) {
   69.89 -            e = (Extent) extents.remove(0);
   69.90 -        } else {
   69.91 -            e = null;
   69.92 -        }
   69.93 -
   69.94 -        return e;
   69.95 -    }
   69.96 -
   69.97 -    /**
   69.98 -     * Form a string suitable for passing into the XenoLinux proc interface mapping
   69.99 -     * the given VBD to this virtual disk.
  69.100 -     * @param vbd The virtual block device to map.
  69.101 -     * @return A XenoLinux /proc string.
  69.102 -     */
  69.103 -    String dumpForXen(VirtualBlockDevice vbd) {
  69.104 -        StringBuffer sb = new StringBuffer();
  69.105 -
  69.106 -        sb.append(
  69.107 -            "domain:"
  69.108 -                + vbd.getDomain()
  69.109 -                + " "
  69.110 -                + vbd.getMode().toString()
  69.111 -                + " "
  69.112 -                + "segment:"
  69.113 -                + vbd.getVbdNum()
  69.114 -                + " "
  69.115 -	        + "key: "
  69.116 -	        + this.getKey()
  69.117 -	        + " "
  69.118 -                + "extents:"
  69.119 -                + extents.size()
  69.120 -                + " ");
  69.121 -        for (int loop = 0; loop < extents.size(); loop++) {
  69.122 -            Extent e = (Extent) extents.get(loop);
  69.123 -            sb.append(
  69.124 -                "(disk:"
  69.125 -                    + e.getDisk()
  69.126 -                    + " "
  69.127 -                    + "offset:"
  69.128 -                    + e.getOffset()
  69.129 -                    + " "
  69.130 -                    + "size:"
  69.131 -                    + e.getSize()
  69.132 -                    + ")");
  69.133 -        }
  69.134 -        return sb.toString();
  69.135 -    }
  69.136 -
  69.137 -    /**
  69.138 -     * Dump the virtual disk as XML.
  69.139 -     * @param out The writer to dump to.
  69.140 -     */
  69.141 -    void dumpAsXML(PrintWriter out) {
  69.142 -        out.println("  <virtual_disk>");
  69.143 -        out.println("    <name>" + name + "</name>");
  69.144 -        out.println("    <key>" + key + "</key>");
  69.145 -        if (expiry == null) {
  69.146 -            out.println("    <expiry>0</expiry>");
  69.147 -        } else {
  69.148 -            out.println("    <expiry>" + expiry.getTime() + "</expiry>");
  69.149 -        }
  69.150 -        out.println("    <extents>");
  69.151 -        for (int loop = 0; loop < extents.size(); loop++) {
  69.152 -            Extent e = (Extent) extents.get(loop);
  69.153 -            out.println("      <extent>");
  69.154 -            out.println("        <disk>" + e.getDisk() + "</disk>");
  69.155 -            out.println("        <size>" + e.getSize() + "</size>");
  69.156 -            out.println("        <offset>" + e.getOffset() + "</offset>");
  69.157 -            out.println("      </extent>");
  69.158 -        }
  69.159 -        out.println("    </extents>");
  69.160 -        out.println("  </virtual_disk>");
  69.161 -
  69.162 -        return;
  69.163 -    }
  69.164 -
  69.165 -    /**
  69.166 -     * Add a partition as a XenoPartition.
  69.167 -     * Chop the partition in to extents and add them to this virtual disk.
  69.168 -     * @param partition The partition to add.
  69.169 -     * @param extentSize The number of sectors to use for each extent. 
  69.170 -     */
  69.171 -    void addPartition(Partition partition, long extentSize) {
  69.172 -        int loop;
  69.173 -
  69.174 -        for (loop = 0; loop < partition.getNumSects() / extentSize; loop++) {
  69.175 -            Extent extent =
  69.176 -                new Extent(
  69.177 -                    partition.getDisk(),
  69.178 -                    partition.getStartSect() + (extentSize * loop),
  69.179 -                    extentSize);
  69.180 -
  69.181 -            addExtent(extent);
  69.182 -        }
  69.183 -    }
  69.184 -
  69.185 -    /**
  69.186 -     * @return The name of this virtual disk.
  69.187 -     */
  69.188 -    public String getName() {
  69.189 -        return name;
  69.190 -    }
  69.191 -
  69.192 -    /**
  69.193 -     * @return The key of this virtual disk.
  69.194 -     */
  69.195 -    public String getKey() {
  69.196 -        return key;
  69.197 -    }
  69.198 -
  69.199 -    /**
  69.200 -     * @return The expiry time of this virtual disk.
  69.201 -     */
  69.202 -    public Date getExpiry() {
  69.203 -        return expiry;
  69.204 -    }
  69.205 -
  69.206 -    /**
  69.207 -     * @return The number of extents in this virtual disk.
  69.208 -     */
  69.209 -    public int getExtentCount() {
  69.210 -        return extents.size();
  69.211 -    }
  69.212 -
  69.213 -    /**
  69.214 -     * @return Total size of this virtual disk in sectors.
  69.215 -     */
  69.216 -    public long getSize() {
  69.217 -        long size = 0;
  69.218 -        Iterator i = extents.iterator();
  69.219 -        while (i.hasNext()) {
  69.220 -            size += ((Extent) i.next()).getSize();
  69.221 -        }
  69.222 -        return size;
  69.223 -    }
  69.224 -
  69.225 -    /**
  69.226 -     * @return An iterator over all extents in the disk.
  69.227 -     */
  69.228 -    public Iterator extents() {
  69.229 -        return extents.iterator();
  69.230 -    }
  69.231 -
  69.232 -    /**
  69.233 -     * Reset the expiry time for this virtual disk.
  69.234 -     * @param expiry The new expiry time, or null for never.
  69.235 -     */
  69.236 -    void refreshExpiry(Date expiry) {
  69.237 -        this.expiry = expiry;
  69.238 -    }
  69.239 -}
    70.1 --- a/tools/control/src/org/xenoserver/control/VirtualDiskManager.java	Fri Nov 21 12:05:32 2003 +0000
    70.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.3 @@ -1,157 +0,0 @@
    70.4 -/*
    70.5 - * VirtualDiskManager.java
    70.6 - * 03.03.26 aho creation
    70.7 - */
    70.8 -
    70.9 -package org.xenoserver.control;
   70.10 -
   70.11 -import java.io.PrintWriter;
   70.12 -import java.util.Date;
   70.13 -import java.util.Iterator;
   70.14 -import java.util.LinkedHashMap;
   70.15 -
   70.16 -/**
   70.17 - * VirtualDiskManager manages the list of virtual disks on the machine. It is
   70.18 - * a Singleton which automatically initialises itself on first class reference.
   70.19 - */
   70.20 -public class VirtualDiskManager {
   70.21 -    /** The single VDM reference. */
   70.22 -    public static final VirtualDiskManager IT = new VirtualDiskManager();
   70.23 -    /** The free-space disk. */
   70.24 -    private VirtualDisk freeDisk;
   70.25 -    /** The map of keys to virtual disks. */
   70.26 -    private LinkedHashMap virtualDisks = new LinkedHashMap(100);
   70.27 -
   70.28 -    /**
   70.29 -     * VDM constructor, private as it's a singleton.
   70.30 -     */
   70.31 -    private VirtualDiskManager() {
   70.32 -        freeDisk = new VirtualDisk("free");
   70.33 -    }
   70.34 -
   70.35 -    /**
   70.36 -     * Get the virtual disk with the specified key.
   70.37 -     * @param key The key to look for.
   70.38 -     * @return The virtual disk, or null if not found.
   70.39 -     */
   70.40 -    public VirtualDisk getVirtualDisk(String key) {
   70.41 -        return ((VirtualDisk) virtualDisks.get(key));
   70.42 -    }
   70.43 -
   70.44 -    /**
   70.45 -     * Add a new partition to the free space list in the disk manager.
   70.46 -     * @param partition The partition to add.
   70.47 -     * @param chunkSize The chunk size to split the partition into, in sectors. 
   70.48 -     */
   70.49 -    void addPartition(Partition partition, long chunkSize) {
   70.50 -        freeDisk.addPartition(partition, chunkSize);
   70.51 -    }
   70.52 -
   70.53 -    /**
   70.54 -     * Create a new virtual disk.
   70.55 -     * @param name The disk name to use.
   70.56 -     * @param size The number of sectors to allocate.
   70.57 -     * @param expiry The expiry time, or null for never.
   70.58 -     * @return null if not enough space is available
   70.59 -     */
   70.60 -    VirtualDisk createVirtualDisk(String name, long size, Date expiry) {
   70.61 -        if (freeDisk.getSize() < size) {
   70.62 -            return null;
   70.63 -        }
   70.64 -
   70.65 -        VirtualDisk vd = new VirtualDisk(name, expiry);
   70.66 -
   70.67 -        while (size > 0) {
   70.68 -            Extent e;
   70.69 -
   70.70 -            e = freeDisk.removeExtent();
   70.71 -            if (e == null) {
   70.72 -                return null;
   70.73 -            }
   70.74 -            size -= e.getSize();
   70.75 -            vd.addExtent(e);
   70.76 -        }
   70.77 -
   70.78 -        insertVirtualDisk(vd);
   70.79 -
   70.80 -        return vd;
   70.81 -    }
   70.82 -
   70.83 -    /**
   70.84 -     * Delete a virtual disk, and put its extents back into the free pool.
   70.85 -     * @param key The key of the disk to delete.
   70.86 -     */
   70.87 -    void deleteVirtualDisk(String key) {
   70.88 -        VirtualDisk vd;
   70.89 -
   70.90 -        vd = (VirtualDisk) virtualDisks.get(key);
   70.91 -        if (vd != null) {
   70.92 -            Extent e;
   70.93 -
   70.94 -            virtualDisks.remove(key);
   70.95 -
   70.96 -            e = vd.removeExtent();
   70.97 -            while (e != null) {
   70.98 -                freeDisk.addExtent(e);
   70.99 -                e = vd.removeExtent();
  70.100 -            }
  70.101 -        }
  70.102 -    }
  70.103 -
  70.104 -    /**
  70.105 -     * Insert a new virtual disk into the map.
  70.106 -     * @param vd The disk to insert.
  70.107 -     */
  70.108 -    void insertVirtualDisk(VirtualDisk vd) {
  70.109 -        virtualDisks.put(vd.getKey(), vd);
  70.110 -    }
  70.111 -
  70.112 -    /**
  70.113 -     * Hash a virtual block device.
  70.114 -     * @param domain The VBD's domain.
  70.115 -     * @param vbdNum The VBD's number within the domain.
  70.116 -     * @return A suitable hash key.
  70.117 -     */
  70.118 -    Object hashVBD(int domain, int vbdNum) {
  70.119 -        return new Integer(domain * 16 + vbdNum);
  70.120 -    }
  70.121 -
  70.122 -    /**
  70.123 -     * Set a new free disk.
  70.124 -     * @param vd The free disk to set.
  70.125 -     */
  70.126 -    void setFreeDisk(VirtualDisk vd) {
  70.127 -        freeDisk = vd;
  70.128 -    }
  70.129 -
  70.130 -    /**
  70.131 -     * Dump the data in the VirtualDiskManager in XML form.
  70.132 -     * @param out The output writer to dump to.
  70.133 -     */
  70.134 -    void dumpAsXML(PrintWriter out) {
  70.135 -        out.println("<free>");
  70.136 -        freeDisk.dumpAsXML(out);
  70.137 -        out.println("</free>");
  70.138 -        out.println("<virtual_disks>");
  70.139 -        Iterator i = virtualDisks.values().iterator();
  70.140 -        while (i.hasNext()) {
  70.141 -            VirtualDisk vd = (VirtualDisk) i.next();
  70.142 -            vd.dumpAsXML(out);
  70.143 -        }
  70.144 -        out.println("</virtual_disks>");
  70.145 -    }
  70.146 -
  70.147 -    /**
  70.148 -     * @return The free disk.
  70.149 -     */
  70.150 -    public VirtualDisk getFreeDisk() {
  70.151 -        return freeDisk;
  70.152 -    }
  70.153 -
  70.154 -    /**
  70.155 -     * @return An iterator over the virtual disks.
  70.156 -     */
  70.157 -    public Iterator getVirtualDisks() {
  70.158 -        return virtualDisks.values().iterator();
  70.159 -    }
  70.160 -}
    71.1 --- a/tools/control/src/org/xenoserver/control/XML.java	Fri Nov 21 12:05:32 2003 +0000
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,120 +0,0 @@
    71.4 -/*
    71.5 - * XML.java
    71.6 - * 03.03.26 aho creation
    71.7 - */
    71.8 -
    71.9 -package org.xenoserver.control;
   71.10 -
   71.11 -import java.io.BufferedWriter;
   71.12 -import java.io.File;
   71.13 -import java.io.FileNotFoundException;
   71.14 -import java.io.FileWriter;
   71.15 -import java.io.IOException;
   71.16 -import java.io.PrintWriter;
   71.17 -
   71.18 -import javax.xml.parsers.DocumentBuilder;
   71.19 -import javax.xml.parsers.DocumentBuilderFactory;
   71.20 -import javax.xml.parsers.ParserConfigurationException;
   71.21 -
   71.22 -import org.w3c.dom.Document;
   71.23 -import org.xml.sax.SAXException;
   71.24 -import org.xml.sax.SAXParseException;
   71.25 -
   71.26 -/**
   71.27 - * Utility class for loading and saving state through XML files.
   71.28 - */
   71.29 -public class XML {
   71.30 -    /** The document we are reading/writing. */
   71.31 -    private static Document document = null;
   71.32 -
   71.33 -    /**
   71.34 -     * Save the state of the managers to the configuration file given.
   71.35 -     * @param pm The PartitionManager to save.
   71.36 -     * @param vdm The VirtualDiskManager to save.
   71.37 -     * @param filename The configuration filename to save to.
   71.38 -     */
   71.39 -    public static void saveState(
   71.40 -        PartitionManager pm,
   71.41 -        VirtualDiskManager vdm,
   71.42 -        String filename) {
   71.43 -        PrintWriter out;
   71.44 -
   71.45 -        try {
   71.46 -            out = new PrintWriter(new BufferedWriter(new FileWriter(filename)));
   71.47 -        } catch (IOException e) {
   71.48 -            System.err.println("XML.dump_state error [" + filename + "]");
   71.49 -            System.err.println(e);
   71.50 -            return;
   71.51 -        }
   71.52 -
   71.53 -        out.println("<?xml version=\"1.0\"?>");
   71.54 -        out.println("<vdmanager>");
   71.55 -        pm.dumpAsXML(out);
   71.56 -        vdm.dumpAsXML(out);
   71.57 -        out.println("</vdmanager>");
   71.58 -
   71.59 -        out.close();
   71.60 -        return;
   71.61 -    }
   71.62 -
   71.63 -    /**
   71.64 -     * Load the state of the managers from the given configuration file.
   71.65 -     * @param pm The PartitionManager to load.
   71.66 -     * @param vdm The VirtualDomainManager to load.
   71.67 -     * @param filename The filename to read the configuration from.
   71.68 -     */
   71.69 -    public static void loadState(
   71.70 -        PartitionManager pm,
   71.71 -        VirtualDiskManager vdm,
   71.72 -        String filename) {
   71.73 -        if (document == null) {
   71.74 -            loadFile(filename);
   71.75 -        }
   71.76 -
   71.77 -        XMLHelper.parse(pm, vdm, document);
   71.78 -    }
   71.79 -
   71.80 -    /**
   71.81 -     * Load an XML file and parse it into a Document.
   71.82 -     * @param filename The file to load.
   71.83 -     */
   71.84 -    private static void loadFile(String filename) {
   71.85 -        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
   71.86 -
   71.87 -        try {
   71.88 -            File file = new File(filename);
   71.89 -
   71.90 -            DocumentBuilder builder = factory.newDocumentBuilder();
   71.91 -            document = builder.parse(file);
   71.92 -        } catch (SAXParseException spe) /* error generated by parser */ {
   71.93 -            System.err.println(
   71.94 -                "xml parser exception on line "
   71.95 -                    + spe.getLineNumber()
   71.96 -                    + " for uri "
   71.97 -                    + spe.getSystemId());
   71.98 -            System.err.println(spe.getMessage());
   71.99 -
  71.100 -            Exception x = spe;
  71.101 -            if (spe.getException() != null) {
  71.102 -                x = spe.getException();
  71.103 -            }
  71.104 -            x.printStackTrace();
  71.105 -            System.exit(1);
  71.106 -        } catch (SAXException sxe) {
  71.107 -            Exception e = sxe;
  71.108 -            if (sxe.getException() != null) {
  71.109 -                e = sxe.getException();
  71.110 -            }
  71.111 -            e.printStackTrace();
  71.112 -            System.exit(1);
  71.113 -        } catch (ParserConfigurationException pce) {
  71.114 -            pce.printStackTrace();
  71.115 -        } catch (FileNotFoundException fnfe) {
  71.116 -            System.err.println(
  71.117 -                "warning: state file not found [" + filename + "]");
  71.118 -        } catch (IOException ioe) {
  71.119 -            ioe.printStackTrace();
  71.120 -        }
  71.121 -        return;
  71.122 -    }
  71.123 -}
    72.1 --- a/tools/control/src/org/xenoserver/control/XMLHelper.java	Fri Nov 21 12:05:32 2003 +0000
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,186 +0,0 @@
    72.4 -/*
    72.5 - * XMLHelper.java
    72.6 - * 03.03.27 aho creation
    72.7 - */
    72.8 -
    72.9 -package org.xenoserver.control;
   72.10 -
   72.11 -import java.util.Date;
   72.12 -
   72.13 -import org.w3c.dom.Document;
   72.14 -import org.w3c.dom.Node;
   72.15 -import org.w3c.dom.NodeList;
   72.16 -
   72.17 -/**
   72.18 - * XMLHelper contains helper methods used to parse the XML state files.
   72.19 - */
   72.20 -class XMLHelper {
   72.21 -    /**
   72.22 -     * Find a subnode with the specified name.
   72.23 -     * @param name Name to look for.
   72.24 -     * @param node Node from which to start search.
   72.25 -     * @return The first subnode found, or null if none.
   72.26 -     */
   72.27 -    private static Node getSubNode(String name, Node node) {
   72.28 -        if (node.getNodeType() != Node.ELEMENT_NODE) {
   72.29 -            System.err.println("Error: Search node not of element type");
   72.30 -            return null;
   72.31 -        }
   72.32 -
   72.33 -        if (!node.hasChildNodes()) {
   72.34 -            return null;
   72.35 -        }
   72.36 -
   72.37 -        NodeList list = node.getChildNodes();
   72.38 -        for (int i = 0; i < list.getLength(); i++) {
   72.39 -            Node subnode = list.item(i);
   72.40 -            if (subnode.getNodeType() == Node.ELEMENT_NODE) {
   72.41 -                if (subnode.getNodeName() == name) {
   72.42 -                    return subnode;
   72.43 -                }
   72.44 -            }
   72.45 -        }
   72.46 -        return null;
   72.47 -    }
   72.48 -
   72.49 -    /**
   72.50 -     * Get all the text of a given node.
   72.51 -     * @param node The node to examine.
   72.52 -     * @return The node's text.
   72.53 -     */
   72.54 -    private static String getText(Node node) {
   72.55 -        StringBuffer result = new StringBuffer();
   72.56 -        if (node == null || !node.hasChildNodes()) {
   72.57 -            return "";
   72.58 -        }
   72.59 -
   72.60 -        NodeList list = node.getChildNodes();
   72.61 -        for (int i = 0; i < list.getLength(); i++) {
   72.62 -            Node subnode = list.item(i);
   72.63 -            if (subnode.getNodeType() == Node.TEXT_NODE) {
   72.64 -                result.append(subnode.getNodeValue());
   72.65 -            }
   72.66 -        }
   72.67 -        return result.toString();
   72.68 -    }
   72.69 -
   72.70 -    /**
   72.71 -     * Parse the given configuration document and configure the managers.
   72.72 -     * @param pm PartitionManager instance to configure.
   72.73 -     * @param vdm VirtualDomainManager instance to configure.
   72.74 -     * @param document Document to parse.
   72.75 -     */
   72.76 -    static void parse(
   72.77 -        PartitionManager pm,
   72.78 -        VirtualDiskManager vdm,
   72.79 -        Document document) {
   72.80 -        if (document == null) {
   72.81 -            return;
   72.82 -        }
   72.83 -
   72.84 -        /* parse partitions */
   72.85 -        parsePartitions(pm, document.getElementsByTagName("partition"));
   72.86 -
   72.87 -        /* parse virtual disks */
   72.88 -        NodeList list = document.getElementsByTagName("virtual_disk");
   72.89 -        for (int i = 0; i < list.getLength(); i++) {
   72.90 -            Node subnode = list.item(i);
   72.91 -            String parent = subnode.getParentNode().getNodeName();
   72.92 -            VirtualDisk vd = parseVirtualDisk(subnode);
   72.93 -
   72.94 -            if (parent.equals("free")) {
   72.95 -                vdm.setFreeDisk(vd);
   72.96 -            } else if (parent.equals("virtual_disks")) {
   72.97 -                vdm.insertVirtualDisk(vd);
   72.98 -            } else {
   72.99 -                System.out.println(
  72.100 -                    "XML parse error: unknown parent for virtual_disk "
  72.101 -                        + "["
  72.102 -                        + parent
  72.103 -                        + "]");
  72.104 -            }
  72.105 -        }
  72.106 -    }
  72.107 -
  72.108 -    /**
  72.109 -     * Parse a node representing a virtual disk.
  72.110 -     * @param node The node to parse.
  72.111 -     * @return The VirtualDisk this node represents.
  72.112 -     */
  72.113 -    private static VirtualDisk parseVirtualDisk(Node node) {
  72.114 -        VirtualDisk vd;
  72.115 -        Date date = new Date();
  72.116 -        NodeList list;
  72.117 -
  72.118 -        long timestamp =
  72.119 -            Long.parseLong(
  72.120 -                XMLHelper.getText(XMLHelper.getSubNode("expiry", node)));
  72.121 -        if (timestamp == 0) {
  72.122 -            date = null;
  72.123 -        } else {
  72.124 -            date.setTime(timestamp);
  72.125 -        }
  72.126 -        vd =
  72.127 -            new VirtualDisk(
  72.128 -                XMLHelper.getText(XMLHelper.getSubNode("name", node)),
  72.129 -                date,
  72.130 -                XMLHelper.getText(XMLHelper.getSubNode("key", node)));
  72.131 -
  72.132 -        list = XMLHelper.getSubNode("extents", node).getChildNodes();
  72.133 -        for (int i = 0; i < list.getLength(); i++) {
  72.134 -            Node enode = list.item(i);
  72.135 -
  72.136 -            if (enode.getNodeType() == Node.ELEMENT_NODE
  72.137 -                && enode.getNodeName().equals("extent")) {
  72.138 -                Extent extent =
  72.139 -                    new Extent(
  72.140 -                        Integer.parseInt(
  72.141 -                            XMLHelper.getText(
  72.142 -                                XMLHelper.getSubNode("disk", enode))),
  72.143 -                        Long.parseLong(
  72.144 -                            XMLHelper.getText(
  72.145 -                                XMLHelper.getSubNode("offset", enode))),
  72.146 -                    Long.parseLong(
  72.147 -                        XMLHelper.getText(
  72.148 -                            XMLHelper.getSubNode("size", enode))));
  72.149 -
  72.150 -                vd.addExtent(extent);
  72.151 -            }
  72.152 -        }
  72.153 -
  72.154 -        return vd;
  72.155 -    }
  72.156 -
  72.157 -    /**
  72.158 -     * Parse a list of partition nodes.
  72.159 -     * @param pm The partition manager to configure.
  72.160 -     * @param nl The list of partition nodes.
  72.161 -     */
  72.162 -    private static void parsePartitions(PartitionManager pm, NodeList nl) {
  72.163 -        Partition partition;
  72.164 -
  72.165 -        for (int loop = 0; loop < nl.getLength(); loop++) {
  72.166 -            Node node = nl.item(loop);
  72.167 -
  72.168 -            partition =
  72.169 -                new Partition(
  72.170 -                    Integer.parseInt(
  72.171 -                        XMLHelper.getText(XMLHelper.getSubNode("major", node))),
  72.172 -                    Integer.parseInt(
  72.173 -                        XMLHelper.getText(XMLHelper.getSubNode("minor", node))),
  72.174 -                    Integer.parseInt(
  72.175 -                        XMLHelper.getText(
  72.176 -                            XMLHelper.getSubNode("blocks", node))),
  72.177 -                    Integer.parseInt(
  72.178 -                        XMLHelper.getText(
  72.179 -                            XMLHelper.getSubNode("start_sect", node))),
  72.180 -                    Integer.parseInt(
  72.181 -                        XMLHelper.getText(
  72.182 -                            XMLHelper.getSubNode("nr_sects", node))),
  72.183 -                    XMLHelper.getText(XMLHelper.getSubNode("name", node)),
  72.184 -                    true);
  72.185 -
  72.186 -            pm.addXenoPartition(partition);
  72.187 -        }
  72.188 -    }
  72.189 -}
    73.1 --- a/tools/control/src/org/xenoserver/web/RootBean.java	Fri Nov 21 12:05:32 2003 +0000
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,45 +0,0 @@
    73.4 -/*
    73.5 - * RootBean.java
    73.6 - * 03.05.05 aho creation
    73.7 - */
    73.8 -
    73.9 -package org.xenoserver.web;
   73.10 -
   73.11 -import javax.servlet.http.HttpSessionBindingEvent;
   73.12 -import javax.servlet.http.HttpSessionBindingListener;
   73.13 -
   73.14 -import org.xenoserver.control.PartitionManager;
   73.15 -import org.xenoserver.control.Settings;
   73.16 -import org.xenoserver.control.VirtualDiskManager;
   73.17 -import org.xenoserver.control.XML;
   73.18 -
   73.19 -public class RootBean implements HttpSessionBindingListener {
   73.20 -    PartitionManager pm;
   73.21 -    VirtualDiskManager vdm;
   73.22 -
   73.23 -    public RootBean() {
   73.24 -        valueBound(null);
   73.25 -    }
   73.26 -
   73.27 -    public void valueBound(HttpSessionBindingEvent event) {
   73.28 -        pm = PartitionManager.IT;
   73.29 -        vdm = VirtualDiskManager.IT;
   73.30 -        XML.loadState(pm, vdm, Settings.STATE_INPUT_FILE);
   73.31 -    }
   73.32 -
   73.33 -    public void valueUnbound(HttpSessionBindingEvent event) {
   73.34 -        doFlushState();
   73.35 -    }
   73.36 -    
   73.37 -    public PartitionManager pm() {
   73.38 -        return pm;
   73.39 -    }
   73.40 -    
   73.41 -    public VirtualDiskManager vdm() {
   73.42 -        return vdm;
   73.43 -    }
   73.44 -
   73.45 -    public void doFlushState() {
   73.46 -        XML.saveState(pm, vdm, Settings.STATE_OUTPUT_FILE);
   73.47 -    }
   73.48 -}
    74.1 --- a/tools/control/src/org/xenoserver/web/SystemConfigurationBean.java	Fri Nov 21 12:05:32 2003 +0000
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,20 +0,0 @@
    74.4 -/*
    74.5 - * SystemConfigurationBean.java
    74.6 - * 03.05.06 aho creation
    74.7 - */
    74.8 -
    74.9 -package org.xenoserver.web;
   74.10 -
   74.11 -import org.xenoserver.control.Defaults;
   74.12 -
   74.13 -public class SystemConfigurationBean {
   74.14 -    private Defaults defaults;
   74.15 -
   74.16 -    public SystemConfigurationBean() {
   74.17 -        defaults = new Defaults();
   74.18 -    }
   74.19 -
   74.20 -    public Defaults getDefaults() {
   74.21 -        return defaults;
   74.22 -    }
   74.23 -}
    75.1 --- a/tools/control/web/WEB-INF/web.xml	Fri Nov 21 12:05:32 2003 +0000
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,20 +0,0 @@
    75.4 -<?xml version="1.0" encoding="ISO-8859-1" ?>
    75.5 -<!DOCTYPE web-app PUBLIC
    75.6 -          "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    75.7 -          "http://java.sun.com/dtd/web-app_2_3.dtd">
    75.8 -
    75.9 -<web-app>
   75.10 -  <display-name>Xen Control</display-name>
   75.11 -  <description>
   75.12 -    Copyright 2003, University of Cambridge Computer Laboratory
   75.13 -    This is version 1.0-beta of the Xen control software.
   75.14 -  </description>
   75.15 -  <welcome-file-list>
   75.16 -    <welcome-file>index.jsp</welcome-file>
   75.17 -  </welcome-file-list>
   75.18 -
   75.19 -  <session-config>
   75.20 -    <session-timeout>30</session-timeout>
   75.21 -  </session-config>
   75.22 -
   75.23 -</web-app>
    76.1 Binary file tools/control/web/img/cambridge.gif has changed
    77.1 Binary file tools/control/web/img/help.gif has changed
    78.1 Binary file tools/control/web/img/home.gif has changed
    79.1 Binary file tools/control/web/img/pixel.gif has changed
    80.1 Binary file tools/control/web/img/search.gif has changed
    81.1 Binary file tools/control/web/img/xeno.gif has changed
    82.1 --- a/tools/control/web/tmpl/about.tmpl	Fri Nov 21 12:05:32 2003 +0000
    82.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.3 @@ -1,71 +0,0 @@
    82.4 -About
    82.5 -SECTION&XenoServers
    82.6 -
    82.7 -<!-- content -->
    82.8 -<img src="img/pixel.gif" class="block" width="1" height="12" alt="">
    82.9 -<table cellpadding="0" cellspacing="0" border="0" summary="page content">
   82.10 -<tbody><tr>
   82.11 -   <td width="250" valign="top" align="right">
   82.12 -     <a href="http://www.cl.cam.ac.uk/xeno/"><img width="191" heigth="65" src="img/xeno.gif" border="0"></a>
   82.13 -
   82.14 -<table cellpadding="0" cellspacing="0" border="0" align="right">
   82.15 -<tbody><tr>
   82.16 -  <td><img src="img/pixel.gif" class="block" width="20" height="1" alt=""></td>
   82.17 -</tr>
   82.18 -<tr>
   82.19 -  <td colspan="3"><img src="img/pixel.gif" class="block" width="1" height="10" alt=""></td>
   82.20 -</tr>
   82.21 -<tr>
   82.22 -  <td align="right">
   82.23 -  <table width="180" ><tbody><tr><td><p align="right">
   82.24 -The XenoServer project aims to build a public infrastructure for wide-area distributed computing.
   82.25 -</p>
   82.26 -  </td></tr></tbody></table></td>
   82.27 -<td><img src="img/pixel.gif" class="block" width="10" height="1" alt=""></td>
   82.28 -</tr>
   82.29 -</tbody></table>
   82.30 -</td>
   82.31 -<td bgcolor="#666666" width="2"><img src="img/pixel.gif" class="block" width="2" height="50" alt=""></td>
   82.32 -<td width="20"><img src="img/pixel.gif" class="block" width="20" height="1" alt=""></td>
   82.33 -<td valign="top">
   82.34 -
   82.35 -<!-- main navigation -->
   82.36 -<table cellpadding="0" cellspacing="0" border="0">
   82.37 -
   82.38 -<tbody><tr><td><b>Overview</b><td></tr>
   82.39 -<tr>
   82.40 -  <td>
   82.41 -The Xenoserver project is building a public infrastructure for wide-area distributed computing. We envisage a world in which Xenoserver execution platforms will be scattered across the globe and available for any member of the public to submit code for execution. Crucially, the sponsor of the code will be billed for all the resources used or reserved during the course of execution. This will serve to encourage load balancing, limit congestion, and hopefully even make the platform self-financing.
   82.42 -<p>
   82.43 -A global infrastructure such as we propose is essential to address the fundamental problem of communication latency. By enabling principles to run programs at points throughout the network they can ensure that their code executes close to the entities with which it needs to interact. As well as reducing latency this can be used to avoid network bottlenecks, to reduce long-haul network charges and to provide a platform over which code provided by transiently-connected mobile devices can maintain a network presence.
   82.44 -<p>
   82.45 -Our approach is distinguished from existing work on mobile agents, execution platforms, code hosting and the like by two principles:
   82.46 -<p>
   82.47 -<b>Tackling difficult problems at the same time.</b> Acceptable designs for execution environments, resource management, resource discovery, authentication, privacy, charging, billing, payment and auditing are all crucial to the success of our platform as an infrastructure service open to and accepted by the public. Existing work has tackled individual subsets of these problems, but tensions between the issues concerned mean that solutions proficient in some dimension are lacking in another.
   82.48 -<p>
   82.49 -<b>No brave new world.</b> Our platform will host applications written in today's programming languages against existing APIs -- and, we believe, those written with tomorrow's languages and libraries. We do not want to mandate a particular code distribution format or a particular middleware toolkit for distributed programming.
   82.50 -</td>
   82.51 -</tr>
   82.52 -
   82.53 -<tr> <!-- blank white space -->
   82.54 -  <td><img src="img/pixel.gif" class="block" width="1" height="10" alt=""></td>
   82.55 -</tr>
   82.56 -
   82.57 -<tr> <!-- grey line -->
   82.58 -  <td bgcolor="#cccccc"><img src="img/pixel.gif" class="block" width="1" height="2" alt=""></td>
   82.59 -</tr>
   82.60 -
   82.61 -<tr> <!-- blank white space -->
   82.62 -  <td><img src="img/pixel.gif" class="block" width="1" height="10" alt=""></td>
   82.63 -</tr>
   82.64 -
   82.65 -<tr> <!-- list of menu items -->
   82.66 -  <td nowrap="nowrap">
   82.67 -   <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xeno/general-xeno.pdf" class="homemenu">Project Overview Document</a><br>
   82.68 -   </td>
   82.69 -</tr>
   82.70 -</tbody></table>
   82.71 -</td>
   82.72 -</tr>
   82.73 -</tbody></table>
   82.74 -<!-- end content -->
    83.1 --- a/tools/control/web/tmpl/dom-del.tmpl	Fri Nov 21 12:05:32 2003 +0000
    83.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.3 @@ -1,96 +0,0 @@
    83.4 -Delete Domain
    83.5 -SECTION&XenoServers
    83.6 -BREADCRUMB&Domain Manager&dom.jsp
    83.7 -
    83.8 -<!-- content -->
    83.9 -<img src="pixel.gif" class="block" width="1" height="12">
   83.10 -
   83.11 -<table cellpadding="0" cellspacing="0" border="0">
   83.12 -<tbody>
   83.13 -INCLUDE&dommenu.tmpl
   83.14 -<td valign="top">
   83.15 -
   83.16 -<form method="post" action="dom-delr.jsp">
   83.17 -<table cellpadding="0" cellspacing="0" border="0">
   83.18 -<tbody>
   83.19 -<tr><td>
   83.20 -<%
   83.21 -  CommandDomainList list = new CommandDomainList(sc.getDefaults());
   83.22 -  String output = list.executeWeb();
   83.23 -  Domain domains[] = list.domains();
   83.24 -  if (output != null)
   83.25 -  {
   83.26 -%>
   83.27 -<%= output %>
   83.28 -<%
   83.29 -  } else {
   83.30 -%>
   83.31 -
   83.32 -<table cellpadding="2" cellspacing="0" border="0">
   83.33 -<tbody>
   83.34 -  <tr class="vdh"><td></td><td>domain<br>id</td><td>processor</td><td>has<br>cpu</td><td>state</td><td>mcu<br>advance</td><td>total<br>pages</td><td>name</td></tr>
   83.35 -  <%
   83.36 -    for (int loop = 0; loop < domains.length; loop++)
   83.37 -    {
   83.38 -  %>
   83.39 -  <tr class="vdt">
   83.40 -    <td><input type="checkbox" name="dom" value="<%= domains[loop].id %>"></td>
   83.41 -    <td align="center"><%= domains[loop].id %></td>
   83.42 -    <td align="center"><%= domains[loop].processor %></td>
   83.43 -    <td align="center"><%= domains[loop].cpu %> </td>
   83.44 -    <td><%= domains[loop].state %> </td>
   83.45 -    <td align="center"><%= domains[loop].mcu %> </td>
   83.46 -    <td align="center"><%= domains[loop].pages %> </td>
   83.47 -    <td><%= domains[loop].name %> </td>
   83.48 -  </tr>
   83.49 -  <%
   83.50 -    }
   83.51 -  %>
   83.52 -
   83.53 -</tbody>
   83.54 -</table>
   83.55 -</td></tr>
   83.56 -
   83.57 -<%
   83.58 -  }
   83.59 -%>
   83.60 -
   83.61 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   83.62 -
   83.63 -<tr><td>
   83.64 -<table cellpadding="0" cellspacing="0" border="0">
   83.65 -<tbody>
   83.66 -
   83.67 -<tr>
   83.68 -  <td></td>
   83.69 -  <td class="menuheader">force immediate destruction?</td>
   83.70 -</tr>
   83.71 -<tr>
   83.72 -  <td> <input type="radio" name="force" value="false" checked></td>
   83.73 -  <td> don't force </td>
   83.74 -</tr>
   83.75 -<tr>
   83.76 -  <td> <input type="radio" name="force" value="true"></td>
   83.77 -  <td> force </td>
   83.78 -</tr>
   83.79 -</tbody>
   83.80 -</table>
   83.81 -</td></tr>
   83.82 -
   83.83 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   83.84 -
   83.85 -<tr>
   83.86 -  <td><input type="submit" name="action" value="delete domain"></td>
   83.87 -</tr>
   83.88 -</tbody>
   83.89 -</table>
   83.90 -</form>
   83.91 -
   83.92 -</td>
   83.93 -</tbody>
   83.94 -</table>
   83.95 -
   83.96 -
   83.97 -
   83.98 -
   83.99 -<!-- end content -->
    84.1 --- a/tools/control/web/tmpl/dom-delr.tmpl	Fri Nov 21 12:05:32 2003 +0000
    84.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.3 @@ -1,50 +0,0 @@
    84.4 -Delete Domain
    84.5 -SECTION&XenoServers
    84.6 -BREADCRUMB&Domain Manager&dom.jsp
    84.7 -
    84.8 -<!-- content -->
    84.9 -<img src="pixel.gif" class="block" width="1" height="12">
   84.10 -
   84.11 -<table cellpadding="0" cellspacing="0" border="0">
   84.12 -<tbody>
   84.13 -INCLUDE&dommenu.tmpl
   84.14 -<td valign="top">
   84.15 -
   84.16 -
   84.17 -<b>Delete Domain Results</b>
   84.18 -<br>
   84.19 -
   84.20 -<%
   84.21 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
   84.22 -  Defaults d = sc.getDefaults(); 
   84.23 -
   84.24 -  String domains[] = hsrw.getParameterValues("dom");
   84.25 -  boolean force = hsrw.getParameter("force").equals("true");
   84.26 -
   84.27 -  if (domains == null || domains.length == 0)
   84.28 -  {
   84.29 -%>
   84.30 -Error: no domain specified.<br>
   84.31 -<%
   84.32 -  }
   84.33 -  else
   84.34 -  {
   84.35 -    for (int i = 0; i < domains.length; i++)
   84.36 -    {
   84.37 -%>
   84.38 -result <%= domains[i] %> =
   84.39 - <%= new CommandDomainDestroy(d, Integer.parseInt(domains[i]),
   84.40 -                                    force).executeWeb() %> <br>
   84.41 -<%
   84.42 -    }
   84.43 -  }
   84.44 -%>
   84.45 -
   84.46 -</td>
   84.47 -</tbody>
   84.48 -</table>
   84.49 -
   84.50 -
   84.51 -
   84.52 -
   84.53 -<!-- end content -->
    85.1 --- a/tools/control/web/tmpl/dom-lis.tmpl	Fri Nov 21 12:05:32 2003 +0000
    85.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.3 @@ -1,58 +0,0 @@
    85.4 -Domain List
    85.5 -SECTION&XenoServers
    85.6 -BREADCRUMB&Domain Manager&dom.jsp
    85.7 -
    85.8 -<!-- content -->
    85.9 -<img src="pixel.gif" class="block" width="1" height="12">
   85.10 -
   85.11 -<table cellpadding="0" cellspacing="0" border="0">
   85.12 -<tbody>
   85.13 -INCLUDE&dommenu.tmpl
   85.14 -<td valign="top">
   85.15 -
   85.16 -<%
   85.17 -  CommandDomainList list = new CommandDomainList(sc.getDefaults());
   85.18 -  String output = list.executeWeb();
   85.19 -  Domain domains[] = list.domains();
   85.20 -  if (output != null)
   85.21 -  {
   85.22 -%>
   85.23 -<%= output %>
   85.24 -<%
   85.25 -  } else {
   85.26 -%>
   85.27 -
   85.28 -<table cellpadding="2" cellspacing="0" border="0">
   85.29 -<tbody>
   85.30 -  <tr class="vdh"><td>domain<br>id</td><td>processor</td><td>has<br>cpu</td><td>state</td><td>mcu<br>advance</td><td>total<br>pages</td><td>name</td></tr>
   85.31 -  <%
   85.32 -    /* assert: domains != null, otherwise, where is the servlet engine? */
   85.33 -    for (int loop = 0; loop < domains.length; loop++)
   85.34 -    {
   85.35 -  %>
   85.36 -  <tr>
   85.37 -    <td align="center"><%= domains[loop].id %></td>
   85.38 -    <td align="center"><%= domains[loop].processor %></td>
   85.39 -    <td align="center"><%= domains[loop].cpu %> </td>
   85.40 -    <td><%= domains[loop].state %> </td>
   85.41 -    <td align="center"><%= domains[loop].mcu %> </td>
   85.42 -    <td align="center"><%= domains[loop].pages %> </td>
   85.43 -    <td><%= domains[loop].name %> </td>
   85.44 -  </tr>
   85.45 -  <%
   85.46 -    }
   85.47 -  %>
   85.48 -</tbody>
   85.49 -</table>
   85.50 -<%
   85.51 -  }
   85.52 -%>
   85.53 -
   85.54 -</td>
   85.55 -</tbody>
   85.56 -</table>
   85.57 -
   85.58 -
   85.59 -
   85.60 -
   85.61 -<!-- end content -->
    86.1 --- a/tools/control/web/tmpl/dom-new.tmpl	Fri Nov 21 12:05:32 2003 +0000
    86.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.3 @@ -1,197 +0,0 @@
    86.4 -Create New Domain
    86.5 -SECTION&XenoServers
    86.6 -BREADCRUMB&Domain Manager&dom.jsp
    86.7 -
    86.8 -<!-- content -->
    86.9 -<img src="pixel.gif" class="block" width="1" height="12">
   86.10 -
   86.11 -<table cellpadding="0" cellspacing="0" border="0">
   86.12 -<tbody>
   86.13 -INCLUDE&dommenu.tmpl
   86.14 -<td valign="top">
   86.15 -
   86.16 -<form method="post" action="dom-newr.jsp">
   86.17 -<table cellpadding="0" cellspacing="0" border="0">
   86.18 -<tbody>
   86.19 -<tr>
   86.20 -  <td width="10"></td>
   86.21 -  <td></td>
   86.22 -  <td></td>
   86.23 -  <td width="7"></td>
   86.24 -  <td></td>
   86.25 -</tr>
   86.26 -
   86.27 -<tr>
   86.28 -  <td></td>
   86.29 -  <td class="block" colspan=4><b>Create A New Domain</b></td>
   86.30 -</tr>
   86.31 -
   86.32 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
   86.33 -
   86.34 -<%
   86.35 -  Defaults d = sc.getDefaults(); 
   86.36 -
   86.37 -  if (d == null)
   86.38 -  {
   86.39 -%>
   86.40 -  <b>ACK Defaults IS NULL</b>
   86.41 -<%
   86.42 -  }
   86.43 -%>
   86.44 -
   86.45 -<tr>
   86.46 -  <td></td>
   86.47 -  <td class="block" colspan=4>Domain Name</td>
   86.48 -</tr>
   86.49 -<tr>
   86.50 -  <td></td>  <td></td>  <td></td>  <td></td>
   86.51 -  <td> <input type="text" size="16" name="name" value="<%= d.domainName %>"> 
   86.52 -  </td>
   86.53 -</tr>
   86.54 -
   86.55 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
   86.56 -
   86.57 -<tr>
   86.58 -  <td></td>
   86.59 -  <td class="block" colspan=4>Memory Size</td>
   86.60 -</tr>
   86.61 -<tr>
   86.62 -  <td></td>  <td></td>  <td></td>  <td></td>
   86.63 -  <td> 
   86.64 -    <input type="text" size="5" name="size" value="<%= d.domainSizeKB %>"> KB 
   86.65 -  </td>
   86.66 -</tr>
   86.67 -
   86.68 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
   86.69 -
   86.70 -<tr>
   86.71 -  <td></td>
   86.72 -  <td class="block" colspan=4>Kernel Image</td>
   86.73 -</tr>
   86.74 -<tr>
   86.75 -  <td></td> 
   86.76 -  <td colspan=2 align="right">path</td>
   86.77 -  <td></td>
   86.78 -  <td> 
   86.79 -    <input type="text" size="40" name="image" value="<%= d.domainImage %>"> 
   86.80 -  </td>
   86.81 -</tr>
   86.82 -
   86.83 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
   86.84 -
   86.85 -<tr>
   86.86 -  <td></td>
   86.87 -  <td class="block" colspan=4>IP Config</td>
   86.88 -</tr>
   86.89 -<tr>
   86.90 -  <td></td> <td></td>
   86.91 -  <td class="block" align="right">VIFs</td>
   86.92 -  <td></td>
   86.93 -  <td> 
   86.94 -    <input type="text" size="4" name="vifs" value="<%= d.domainVIFs %>"> 
   86.95 -  </td>
   86.96 -</tr>
   86.97 -<tr>
   86.98 -  <td></td> <td></td>
   86.99 -  <td class="block" align="right">IP address</td>
  86.100 -  <td></td>
  86.101 -  <td> <input type="text" size="15" name="ip" value="<%= d.nwIP %>"> </td>
  86.102 -</tr>
  86.103 -<tr>
  86.104 -  <td></td>   <td></td> 
  86.105 -  <td class="block" align="right">Gateway</td>
  86.106 -  <td></td>
  86.107 -  <td> <input type="text" size="15" name="gw" value="<%= d.nwGateway %>"> </td>
  86.108 -</tr>
  86.109 -<tr>
  86.110 -  <td></td>   <td></td> 
  86.111 -  <td class="block" align="right">Netmask</td>
  86.112 -  <td></td>
  86.113 -  <td> <input type="text" size="15" name="mask" value="<%= d.nwMask %>"> </td>
  86.114 -</tr>
  86.115 -
  86.116 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
  86.117 -
  86.118 -<tr>
  86.119 -  <td></td>
  86.120 -  <td class="block" colspan=2>Root File System</td>
  86.121 -</tr>
  86.122 -
  86.123 -##WHITESPACE##
  86.124 -
  86.125 -<tr>
  86.126 -  <td></td>
  86.127 -  <td align="right">NFS<input type="radio" checked name="root" value="nfs"></td>
  86.128 -  <td align="right">path</td>
  86.129 -  <td></td>
  86.130 -  <td>
  86.131 -    <input type="text" size="40" name="nfsroot" value="<%= d.nwNFSRoot %>">
  86.132 -  </td>
  86.133 -</tr>
  86.134 -<tr>
  86.135 -  <td></td>  <td></td>
  86.136 -  <td align="right">server</td>
  86.137 -  <td></td>
  86.138 -  <td>
  86.139 -    <input type="text" size="15" name="nfsserver" value="<%= d.nwNFSServer%>">
  86.140 -  </td>
  86.141 -</tr>
  86.142 - ##WHITESPACE##
  86.143 -<tr>
  86.144 -  <td></td>
  86.145 -  <td align="right">ramdisk<input type="radio" name="root" value="ram"></td>
  86.146 -  <td align="right">path</td>
  86.147 -  <td></td>
  86.148 -  <td>
  86.149 -    <input type="text" size="40" name="rd" value="<%= d.domainInitRD %>">
  86.150 -  </td>
  86.151 -</tr>
  86.152 - ##WHITESPACE##
  86.153 -<tr>
  86.154 -  <td></td>
  86.155 -  <td align="right">physical disk<input type="radio" name="root" value="pdisk"></td>
  86.156 -  <td align="right">path</td>
  86.157 -  <td></td>
  86.158 -  <td><input type="text" size="40" name="pdisk" value="/dev/sda8"></td>
  86.159 -</tr>
  86.160 -<tr>
  86.161 -  <td></td>
  86.162 -  <td align="right">virtual disk<input type="radio" name="root" value="vdisk"></td>
  86.163 -  <td align="right">path</td>
  86.164 -  <td></td>
  86.165 -  <td><input type="text" size="40" name="vdisk" value="/dev/xvda1"></td>
  86.166 -</tr>
  86.167 -
  86.168 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
  86.169 -
  86.170 -<tr>
  86.171 -  <td></td>
  86.172 -  <td class="block" colspan=4>Extra Arguments</td>
  86.173 -</tr>
  86.174 -<tr>
  86.175 -  <td></td> 
  86.176 -  <td colspan=2 align="right"></td>
  86.177 -  <td></td>
  86.178 -  <td> <input type="text" size="40" name="args" value="<%= d.args %>"> </td>
  86.179 -</tr>
  86.180 -
  86.181 -
  86.182 -##WHITESPACE## ##GREYLINE14## ##WHITESPACE##
  86.183 -
  86.184 -<tr>
  86.185 -  <td></td>
  86.186 -  <td><input type="submit" value="create domain"></td>
  86.187 -</tr>
  86.188 -
  86.189 -</tbody>
  86.190 -</table>
  86.191 -</form>
  86.192 -
  86.193 -</td>
  86.194 -</tbody>
  86.195 -</table>
  86.196 -
  86.197 -
  86.198 -
  86.199 -
  86.200 -<!-- end content -->
    87.1 --- a/tools/control/web/tmpl/dom-newr.tmpl	Fri Nov 21 12:05:32 2003 +0000
    87.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.3 @@ -1,113 +0,0 @@
    87.4 -Create New Domain
    87.5 -SECTION&XenoServers
    87.6 -BREADCRUMB&Domain Manager&dom.jsp
    87.7 -
    87.8 -<!-- content -->
    87.9 -<img src="pixel.gif" class="block" width="1" height="12">
   87.10 -
   87.11 -<table cellpadding="0" cellspacing="0" border="0">
   87.12 -<tbody>
   87.13 -INCLUDE&dommenu.tmpl
   87.14 -<td valign="top">
   87.15 -
   87.16 -<b>Create Domain Results</b>
   87.17 -<br>
   87.18 -
   87.19 -<%
   87.20 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
   87.21 -  Defaults d = sc.getDefaults(); 
   87.22 -  String root_device = hsrw.getParameter("root");
   87.23 -
   87.24 -  String nfsroot = null;
   87.25 -  String nfsserver = null;
   87.26 -  String rd = null;
   87.27 -  String disk = null;
   87.28 -
   87.29 -  if (root_device.equals("nfs"))
   87.30 -  {
   87.31 -    nfsroot = hsrw.getParameter("nfsroot");
   87.32 -    nfsserver = hsrw.getParameter("nfsserver");
   87.33 -    disk = "/dev/nfs";
   87.34 -  }
   87.35 -  else if (root_device.equals("ram"))
   87.36 -  {
   87.37 -    nfsserver = hsrw.getParameter("nfsserver");
   87.38 -    rd = hsrw.getParameter("rd");
   87.39 -  }
   87.40 -  else if (root_device.equals("pdisk"))
   87.41 -  {
   87.42 -    nfsserver = hsrw.getParameter("nfsserver");
   87.43 -    disk = hsrw.getParameter("pdisk");
   87.44 -  }
   87.45 -  else if (root_device.equals("vdisk"))
   87.46 -  {
   87.47 -    nfsserver = hsrw.getParameter("nfsserver");
   87.48 -    disk = hsrw.getParameter("vdisk");
   87.49 -  }
   87.50 -
   87.51 -%>
   87.52 -name = <%= hsrw.getParameter("name") %>
   87.53 -<br>
   87.54 -size = <%= hsrw.getParameter("size") %>
   87.55 -<br>
   87.56 -image = <%= hsrw.getParameter("image") %>
   87.57 -<br>
   87.58 -initrd = <%= rd %>
   87.59 -<br>
   87.60 -vifs = <%= hsrw.getParameter("vifs") %>
   87.61 -<br>
   87.62 -bargs = <%= hsrw.getParameter("args") %>
   87.63 -<br>
   87.64 -nfs_root_path = <%= nfsroot %>
   87.65 -<br>
   87.66 -nw_ip = <%= hsrw.getParameter("ip") %>
   87.67 -<br>
   87.68 -nw_gw = <%= hsrw.getParameter("gw") %>
   87.69 -<br>
   87.70 -nw_mask = <%= hsrw.getParameter("mask") %>
   87.71 -<br>
   87.72 -nw_nfs_server = <%= nfsserver %>
   87.73 -<br>
   87.74 -nw_host = <%= hsrw.getParameter("hostname") %>
   87.75 -<br>
   87.76 -root = <%= disk %>
   87.77 -<br>
   87.78 -output = <br>
   87.79 -<%
   87.80 -  CommandDomainNew command_new = new CommandDomainNew(d,
   87.81 -                             hsrw.getParameter("name"),
   87.82 -                             Integer.parseInt(hsrw.getParameter("size")),
   87.83 -                             hsrw.getParameter("image"),
   87.84 -                             rd,
   87.85 -                             Integer.parseInt(hsrw.getParameter("vifs")),
   87.86 -                             hsrw.getParameter("args"),
   87.87 -                             disk,
   87.88 -                             nfsroot,
   87.89 -                             hsrw.getParameter("ip"),
   87.90 -                             hsrw.getParameter("gw"),
   87.91 -                             hsrw.getParameter("mask"),
   87.92 -                             nfsserver,
   87.93 -                             hsrw.getParameter("hostname"));
   87.94 -  String oneline = command_new.executeWeb();
   87.95 -  if ( oneline != null ) {
   87.96 -%>
   87.97 -<%= oneline %><br>
   87.98 -<%
   87.99 -  } else {
  87.100 -    String[] output = command_new.output();
  87.101 -    for (int i = 0; i < output.length; i++) {
  87.102 -%>
  87.103 -<%= output[i] %><br>
  87.104 -<%
  87.105 -    }
  87.106 -  }
  87.107 -%>
  87.108 -
  87.109 -</td>
  87.110 -</tbody>
  87.111 -</table>
  87.112 -
  87.113 -
  87.114 -
  87.115 -
  87.116 -<!-- end content -->
    88.1 --- a/tools/control/web/tmpl/dom-sta.tmpl	Fri Nov 21 12:05:32 2003 +0000
    88.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.3 @@ -1,73 +0,0 @@
    88.4 -Start Domain
    88.5 -SECTION&XenoServers
    88.6 -BREADCRUMB&Domain Manager&dom.jsp
    88.7 -
    88.8 -<!-- content -->
    88.9 -<img src="pixel.gif" class="block" width="1" height="12">
   88.10 -
   88.11 -<table cellpadding="0" cellspacing="0" border="0">
   88.12 -<tbody>
   88.13 -INCLUDE&dommenu.tmpl
   88.14 -<td valign="top">
   88.15 -
   88.16 -<form method="post" action="dom-star.jsp">
   88.17 -<table cellpadding="0" cellspacing="0" border="0">
   88.18 -<tbody>
   88.19 -<tr><td>
   88.20 -<%
   88.21 -  CommandDomainList list = new CommandDomainList(sc.getDefaults());
   88.22 -  String output = list.executeWeb();
   88.23 -  Domain domains[] = list.domains();
   88.24 -  if (output != null)
   88.25 -  {
   88.26 -%>
   88.27 -<%= output %>
   88.28 -<%
   88.29 -  } else {
   88.30 -%>
   88.31 -
   88.32 -<table cellpadding="2" cellspacing="0" border="0">
   88.33 -<tbody>
   88.34 -  <tr class="vdh"><td></td><td>domain<br>id</td><td>processor</td><td>has<br>cpu</td><td>state</td><td>mcu<br>advance</td><td>total<br>pages</td><td>name</td></tr>
   88.35 -  <%
   88.36 -    for (int loop = 0; loop < domains.length; loop++)
   88.37 -    {
   88.38 -  %>
   88.39 -  <tr class="vdt">
   88.40 -    <td><input type="checkbox" name="dom" value="<%= domains[loop].id %>"></td>
   88.41 -    <td align="center"><%= domains[loop].id %></td>
   88.42 -    <td align="center"><%= domains[loop].processor %></td>
   88.43 -    <td align="center"><%= domains[loop].cpu %> </td>
   88.44 -    <td><%= domains[loop].state %> </td>
   88.45 -    <td align="center"><%= domains[loop].mcu %> </td>
   88.46 -    <td align="center"><%= domains[loop].pages %> </td>
   88.47 -    <td><%= domains[loop].name %> </td>
   88.48 -  </tr>
   88.49 -  <%
   88.50 -    }
   88.51 -  %>
   88.52 -
   88.53 -</tbody>
   88.54 -</table>
   88.55 -</td></tr>
   88.56 -<%
   88.57 -  }
   88.58 -%>
   88.59 -
   88.60 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   88.61 -
   88.62 -<tr>
   88.63 -  <td><input type="submit" name="action" value="start domain"></td>
   88.64 -</tr>
   88.65 -</tbody>
   88.66 -</table>
   88.67 -</form>
   88.68 -
   88.69 -</td>
   88.70 -</tbody>
   88.71 -</table>
   88.72 -
   88.73 -
   88.74 -
   88.75 -
   88.76 -<!-- end content -->
    89.1 --- a/tools/control/web/tmpl/dom-star.tmpl	Fri Nov 21 12:05:32 2003 +0000
    89.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.3 @@ -1,48 +0,0 @@
    89.4 -Start Domain
    89.5 -SECTION&XenoServers
    89.6 -BREADCRUMB&Domain Manager&dom.jsp
    89.7 -
    89.8 -<!-- content -->
    89.9 -<img src="pixel.gif" class="block" width="1" height="12">
   89.10 -
   89.11 -<table cellpadding="0" cellspacing="0" border="0">
   89.12 -<tbody>
   89.13 -INCLUDE&dommenu.tmpl
   89.14 -<td valign="top">
   89.15 -
   89.16 -
   89.17 -<b>Start Domain Results</b>
   89.18 -<br>
   89.19 -
   89.20 -<%
   89.21 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
   89.22 -  Defaults d = sc.getDefaults(); 
   89.23 -
   89.24 -  String domains[] = hsrw.getParameterValues("dom");
   89.25 -
   89.26 -  if (domains == null || domains.length == 0)
   89.27 -  {
   89.28 -%>
   89.29 -Error: no domain specified.<br>
   89.30 -<%
   89.31 -  }
   89.32 -  else
   89.33 -  {
   89.34 -    for (int i = 0; i < domains.length; i++)
   89.35 -    {
   89.36 -%>
   89.37 -result <%= domains[i] %> =
   89.38 -<%= new CommandDomainStart(d, Integer.parseInt(domains[i])).executeWeb() %><br>
   89.39 -<%
   89.40 -    }
   89.41 -  }
   89.42 -%>
   89.43 -
   89.44 -</td>
   89.45 -</tbody>
   89.46 -</table>
   89.47 -
   89.48 -
   89.49 -
   89.50 -
   89.51 -<!-- end content -->
    90.1 --- a/tools/control/web/tmpl/dom-stp.tmpl	Fri Nov 21 12:05:32 2003 +0000
    90.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.3 @@ -1,73 +0,0 @@
    90.4 -Stop Domain
    90.5 -SECTION&XenoServers
    90.6 -BREADCRUMB&Domain Manager&dom.jsp
    90.7 -
    90.8 -<!-- content -->
    90.9 -<img src="pixel.gif" class="block" width="1" height="12">
   90.10 -
   90.11 -<table cellpadding="0" cellspacing="0" border="0">
   90.12 -<tbody>
   90.13 -INCLUDE&dommenu.tmpl
   90.14 -<td valign="top">
   90.15 -
   90.16 -<form method="post" action="dom-stpr.jsp">
   90.17 -<table cellpadding="0" cellspacing="0" border="0">
   90.18 -<tbody>
   90.19 -<tr><td>
   90.20 -<%
   90.21 -  CommandDomainList list = new CommandDomainList(sc.getDefaults());
   90.22 -  String output = list.executeWeb();
   90.23 -  Domain domains[] = list.domains();
   90.24 -  if (output != null)
   90.25 -  {
   90.26 -%>
   90.27 -<%= output %>
   90.28 -<%
   90.29 -  } else {
   90.30 -%>
   90.31 -
   90.32 -<table cellpadding="2" cellspacing="0" border="0">
   90.33 -<tbody>
   90.34 -  <tr class="vdh"><td></td><td>domain<br>id</td><td>processor</td><td>has<br>cpu</td><td>state</td><td>mcu<br>advance</td><td>total<br>pages</td><td>name</td></tr>
   90.35 -  <%
   90.36 -    for (int loop = 0; loop < domains.length; loop++)
   90.37 -    {
   90.38 -  %>
   90.39 -  <tr class="vdt">
   90.40 -    <td><input type="checkbox" name="dom" value="<%= domains[loop].id %>"></td>
   90.41 -    <td align="center"><%= domains[loop].id %></td>
   90.42 -    <td align="center"><%= domains[loop].processor %></td>
   90.43 -    <td align="center"><%= domains[loop].cpu %> </td>
   90.44 -    <td><%= domains[loop].state %> </td>
   90.45 -    <td align="center"><%= domains[loop].mcu %> </td>
   90.46 -    <td align="center"><%= domains[loop].pages %> </td>
   90.47 -    <td><%= domains[loop].name %> </td>
   90.48 -  </tr>
   90.49 -  <%
   90.50 -    }
   90.51 -  %>
   90.52 -
   90.53 -</tbody>
   90.54 -</table>
   90.55 -</td></tr>
   90.56 -<%
   90.57 -  }
   90.58 -%>
   90.59 -
   90.60 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   90.61 -
   90.62 -<tr>
   90.63 -  <td><input type="submit" name="action" value="stop domain"></td>
   90.64 -</tr>
   90.65 -</tbody>
   90.66 -</table>
   90.67 -</form>
   90.68 -
   90.69 -</td>
   90.70 -</tbody>
   90.71 -</table>
   90.72 -
   90.73 -
   90.74 -
   90.75 -
   90.76 -<!-- end content -->
    91.1 --- a/tools/control/web/tmpl/dom-stpr.tmpl	Fri Nov 21 12:05:32 2003 +0000
    91.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.3 @@ -1,48 +0,0 @@
    91.4 -Stop Domain
    91.5 -SECTION&XenoServers
    91.6 -BREADCRUMB&Domain Manager&dom.jsp
    91.7 -
    91.8 -<!-- content -->
    91.9 -<img src="pixel.gif" class="block" width="1" height="12">
   91.10 -
   91.11 -<table cellpadding="0" cellspacing="0" border="0">
   91.12 -<tbody>
   91.13 -INCLUDE&dommenu.tmpl
   91.14 -<td valign="top">
   91.15 -
   91.16 -
   91.17 -<b>Stop Domain Results</b>
   91.18 -<br>
   91.19 -
   91.20 -<%
   91.21 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
   91.22 -  Defaults d = sc.getDefaults(); 
   91.23 -
   91.24 -  String domains[] = hsrw.getParameterValues("dom");
   91.25 -
   91.26 -  if (domains == null || domains.length == 0)
   91.27 -  {
   91.28 -%>
   91.29 -Error: no domain specified.<br>
   91.30 -<%
   91.31 -  }
   91.32 -  else
   91.33 -  {
   91.34 -    for (int i = 0; i < domains.length; i++)
   91.35 -    {
   91.36 -%>
   91.37 -result <%= domains[i] %> =
   91.38 -<%= new CommandDomainStop(d, Integer.parseInt(domains[i])).executeWeb() %><br>
   91.39 -<%
   91.40 -    }
   91.41 -  }
   91.42 -%>
   91.43 -
   91.44 -</td>
   91.45 -</tbody>
   91.46 -</table>
   91.47 -
   91.48 -
   91.49 -
   91.50 -
   91.51 -<!-- end content -->
    92.1 --- a/tools/control/web/tmpl/dom.tmpl	Fri Nov 21 12:05:32 2003 +0000
    92.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.3 @@ -1,30 +0,0 @@
    92.4 -Domain Manager
    92.5 -SECTION&XenoServers
    92.6 -
    92.7 -<!-- content -->
    92.8 -<img src="pixel.gif" class="block" width="1" height="12">
    92.9 -
   92.10 -<table cellpadding="0" cellspacing="0" border="0">
   92.11 -<tbody>
   92.12 -INCLUDE&dommenu.tmpl
   92.13 -<td valign="top">
   92.14 -<table cellpadding="0" cellspacing="0" border="0">
   92.15 -<tbody>
   92.16 -<%
   92.17 -  Defaults d = sc.getDefaults(); 
   92.18 -%>
   92.19 -  <tr><td nowrap="nowrap">Domain Manager</td></tr>
   92.20 -  <tr><td></td></tr>
   92.21 -<!--
   92.22 -  <tr><td><%= d.xiToolsDir %></td></tr>
   92.23 --->
   92.24 -</tbody>
   92.25 -</table>
   92.26 -</td>
   92.27 -</tbody>
   92.28 -</table>
   92.29 -
   92.30 -
   92.31 -
   92.32 -
   92.33 -<!-- end content -->
    93.1 --- a/tools/control/web/tmpl/dommenu.tmpl	Fri Nov 21 12:05:32 2003 +0000
    93.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.3 @@ -1,33 +0,0 @@
    93.4 -<td width="10" valign="top" align="right"></td>
    93.5 -
    93.6 -<td valign="top">
    93.7 -<table cellpadding="0" cellspacing="0" border="0">
    93.8 -<tbody>
    93.9 -<tr>
   93.10 -  <td class="menuheader" width="100">Domains</td>
   93.11 -</tr>
   93.12 -<tr>
   93.13 -  <td class="sidemenu" width="100"><a href="dom-lis.jsp">List</a></td>
   93.14 -</tr>
   93.15 -<tr>
   93.16 -  <td class="sidemenu" width="100"><a href="dom-new.jsp">New</a></td>
   93.17 -</tr>
   93.18 -<tr>
   93.19 -  <td class="sidemenu" width="100"><a href="dom-sta.jsp">Start</a></td>
   93.20 -</tr>
   93.21 -<tr>
   93.22 -  <td class="sidemenu" width="100"><a href="dom-stp.jsp">Stop</a></td>
   93.23 -</tr>
   93.24 -<tr>
   93.25 -  <td class="sidemenu" width="100"><a href="dom-del.jsp">Delete</a></td>
   93.26 -</tr>
   93.27 -
   93.28 -</tbody>
   93.29 -</table>
   93.30 -</td>
   93.31 -
   93.32 -<td width="5" valign="top" align="right"></td>
   93.33 -
   93.34 -<td bgcolor="#666666" width="2"><img src="img/pixel.gif" class="block" width="2" height="50"></td>
   93.35 -
   93.36 -<td width="15" valign="top" align="right"></td>
    94.1 --- a/tools/control/web/tmpl/help.tmpl	Fri Nov 21 12:05:32 2003 +0000
    94.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.3 @@ -1,61 +0,0 @@
    94.4 -Help
    94.5 -SECTION&XenoServers
    94.6 -
    94.7 -<!-- content -->
    94.8 -<img src="img/pixel.gif" class="block" width="1" height="12" alt="">
    94.9 -<table cellpadding="0" cellspacing="0" border="0" summary="page content">
   94.10 -<tbody><tr>
   94.11 -   <td width="250" valign="top" align="right">
   94.12 -     <a href="http://www.cl.cam.ac.uk/newlabphotos/"><img width="191" heigth="65" src="img/xeno.gif" border="0"></a>
   94.13 -
   94.14 -<table cellpadding="0" cellspacing="0" border="0" align="right">
   94.15 -<tbody><tr>
   94.16 -  <td><img src="img/pixel.gif" class="block" width="20" height="1" alt=""></td>
   94.17 -</tr>
   94.18 -<tr>
   94.19 -  <td colspan="3"><img src="img/pixel.gif" class="block" width="1" height="10" alt=""></td>
   94.20 -</tr>
   94.21 -<tr>
   94.22 -  <td align="right">
   94.23 -  <table width="180" ><tbody><tr><td><p align="right">
   94.24 -The XenoServer project aims to build a public infrastructure for wide-area distributed computing.
   94.25 -</p>
   94.26 -  </td></tr></tbody></table></td>
   94.27 -<td><img src="img/pixel.gif" class="block" width="10" height="1" alt=""></td>
   94.28 -</tr>
   94.29 -</tbody></table>
   94.30 -</td>
   94.31 -<td bgcolor="#666666" width="2"><img src="img/pixel.gif" class="block" width="2" height="50" alt=""></td>
   94.32 -<td width="20"><img src="img/pixel.gif" class="block" width="20" height="1" alt=""></td>
   94.33 -<td valign="top">
   94.34 -
   94.35 -<!-- main navigation -->
   94.36 -<table cellpadding="0" cellspacing="0" border="0">
   94.37 -
   94.38 -<tbody><tr> <!-- list of menu items -->
   94.39 -  <td nowrap="nowrap">
   94.40 -    <b>Help</b>
   94.41 -</td>
   94.42 -</tr>
   94.43 -
   94.44 -<tr> <!-- blank white space -->
   94.45 -  <td><img src="img/pixel.gif" class="block" width="1" height="10" alt=""></td>
   94.46 -</tr>
   94.47 -
   94.48 -<tr> <!-- grey line -->
   94.49 -  <td bgcolor="#cccccc"><img src="img/pixel.gif" class="block" width="1" height="2" alt=""></td>
   94.50 -</tr>
   94.51 -
   94.52 -<tr> <!-- blank white space -->
   94.53 -  <td><img src="img/pixel.gif" class="block" width="1" height="10" alt=""></td>
   94.54 -</tr>
   94.55 -
   94.56 -<tr> <!-- list of menu items -->
   94.57 -  <td nowrap="nowrap">Some help text will go here.
   94.58 -   </td>
   94.59 -</tr>
   94.60 -</tbody></table>
   94.61 -</td>
   94.62 -</tr>
   94.63 -</tbody></table>
   94.64 -<!-- end content -->
    95.1 --- a/tools/control/web/tmpl/index.tmpl	Fri Nov 21 12:05:32 2003 +0000
    95.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.3 @@ -1,67 +0,0 @@
    95.4 -XenoServers
    95.5 -COPYRIGHT&Computer Laboratory, University of Cambridge
    95.6 -
    95.7 -<!-- content -->
    95.8 -<img src="img/pixel.gif" class="block" width="1" height="12" alt="">
    95.9 -<table cellpadding="0" cellspacing="0" border="0" summary="page content">
   95.10 -<tbody><tr>
   95.11 -   <td width="250" valign="top" align="right">
   95.12 -     <a href="http://www.cl.cam.ac.uk/xeno"><img width="191" heigth="65" src="img/xeno.gif" border="0"></a>
   95.13 -
   95.14 -<table cellpadding="0" cellspacing="0" border="0" align="right">
   95.15 -<tbody>
   95.16 -<tr>
   95.17 -  <td><img src="img/pixel.gif" class="block" width="20" height="1" alt=""></td>
   95.18 -</tr>
   95.19 -<tr>
   95.20 -  <td colspan="2"><img src="img/pixel.gif" class="block" width="1" height="10" alt=""></td>
   95.21 -</tr>
   95.22 -<tr>
   95.23 -  <td align="right">
   95.24 -  <table width="180" ><tbody><tr><td><p align="right">
   95.25 -    The XenoServer project aims to build a public infrastructure 
   95.26 -    for wide-area distributed computing.
   95.27 -  </td></tr></tbody></table></td>
   95.28 -<td><img src="img/pixel.gif" class="block" width="10" height="1" alt=""></td>
   95.29 -</tr>
   95.30 -</tbody></table>
   95.31 -</td>
   95.32 -<td bgcolor="#666666" width="2"><img src="img/pixel.gif" class="block" width="2" height="50" alt=""></td>
   95.33 -<td width="20"><img src="img/pixel.gif" class="block" width="20" height="1" alt=""></td>
   95.34 -<td valign="top">
   95.35 -
   95.36 -<!-- main navigation -->
   95.37 -<table cellpadding="0" cellspacing="0" border="0">
   95.38 -
   95.39 -<tbody><tr> <!-- list of menu items -->
   95.40 -  <td nowrap="nowrap">
   95.41 -   <a href="about.jsp" class="homemenu">About the XenoServers Project</a><br>
   95.42 -</td>
   95.43 -</tr>
   95.44 -
   95.45 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   95.46 -
   95.47 -<tr>
   95.48 -  <td nowrap="nowrap">
   95.49 -   <a href="dom.jsp" class="homemenu">Domain Manager</a><br>
   95.50 -   <a href="vd.jsp" class="homemenu">Virtual Disk Manager</a><br>
   95.51 -   <a href="pd.jsp" class="homemenu">Physical Disk Manager</a><br>
   95.52 -   </td>
   95.53 -</tr>
   95.54 -
   95.55 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   95.56 -
   95.57 -<tr>
   95.58 -  <td nowrap="nowrap">
   95.59 -    For additional information, click 
   95.60 -    <a href="http://www.xenoserver.org">here</a>
   95.61 -  </td>
   95.62 -</tr>
   95.63 -
   95.64 -
   95.65 -##WHITESPACE##
   95.66 -</tbody></table>
   95.67 -</td>
   95.68 -</tr>
   95.69 -</tbody></table>
   95.70 -<!-- end content -->
    96.1 --- a/tools/control/web/tmpl/install.pl	Fri Nov 21 12:05:32 2003 +0000
    96.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.3 @@ -1,236 +0,0 @@
    96.4 -#!/usr/bin/perl5
    96.5 -if($#ARGV<0) {
    96.6 -    &usage();
    96.7 -} else {
    96.8 -
    96.9 -    $headerfile = "xenohead.def" ;
   96.10 -    $footerfile = "xenofoot.def" ;
   96.11 -
   96.12 -    $sectionbreak = "-" ;
   96.13 -    $supress_section = 0 ;
   96.14 -    $homepage = 0 ;
   96.15 -    $navigationwidth = 106;
   96.16 -    $navigationstring = "<td><a href=\"index.jsp\"><img src=\"img/home.gif\" width=\"53\" height=\"18\" border=\"0\" alt=\"XenoServers Home Page\" class=\"block\" /></a></td>";
   96.17 -    $whitespace = "<tr><td><img src=\"img/pixel.gif\" class=\"block\" width=\"1\" height=\"10\"></td></tr>";
   96.18 -    $greyline1 = "<tr><td bgcolor=\"#cccccc\"><img src=\"img/pixel.gif\" class=\"block\" width=\"1\" height=\"2\"></td></tr>";
   96.19 -    $greyline2 = "<tr><td bgcolor=\"#cccccc\" colspan=\"2\"><img src=\"img/pixel.gif\" class=\"block\" width=\"1\" height=\"2\"></td></tr>";
   96.20 -    $greyline3 = "<tr><td bgcolor=\"#cccccc\" colspan=\"3\"><img src=\"img/pixel.gif\" class=\"block\" width=\"1\" height=\"2\"></td></tr>";
   96.21 -    $greyline4 = "<tr><td bgcolor=\"#cccccc\" colspan=\"4\"><img src=\"img/pixel.gif\" class=\"block\" width=\"1\" height=\"2\"></td></tr>";
   96.22 -    $greyline14 = "<tr><td></td><td bgcolor=\"#cccccc\" colspan=\"4\"><img src=\"img/pixel.gif\" class=\"block\" width=\"1\" height=\"2\"></td></tr>";
   96.23 -
   96.24 -
   96.25 -    $login = getlogin || (getpwuid($<))[0] || "an unidentified user" ;
   96.26 -
   96.27 -    $name =`finger $login | sed -n "s/Login.*:.*: //p"` ;
   96.28 -    if( $name eq "" ) { $name = $login ; }
   96.29 -
   96.30 -    $date =  `date +"on %-e-%b-%Y at %H:%M"` ;
   96.31 -
   96.32 -    $year =  `date +"%Y"` ;
   96.33 -
   96.34 -    foreach $ag (@ARGV) {
   96.35 -
   96.36 -	if( $ag =~ "^-s" ) {
   96.37 -	    $supress_section = 1 ;
   96.38 -	}
   96.39 -	elsif( $ag =~ "^-home" ) {
   96.40 -	    $homepage = 1 ;
   96.41 -	}
   96.42 -	else {
   96.43 -
   96.44 -	    $preagtmp = $ag . ".tmpl~$$";
   96.45 -            $agtmp    = $ag . ".jsp~$$";
   96.46 -
   96.47 -	    open(PRETMPL,">$preagtmp") or die "Unable to write $preagtmp\n";
   96.48 -	    print PRETMPL &doIncludes("$ag.tmpl");
   96.49 -	    close(PRETMPL);
   96.50 -
   96.51 -	    open(TMPL,"<$preagtmp") or die "Unable to read $preagtmp\n";
   96.52 -
   96.53 -	    open(HTML,">$agtmp") or die "Unable to open $agtmp\n" ;
   96.54 -
   96.55 -	    $title=<TMPL> ;
   96.56 -
   96.57 -	    $sectionhead = "XenoServers" ;
   96.58 -	    $copyright = "Computer Laboratory, University of Cambridge" ;
   96.59 -	    $breadcrumbline = "" ;
   96.60 -	    $commentcontact="<a href=\"mailto:pagemaster\@cl.cam.ac.uk\">pagemaster\@cl.cam.ac.uk</a>" ;
   96.61 -
   96.62 -	    $process_headings = 1 ;
   96.63 -	    $tmp=<TMPL> ;
   96.64 -	    while( $process_headings ) {
   96.65 -		$process_headings = 0 ;
   96.66 -
   96.67 -		if( $tmp =~ /^SECTION&(.*)$/ ) {
   96.68 -		    $sectionhead=$1 ;
   96.69 -		    $process_headings = 1 ;
   96.70 -		}
   96.71 -
   96.72 -		if( $tmp =~ /^COMMENTS&(.*)$/ ) {
   96.73 -		    $commentcontact=$1 ;
   96.74 -		    $process_headings = 1 ;
   96.75 -		}
   96.76 -
   96.77 -		if( $tmp =~ /^COPYRIGHT&(.*)$/ ) {
   96.78 -		    $copyright=$1 ;
   96.79 -		    $process_headings = 1 ;
   96.80 -		}
   96.81 -
   96.82 -		if( $tmp =~ /^HEADERFILE&(.*)$/ ) {
   96.83 -		    $headerfile=$1 ;
   96.84 -		    $process_headings = 1 ;
   96.85 -		}
   96.86 -
   96.87 -		if( $tmp =~ /^FOOTERFILE&(.*)$/ ) {
   96.88 -		    $footerfile=$1 ;
   96.89 -		    $process_headings = 1 ;
   96.90 -		}
   96.91 -
   96.92 -		if( $tmp =~ /BREADCRUMB&.*/ ) {
   96.93 -		    @bread=split(/&/,$tmp) ;
   96.94 -		    @bwords=split(/ /, @bread[1]) ;
   96.95 -		    $bname=@bwords[0] ;
   96.96 -		    for( $i=1 ; $i <= $#bwords ; $i++ ){
   96.97 -			$bname = $bname . "&nbsp;" . @bwords[$i] ;
   96.98 -		    }
   96.99 -		    $breadcrumbline = $breadcrumbline . "&nbsp;&gt;&nbsp;<a href=\"" . @bread[2] . "\"class=\"bread\">" . $bname . "</a>" ; 
  96.100 -		    $process_headings = 1 ;
  96.101 -		}
  96.102 -
  96.103 -		if( $process_headings ) {
  96.104 -		    $tmp=<TMPL> ;
  96.105 -		}
  96.106 -	    }
  96.107 -
  96.108 -#### generate the final breadcrumb which is the current file itself
  96.109 -	    @path=split(/\//, $ag) ;
  96.110 -	    $localfilename=@path[$#path] . ".jsp" ;
  96.111 -	    @bwords=split(/ /, $title) ;
  96.112 -	    $bname=@bwords[0] ;
  96.113 -	    for( $i=1 ; $i <= $#bwords ; $i++ ){
  96.114 -		$bname = $bname . "&nbsp;" . @bwords[$i] ;
  96.115 -	    }
  96.116 -	    $breadcrumbline = $breadcrumbline . "&nbsp;&gt;&nbsp;<a href=\"" . $localfilename . "\" class=\"bread\">" . $bname . "</a>" ; 
  96.117 -
  96.118 -
  96.119 -#### if suppressing the section header then do so now
  96.120 -	    if( $supress_section ) {
  96.121 -		$sectionhead = "" ;
  96.122 -		$sectionbreak = "" ;
  96.123 -	    }
  96.124 -
  96.125 -#### if homepage then do so now
  96.126 -	    if( $homepage ) {
  96.127 -		$breadcrumbline = "" ;
  96.128 -                $navigationwidth = 53;
  96.129 -                $navigationstring = "";
  96.130 -	    }
  96.131 -
  96.132 -
  96.133 -	    open(HEADER,"<$headerfile") or die "Unable to open $headerfile\n" ;
  96.134 -	    while(<HEADER>) {
  96.135 -		s/##TITLE##/$title/g ;
  96.136 -		s/##SECTION##/$sectionhead/g ;
  96.137 -		s/##SECTIONBREAK##/$sectionbreak/g ;
  96.138 -		s/##BREADCRUMBS##/$breadcrumbline/g ;
  96.139 -		s/##FILENAME##/$ag.jsp/g ;
  96.140 -		s/##DATE##/$date/g ;
  96.141 -		s/##OWNERNAME##/$name/g ;
  96.142 -		s/##OWNERUSERID##/$login/g ;
  96.143 -		s/##OWNEREMAIL##/$login\@cl.cam.ac.uk/g ;
  96.144 -		s/##COMMENTCONTACT##/$commentcontact/g ;
  96.145 -		s/##COPYRIGHT##/$copyright/g ;
  96.146 -		s/##YEAR##/$year/g ;
  96.147 -		s/##NAVIGATIONWIDTH##/$navigationwidth/g ;
  96.148 -		s/##NAVIGATIONSTRING##/$navigationstring/g ;
  96.149 -		print HTML $_ ;
  96.150 -	    }
  96.151 -	    close(HEADER) ;
  96.152 -
  96.153 -	    $_ = $tmp ;
  96.154 -	    while(defined($_)) {
  96.155 -		s/##LISTSTART##/<ul>/g ;
  96.156 -		s/##ITEMHEAD##/<li>/g ;
  96.157 -		s/##ITEMBODY##/<br \/>/g ;
  96.158 -		s|##LISTEND##|</ul>|g ;
  96.159 -		s/##TITLE##/$title/g ;
  96.160 -		s/##SECTION##/$sectionhead/g ;
  96.161 -		s/##BREADCRUMBS##/$breadcrumbline/g ;
  96.162 -		s/##FILENAME##/$ag.jsp/g ;
  96.163 -		s/##DATE##/$date/g ;
  96.164 -		s/##OWNERNAME##/$name/g ;
  96.165 -		s/##OWNERUSERID##/$login/g ;
  96.166 -		s/##OWNEREMAIL##/$login\@cl.cam.ac.uk/g ;
  96.167 -		s/##COMMENTCONTACT##/$commentcontact/g ;
  96.168 -		s/##COPYRIGHT##/$copyright/g ;
  96.169 -		s/##YEAR##/$year/g ;
  96.170 -		s/##WHITESPACE##/$whitespace/g ;
  96.171 -		s/##GREYLINE1##/$greyline1/g ;
  96.172 -		s/##GREYLINE2##/$greyline2/g ;
  96.173 -		s/##GREYLINE3##/$greyline3/g ;
  96.174 -		s/##GREYLINE4##/$greyline4/g ;
  96.175 -		s/##GREYLINE14##/$greyline14/g ;
  96.176 -		print HTML $_ ;
  96.177 -		$_ = <TMPL>
  96.178 -		}
  96.179 -	    open(FOOTER,"<$footerfile") or die "Unable to open $footerfile\n" ;
  96.180 -	    while(<FOOTER>) {
  96.181 -		s/##TITLE##/$title/g ;
  96.182 -		s/##SECTION##/$sectionhead/g ;
  96.183 -		s/##BREADCRUMBS##/$breadcrumbline/g ;
  96.184 -		s/##FILENAME##/$ag.jsp/g ;
  96.185 -		s/##DATE##/$date/g ;
  96.186 -		s/##OWNERNAME##/$name/g ;
  96.187 -		s/##OWNERUSERID##/$login/g ;
  96.188 -		s/##OWNEREMAIL##/$login\@cl.cam.ac.uk/g ;
  96.189 -		s/##COMMENTCONTACT##/$commentcontact/g ;
  96.190 -		s/##COPYRIGHT##/$copyright/g ;
  96.191 -		s/##YEAR##/$year/g ;
  96.192 -		print HTML $_ ;
  96.193 -	    }
  96.194 -	    close(FOOTER) ;
  96.195 -	    close(HTML);
  96.196 -	    close(TMPL);
  96.197 -
  96.198 -	    if( system "mv $agtmp $ag.jsp" ) {
  96.199 -		die "Unable to rename $agtmp to $ag.jsp\n" ; ;
  96.200 -	    }
  96.201 -	    if( system "rm $preagtmp" ) {
  96.202 -		die "Unable to remove $preagtmp\n" ; ;
  96.203 -	    }
  96.204 -	}
  96.205 -    }
  96.206 -}
  96.207 -
  96.208 -sub usage
  96.209 -{
  96.210 -    print "Usage: install.pl [-s] <name>\n";
  96.211 -    print "       Installs web page <name>.jsp based on <name>.tmpl\n";
  96.212 -    print "       -s supresses the generation of any section title";
  96.213 -    print "          which says `Computer Laboratory' in the default" ;
  96.214 -    print "          case or is specified by SECTION& in the .tmpl file" ;
  96.215 -    exit;
  96.216 -}
  96.217 -
  96.218 -sub doIncludes
  96.219 -{
  96.220 -    my $infile=$_[0];
  96.221 -    my $out="";
  96.222 -    my $tmp;
  96.223 -    my $incfile;
  96.224 -    my @lines;
  96.225 -    my $line;
  96.226 -
  96.227 -    open(FIN,"<$infile") or die "doIncludes unable to read from $infile\n";
  96.228 -    @lines=<FIN>;
  96.229 -    close(FIN);
  96.230 -    foreach $line (@lines) {
  96.231 -	if( $line =~ /^INCLUDE&.*/ ) {
  96.232 -	    ($tmp,$incfile) = split(/&/,$line);
  96.233 -	    $out=$out.&doIncludes($incfile);
  96.234 -	} else {
  96.235 -	    $out=$out.$line;
  96.236 -	}
  96.237 -    }
  96.238 -    return $out;
  96.239 -}
    97.1 --- a/tools/control/web/tmpl/makefile	Fri Nov 21 12:05:32 2003 +0000
    97.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.3 @@ -1,41 +0,0 @@
    97.4 -src0 = xenostyle.css
    97.5 -src1 = index.jsp about.jsp help.jsp vd.jsp \
    97.6 -       vd-pv.jsp vd-pa.jsp vd-vdv.jsp vd-vdc.jsp vd-vdd.jsp vd-vdr.jsp \
    97.7 -       vd-fv.jsp vd-vbdv.jsp vd-vbdc.jsp \
    97.8 -       vd-par.jsp vd-vdcr.jsp vd-vddr.jsp vd-vdrr.jsp vd-vbdcr.jsp \
    97.9 -       dom.jsp dom-lis.jsp dom-new.jsp dom-newr.jsp dom-sta.jsp dom-star.jsp \
   97.10 -       dom-stp.jsp dom-stpr.jsp dom-del.jsp dom-delr.jsp \
   97.11 -       pd.jsp pd-g.jsp pd-gr.jsp pd-l.jsp pd-r.jsp pd-rr.jsp
   97.12 -target = ..
   97.13 -target0 = $(target)/xenostyle.css
   97.14 -target1 = $(target)/index.jsp $(target)/vd.jsp \
   97.15 -          $(target)/vd-pv.jsp $(target)/vd-pa.jsp $(target)/vd-vdv.jsp \
   97.16 -          $(target)/vd-vdc.jsp $(target)/vd-vdd.jsp $(target)/vd-vdr.jsp \
   97.17 -          $(target)/vd-fv.jsp $(target)/vd-vbdv.jsp $(target)/vd-vbdc.jsp \
   97.18 -          $(target)/about.jsp $(target)/help.jsp \
   97.19 -          $(target)/vd-par.jsp $(target)/vd-vdcr.jsp $(target)/vd-vddr.jsp \
   97.20 -          $(target)/vd-vdrr.jsp $(target)/vd-vbdcr.jsp \
   97.21 -          $(target)/dom.jsp $(target)/dom-lis.jsp $(target)/dom-new.jsp \
   97.22 -          $(target)/dom-newr.jsp $(target)/dom-sta.jsp $(target)/dom-star.jsp \
   97.23 -          $(target)/dom-stp.jsp $(target)/dom-stpr.jsp \
   97.24 -          $(target)/dom-del.jsp $(target)/dom-delr.jsp \
   97.25 -          $(target)/pd.jsp $(target)/pd-g.jsp $(target)/pd-gr.jsp \
   97.26 -          $(target)/pd-l.jsp $(target)/pd-r.jsp $(target)/pd-rr.jsp
   97.27 -
   97.28 -.SUFFIXES: .tmpl .jsp
   97.29 -
   97.30 -all: $(target1) $(target0)
   97.31 -
   97.32 -$(target)/index.jsp: index.tmpl
   97.33 -	./install.pl -s -home index
   97.34 -	mv index.jsp $(target)
   97.35 -
   97.36 -$(target)/%.jsp: %.tmpl xenofoot.def xenohead.def
   97.37 -	./install.pl $*
   97.38 -	mv $*.jsp $(target)
   97.39 -	
   97.40 -$(target0): $(src0)
   97.41 -	cp -f $(src0) $(target)
   97.42 -
   97.43 -clean:
   97.44 -	rm -f $(target1) $(target0)
    98.1 --- a/tools/control/web/tmpl/pd-g.tmpl	Fri Nov 21 12:05:32 2003 +0000
    98.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.3 @@ -1,99 +0,0 @@
    98.4 -Grant Access
    98.5 -SECTION&XenoServers
    98.6 -BREADCRUMB&Physical Disk Manager&pd.jsp
    98.7 -
    98.8 -<!-- content -->
    98.9 -<img src="pixel.gif" class="block" width="1" height="12">
   98.10 -
   98.11 -<table cellpadding="0" cellspacing="0" border="0">
   98.12 -<tbody>
   98.13 -INCLUDE&pdmenu.tmpl
   98.14 -<td valign="top">
   98.15 -
   98.16 -<form method="post" action="pd-gr.jsp">
   98.17 -<table cellpadding="0" cellspacing="0" border="0">
   98.18 -<tbody>
   98.19 -
   98.20 -<tr><td>
   98.21 -
   98.22 -<table cellpadding="2" cellspacing="0" border="0">
   98.23 -<tbody>
   98.24 -  <tr class="vdh"><td></td><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr>
   98.25 -  <%
   98.26 -    int count = root.pm().getPartitionCount();
   98.27 -    for (int loop = 0; loop < count; loop++)
   98.28 -    {
   98.29 -	Partition p = root.pm().getPartition(loop);
   98.30 -	if (p.isXeno() == true)
   98.31 -        {
   98.32 -  %>
   98.33 -  <tr class="vds"><td></td>
   98.34 -  <%
   98.35 -        }
   98.36 -        else
   98.37 -        {
   98.38 -  %>
   98.39 -  <tr class="vdt">
   98.40 -    <td><input type="checkbox" name="p" value="<%= p.getName() %>"></td>
   98.41 -  <%
   98.42 -        }
   98.43 -  %>
   98.44 -    <td><%= p.getMajor() %>:<%= p.getMinor() %></td>
   98.45 -    <td align="right"><%= p.getBlocks() %></td>
   98.46 -    <td align="right"><%= p.getStartSect() %> </td>
   98.47 -    <td align="right"><%= p.getNumSects() %> </td>
   98.48 -    <td><%= p.getName() %> </td>
   98.49 -  </tr>
   98.50 -  <%
   98.51 -    }
   98.52 -  %>
   98.53 -</tbody>
   98.54 -</table>
   98.55 -
   98.56 -</td></tr>
   98.57 -
   98.58 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   98.59 -
   98.60 -<tr><td>
   98.61 -<table cellpadding="0" cellspacing="0" border="0">
   98.62 -<tbody>
   98.63 -
   98.64 -<tr>
   98.65 -  <td width="100"></td>
   98.66 -  <td width="7"></td>
   98.67 -  <td></td>
   98.68 -</tr>
   98.69 -
   98.70 -<tr>
   98.71 -  <td align="right">domain</td>
   98.72 -  <td></td>
   98.73 -  <td> <input type="text" size="3" name="domain"> </td>
   98.74 -</tr>
   98.75 -<tr>
   98.76 -  <td align="right"></td>
   98.77 -  <td></td>
   98.78 -  <td> <input type="radio" name="mode" value="ro" checked>RO
   98.79 -       <input type="radio" name="mode" value="rw">RW</td>
   98.80 -</tr>
   98.81 -</tbody>
   98.82 -</table>
   98.83 -</td></tr>
   98.84 -
   98.85 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
   98.86 -
   98.87 -<tr>
   98.88 -  <td><input type="submit" name="action" value="grant access"></td>
   98.89 -</tr>
   98.90 -
   98.91 -</tbody>
   98.92 -</table>
   98.93 -</form>
   98.94 -
   98.95 -</td>
   98.96 -</tbody>
   98.97 -</table>
   98.98 -
   98.99 -
  98.100 -
  98.101 -
  98.102 -<!-- end content -->
    99.1 --- a/tools/control/web/tmpl/pd-gr.tmpl	Fri Nov 21 12:05:32 2003 +0000
    99.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.3 @@ -1,77 +0,0 @@
    99.4 -Grant Access Results
    99.5 -SECTION&XenoServers
    99.6 -BREADCRUMB&Physical Disk Manager&pd.jsp
    99.7 -
    99.8 -<!-- content -->
    99.9 -<img src="pixel.gif" class="block" width="1" height="12">
   99.10 -
   99.11 -<table cellpadding="0" cellspacing="0" border="0">
   99.12 -<tbody>
   99.13 -INCLUDE&pdmenu.tmpl
   99.14 -<td valign="top">
   99.15 -
   99.16 -<b>Grant Access Results</b>
   99.17 -<br>
   99.18 -
   99.19 -<%
   99.20 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
   99.21 -  Defaults d = sc.getDefaults(); 
   99.22 -
   99.23 -  String partitions[] = hsrw.getParameterValues("p");
   99.24 -  String size = null;
   99.25 -
   99.26 -  if (partitions == null || partitions.length == 0)
   99.27 -  {
   99.28 -%>
   99.29 -Error: No partitions chosen.<br>
   99.30 -<%
   99.31 -  }
   99.32 -  else if (hsrw.getParameter("domain") == null ||
   99.33 -           hsrw.getParameter("domain").trim().equals(""))
   99.34 -  {
   99.35 -%>
   99.36 -Error: No domain specified.<br>
   99.37 -<%
   99.38 -  }
   99.39 -  else
   99.40 -  {
   99.41 -    int domain = -1;
   99.42 -    
   99.43 -    try
   99.44 -    {
   99.45 -      domain = Integer.decode(hsrw.getParameter("domain")).intValue();
   99.46 -      Mode mode;
   99.47 -      if (hsrw.getParameter("mode").equals("rw")) {
   99.48 -        mode = Mode.READ_WRITE;
   99.49 -      } else {
   99.50 -        mode = Mode.READ_ONLY;
   99.51 -      }
   99.52 -    
   99.53 -      for (int i = 0; i < partitions.length; i++)
   99.54 -      {
   99.55 -%>
   99.56 -output[<%= i %>] =<br>
   99.57 -<%= new CommandPhysicalGrant(d, domain, partitions[i], mode, false).executeWeb() %> <br>
   99.58 -<%
   99.59 -      }
   99.60 -    } catch (NumberFormatException e) {
   99.61 -%>
   99.62 -Error: invalid domain specification.<br>
   99.63 -<%
   99.64 -    }
   99.65 -  }
   99.66 -%>
   99.67 -
   99.68 -
   99.69 -<%
   99.70 -  root.doFlushState();
   99.71 -%>
   99.72 -
   99.73 -
   99.74 -</td>
   99.75 -</tbody>
   99.76 -</table>
   99.77 -
   99.78 -
   99.79 -
   99.80 -<!-- end content -->
   100.1 --- a/tools/control/web/tmpl/pd-l.tmpl	Fri Nov 21 12:05:32 2003 +0000
   100.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.3 @@ -1,90 +0,0 @@
   100.4 -Physical Access List
   100.5 -SECTION&XenoServers
   100.6 -BREADCRUMB&Physical Disk Manager&pd.jsp
   100.7 -
   100.8 -<!-- content -->
   100.9 -<img src="pixel.gif" class="block" width="1" height="12">
  100.10 -
  100.11 -<table cellpadding="0" cellspacing="0" border="0">
  100.12 -<tbody>
  100.13 -INCLUDE&pdmenu.tmpl
  100.14 -<td valign="top">
  100.15 -
  100.16 -<%
  100.17 -  CommandDomainList list = new CommandDomainList(sc.getDefaults());
  100.18 -  String output = list.executeWeb();
  100.19 -  if (output != null)
  100.20 -  {
  100.21 -%>
  100.22 -<%= output %>
  100.23 -<%
  100.24 -  } else {
  100.25 -    Domain domains[] = list.domains();
  100.26 -%>
  100.27 -
  100.28 -<table cellpadding="2" cellspacing="0" border="0">
  100.29 -<tbody>
  100.30 -  <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>
  100.31 -  <%
  100.32 -    /* assert: domains != null, otherwise, where is the servlet engine? */
  100.33 -    for (int loop = 0; loop < domains.length; loop++)
  100.34 -    {
  100.35 -      if ( domains[loop].id == 0 )
  100.36 -        continue;
  100.37 -      CommandPhysicalList plist = new CommandPhysicalList(sc.getDefaults(),domains[loop].id);
  100.38 -      output = plist.executeWeb();
  100.39 -      if (output != null)
  100.40 -      {
  100.41 -%>
  100.42 -<%= output %>
  100.43 -<%
  100.44 -      } else {
  100.45 -        Iterator i = plist.extents().entrySet().iterator();
  100.46 -        while (i.hasNext()) {
  100.47 -          Entry entry = (Entry) i.next();
  100.48 -          Extent e = (Extent) entry.getKey();
  100.49 -          String mode = entry.getValue().toString();
  100.50 -          Partition p = root.pm().getPartition(e);
  100.51 -          if (p != null) {
  100.52 -  %>
  100.53 -  <tr>
  100.54 -    <td><%= domains[loop].id %></td>
  100.55 -    <td><%= mode %></td>
  100.56 -    <td><%= p.getMajor() %>:<%= p.getMinor() %></td>
  100.57 -    <td align="right"><%= p.getBlocks() %></td>
  100.58 -    <td align="right"><%= p.getStartSect() %> </td>
  100.59 -    <td align="right"><%= p.getNumSects() %> </td>
  100.60 -    <td><%= p.getName() %> </td>
  100.61 -  </tr>
  100.62 -  <%
  100.63 -          } else {
  100.64 -  %>
  100.65 -  <tr>
  100.66 -    <td><%= domains[loop].id %></td>
  100.67 -    <td><%= mode %></td>
  100.68 -    <td><%= e.getMajor() %>:<%= e.getMinor()|e.getPartitionNo() %></td>
  100.69 -    <td align="right"></td>
  100.70 -    <td align="right"><%= e.getOffset() %> </td>
  100.71 -    <td align="right"><%= e.getSize() %> </td>
  100.72 -    <td></td>
  100.73 -  </tr>
  100.74 -  <%
  100.75 -          }
  100.76 -        }
  100.77 -      }
  100.78 -    }
  100.79 -  %>
  100.80 -</tbody>
  100.81 -</table>
  100.82 -<%
  100.83 -  }
  100.84 -%>
  100.85 -
  100.86 -</td>
  100.87 -</tbody>
  100.88 -</table>
  100.89 -
  100.90 -
  100.91 -
  100.92 -
  100.93 -<!-- end content -->
   101.1 --- a/tools/control/web/tmpl/pd-r.tmpl	Fri Nov 21 12:05:32 2003 +0000
   101.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.3 @@ -1,104 +0,0 @@
   101.4 -Revoke Access
   101.5 -SECTION&XenoServers
   101.6 -BREADCRUMB&Physical Disk Manager&pd.jsp
   101.7 -
   101.8 -<!-- content -->
   101.9 -<img src="pixel.gif" class="block" width="1" height="12">
  101.10 -
  101.11 -<table cellpadding="0" cellspacing="0" border="0">
  101.12 -<tbody>
  101.13 -INCLUDE&pdmenu.tmpl
  101.14 -<td valign="top">
  101.15 -
  101.16 -<%
  101.17 -  CommandDomainList list = new CommandDomainList(sc.getDefaults());
  101.18 -  String output = list.executeWeb();
  101.19 -  if (output != null)
  101.20 -  {
  101.21 -%>
  101.22 -<%= output %>
  101.23 -<%
  101.24 -  } else {
  101.25 -    Domain domains[] = list.domains();
  101.26 -%>
  101.27 -
  101.28 -<form method="post" action="pd-rr.jsp">
  101.29 -<table cellpadding="0" cellspacing="0" border="0">
  101.30 -<tbody>
  101.31 -<tr><td>
  101.32 -<table cellpadding="2" cellspacing="0" border="0">
  101.33 -<tbody>
  101.34 -  <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>
  101.35 -  <%
  101.36 -    /* assert: domains != null, otherwise, where is the servlet engine? */
  101.37 -    for (int loop = 0; loop < domains.length; loop++)
  101.38 -    {
  101.39 -      if ( domains[loop].id == 0 )
  101.40 -        continue;
  101.41 -      CommandPhysicalList plist = new CommandPhysicalList(sc.getDefaults(),domains[loop].id);
  101.42 -      output = plist.executeWeb();
  101.43 -      if (output != null)
  101.44 -      {
  101.45 -%>
  101.46 -<%= output %>
  101.47 -<%
  101.48 -      } else {
  101.49 -        Iterator i = plist.extents().entrySet().iterator();
  101.50 -        while (i.hasNext()) {
  101.51 -          Entry entry = (Entry) i.next();
  101.52 -          Extent e = (Extent) entry.getKey();
  101.53 -          String mode = entry.getValue().toString();
  101.54 -          Partition p = root.pm().getPartition(e);
  101.55 -          if (p != null) {
  101.56 -  %>
  101.57 -  <tr>
  101.58 -    <td><input type="checkbox" name="dompart" value="<%= domains[loop].id + " " + p.getName() %>"></td>
  101.59 -    <td><%= domains[loop].id %></td>
  101.60 -    <td><%= mode %></td>
  101.61 -    <td><%= p.getMajor() %>:<%= p.getMinor() %></td>
  101.62 -    <td align="right"><%= p.getBlocks() %></td>
  101.63 -    <td align="right"><%= p.getStartSect() %> </td>
  101.64 -    <td align="right"><%= p.getNumSects() %> </td>
  101.65 -    <td><%= p.getName() %> </td>
  101.66 -  </tr>
  101.67 -  <%
  101.68 -          } else {
  101.69 -  %>
  101.70 -  <tr>
  101.71 -    <td><%= domains[loop].id %></td>
  101.72 -    <td><%= mode %></td>
  101.73 -    <td><%= e.getMajor() %>:<%= e.getMinor()|e.getPartitionNo() %></td>
  101.74 -    <td align="right"></td>
  101.75 -    <td align="right"><%= e.getOffset() %> </td>
  101.76 -    <td align="right"><%= e.getSize() %> </td>
  101.77 -    <td></td>
  101.78 -  </tr>
  101.79 -  <%
  101.80 -          }
  101.81 -        }
  101.82 -      }
  101.83 -    }
  101.84 -  %>
  101.85 -</tbody>
  101.86 -</table>
  101.87 -</td></tr>
  101.88 -
  101.89 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  101.90 -
  101.91 -<tr>
  101.92 -  <td><input type="submit" name="action" value="revoke access"></td>
  101.93 -</tr>
  101.94 -</table>
  101.95 -</form>
  101.96 -<%
  101.97 -  }
  101.98 -%>
  101.99 -
 101.100 -</td>
 101.101 -</tbody>
 101.102 -</table>
 101.103 -
 101.104 -
 101.105 -
 101.106 -
 101.107 -<!-- end content -->
   102.1 --- a/tools/control/web/tmpl/pd-rr.tmpl	Fri Nov 21 12:05:32 2003 +0000
   102.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.3 @@ -1,50 +0,0 @@
   102.4 -Revoke Access
   102.5 -SECTION&XenoServers
   102.6 -BREADCRUMB&Physical Disk Manager&pd.jsp
   102.7 -
   102.8 -<!-- content -->
   102.9 -<img src="pixel.gif" class="block" width="1" height="12">
  102.10 -
  102.11 -<table cellpadding="0" cellspacing="0" border="0">
  102.12 -<tbody>
  102.13 -INCLUDE&pdmenu.tmpl
  102.14 -<td valign="top">
  102.15 -
  102.16 -<b>Revoke Access Results</b>
  102.17 -<br>
  102.18 -<%
  102.19 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
  102.20 -  
  102.21 -  String partitions[] = hsrw.getParameterValues("dompart");
  102.22 -  if (partitions == null || partitions.length == 0)
  102.23 -  {
  102.24 -%>
  102.25 -Error: No partitions chosen.<br>
  102.26 -<%
  102.27 -  }
  102.28 -  else
  102.29 -  {
  102.30 -    for (int i = 0; i < partitions.length; i++)
  102.31 -    {
  102.32 -      int domain = Integer.parseInt(partitions[i].substring(0,partitions[i].indexOf(" ")));
  102.33 -      String partition = partitions[i].substring(partitions[i].indexOf(" ")+1);
  102.34 -%>
  102.35 -output[<%= i %>] =<br>
  102.36 -<%= new CommandPhysicalRevoke(sc.getDefaults(),domain,partition).executeWeb() %> <br>
  102.37 -<%
  102.38 -    }
  102.39 -  }
  102.40 -%>
  102.41 -
  102.42 -<%
  102.43 -  root.doFlushState();
  102.44 -%>
  102.45 -
  102.46 -</td>
  102.47 -</tbody>
  102.48 -</table>
  102.49 -
  102.50 -
  102.51 -
  102.52 -
  102.53 -<!-- end content -->
   103.1 --- a/tools/control/web/tmpl/pd.tmpl	Fri Nov 21 12:05:32 2003 +0000
   103.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.3 @@ -1,24 +0,0 @@
   103.4 -Physical Disk Manager
   103.5 -SECTION&XenoServers
   103.6 -
   103.7 -<!-- content -->
   103.8 -<img src="pixel.gif" class="block" width="1" height="12">
   103.9 -
  103.10 -<table cellpadding="0" cellspacing="0" border="0">
  103.11 -<tbody>
  103.12 -INCLUDE&pdmenu.tmpl
  103.13 -<td valign="top">
  103.14 -<table cellpadding="0" cellspacing="0" border="0">
  103.15 -<tbody>
  103.16 -  <tr><td nowrap="nowrap">Physical Disk Manager</td></tr>
  103.17 -
  103.18 -</tbody>
  103.19 -</table>
  103.20 -</td>
  103.21 -</tbody>
  103.22 -</table>
  103.23 -
  103.24 -
  103.25 -
  103.26 -
  103.27 -<!-- end content -->
   104.1 --- a/tools/control/web/tmpl/pdmenu.tmpl	Fri Nov 21 12:05:32 2003 +0000
   104.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.3 @@ -1,26 +0,0 @@
   104.4 -<td width="10" valign="top" align="right"></td>
   104.5 -
   104.6 -<td valign="top">
   104.7 -<table cellpadding="0" cellspacing="0" border="0">
   104.8 -<tbody>
   104.9 -<tr>
  104.10 -  <td class="menuheader" width="100">Physical Disk Access</td>
  104.11 -</tr>
  104.12 -<tr>
  104.13 -  <td class="sidemenu" width="100"><a href="pd-g.jsp">Grant</a></td>
  104.14 -</tr>
  104.15 -<tr>
  104.16 -  <td class="sidemenu" width="100"><a href="pd-r.jsp">Revoke</a></td>
  104.17 -</tr>
  104.18 -<tr>
  104.19 -  <td class="sidemenu" width="100"><a href="pd-l.jsp">List</a></td>
  104.20 -</tr>
  104.21 -</tbody>
  104.22 -</table>
  104.23 -</td>
  104.24 -
  104.25 -<td width="5" valign="top" align="right"></td>
  104.26 -
  104.27 -<td bgcolor="#666666" width="2"><img src="img/pixel.gif" class="block" width="2" height="50"></td>
  104.28 -
  104.29 -<td width="15" valign="top" align="right"></td>
   105.1 --- a/tools/control/web/tmpl/vd-fv.tmpl	Fri Nov 21 12:05:32 2003 +0000
   105.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.3 @@ -1,60 +0,0 @@
   105.4 -View Free Space
   105.5 -SECTION&XenoServers
   105.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   105.7 -
   105.8 -<!-- content -->
   105.9 -<img src="pixel.gif" class="block" width="1" height="12">
  105.10 -
  105.11 -<table cellpadding="0" cellspacing="0" border="0">
  105.12 -<tbody>
  105.13 -INCLUDE&vdmenu.tmpl
  105.14 -<td valign="top">
  105.15 -
  105.16 -<%
  105.17 -  VirtualDisk free = root.vdm().getFreeDisk();  
  105.18 -%>
  105.19 -
  105.20 -<table cellpadding="0" cellspacing="0" border="0">
  105.21 -<tbody>
  105.22 -
  105.23 -<tr><td>
  105.24 -Total available free space: <%= Library.formatSize(free.getSize() * Settings.SECTOR_SIZE,8,true) %>
  105.25 -</td></tr>
  105.26 -
  105.27 -
  105.28 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  105.29 -
  105.30 -<tr><td>
  105.31 -<table cellpadding="2" cellspacing="0" border="0">
  105.32 -<tbody>
  105.33 -  <tr class="vdh"><td>disk</td><td>offset</td><td>size </td></tr>
  105.34 -
  105.35 -  <%
  105.36 -    Iterator i = free.extents();
  105.37 -    while (i.hasNext())
  105.38 -    {
  105.39 -      Extent e = (Extent) i.next();
  105.40 -  %>
  105.41 -  <tr class="vdt">
  105.42 -  <td              ><%= e.getDisk() %></td>
  105.43 -  <td align="right"><%= e.getOffset() %> </td>
  105.44 -  <td align="right"><%= e.getSize() %> </td>
  105.45 -  </tr>
  105.46 -  <%
  105.47 -    }
  105.48 -  %>
  105.49 -</tbody>
  105.50 -</table>
  105.51 -</td></tr>
  105.52 -
  105.53 -</tbody>
  105.54 -</table>
  105.55 -
  105.56 -</td>
  105.57 -</tbody>
  105.58 -</table>
  105.59 -
  105.60 -
  105.61 -
  105.62 -
  105.63 -<!-- end content -->
   106.1 --- a/tools/control/web/tmpl/vd-pa.tmpl	Fri Nov 21 12:05:32 2003 +0000
   106.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.3 @@ -1,97 +0,0 @@
   106.4 -Add Partition
   106.5 -SECTION&XenoServers
   106.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   106.7 -
   106.8 -<!-- content -->
   106.9 -<img src="pixel.gif" class="block" width="1" height="12">
  106.10 -
  106.11 -<table cellpadding="0" cellspacing="0" border="0">
  106.12 -<tbody>
  106.13 -INCLUDE&vdmenu.tmpl
  106.14 -<td valign="top">
  106.15 -
  106.16 -<form method="post" action="vd-par.jsp">
  106.17 -<table cellpadding="0" cellspacing="0" border="0">
  106.18 -<tbody>
  106.19 -
  106.20 -<tr><td>
  106.21 -
  106.22 -<table cellpadding="2" cellspacing="0" border="0">
  106.23 -<tbody>
  106.24 -  <tr class="vdh"><td></td><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr>
  106.25 -  <%
  106.26 -    int count = root.pm().getPartitionCount();
  106.27 -    for (int loop = 0; loop < count; loop++)
  106.28 -    {
  106.29 -	Partition p = root.pm().getPartition(loop);
  106.30 -	if (p.isXeno() == true)
  106.31 -        {
  106.32 -  %>
  106.33 -  <tr class="vds"><td></td>
  106.34 -  <%
  106.35 -        }
  106.36 -        else
  106.37 -        {
  106.38 -  %>
  106.39 -  <tr class="vdt">
  106.40 -    <td><input type="checkbox" name="p" value="<%= p.getName() %>"></td>
  106.41 -  <%
  106.42 -        }
  106.43 -  %>
  106.44 -    <td><%= p.getMajor() %>:<%= p.getMinor() %></td>
  106.45 -    <td align="right"><%= p.getBlocks() %></td>
  106.46 -    <td align="right"><%= p.getStartSect() %> </td>
  106.47 -    <td align="right"><%= p.getNumSects() %> </td>
  106.48 -    <td><%= p.getName() %> </td>
  106.49 -  </tr>
  106.50 -  <%
  106.51 -    }
  106.52 -  %>
  106.53 -</tbody>
  106.54 -</table>
  106.55 -
  106.56 -</td></tr>
  106.57 -
  106.58 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  106.59 -
  106.60 -
  106.61 -<tr><td>
  106.62 -<table cellpadding="0" cellspacing="0" border="0">
  106.63 -<tbody>
  106.64 -
  106.65 -<tr>
  106.66 -  <td width="50"></td>
  106.67 -  <td width="7"></td>
  106.68 -  <td></td>
  106.69 -</tr>
  106.70 -
  106.71 -<tr>
  106.72 -  <td align="right">chunksize</td>
  106.73 -  <td></td>
  106.74 -  <td> <input type="text" size="5" name="chunk" value="256">
  106.75 -       <input type="radio" name="chunkunits" value="m" checked>MB
  106.76 -       <input type="radio" name="chunkunits" value="g">GB
  106.77 -  </td>
  106.78 -</tr>
  106.79 -</tbody>
  106.80 -</table>
  106.81 -</td></tr>
  106.82 -
  106.83 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  106.84 -
  106.85 -<tr>
  106.86 -  <td><input type="submit" name="action" value="add partition"></td>
  106.87 -</tr>
  106.88 -
  106.89 -</tbody>
  106.90 -</table>
  106.91 -</form>
  106.92 -
  106.93 -</td>
  106.94 -</tbody>
  106.95 -</table>
  106.96 -
  106.97 -
  106.98 -
  106.99 -
 106.100 -<!-- end content -->
   107.1 --- a/tools/control/web/tmpl/vd-par.tmpl	Fri Nov 21 12:05:32 2003 +0000
   107.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.3 @@ -1,61 +0,0 @@
   107.4 -Add Partition Results
   107.5 -SECTION&XenoServers
   107.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   107.7 -
   107.8 -<!-- content -->
   107.9 -<img src="pixel.gif" class="block" width="1" height="12">
  107.10 -
  107.11 -<table cellpadding="0" cellspacing="0" border="0">
  107.12 -<tbody>
  107.13 -INCLUDE&vdmenu.tmpl
  107.14 -<td valign="top">
  107.15 -
  107.16 -<b>Add Partition Results</b>
  107.17 -<br>
  107.18 -
  107.19 -<%
  107.20 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
  107.21 -
  107.22 -  String partitions[] = hsrw.getParameterValues("p");
  107.23 -  String size = null;
  107.24 -
  107.25 -  if (partitions == null || partitions.length == 0)
  107.26 -  {
  107.27 -%>
  107.28 -Error: No partitions chosen.<br>
  107.29 -<%
  107.30 -  }
  107.31 -  else if (hsrw.getParameter("chunk") == null ||
  107.32 -           hsrw.getParameter("chunk").trim().equals(""))
  107.33 -  {
  107.34 -%>
  107.35 -Error: chunk size not specified.<br>
  107.36 -<%
  107.37 -  }
  107.38 -  else
  107.39 -  {
  107.40 -    size = hsrw.getParameter("chunk").trim() +
  107.41 -           hsrw.getParameter("chunkunits").trim();
  107.42 -    for (int i = 0; i < partitions.length; i++)
  107.43 -    {
  107.44 -%>
  107.45 -output[<%= i %>] =<br>
  107.46 -<%= new CommandPartitionAdd(partitions[i], Library.parseSize(size), false).executeWeb() %> <br>
  107.47 -<%
  107.48 -    }
  107.49 -  }
  107.50 -%>
  107.51 -
  107.52 -
  107.53 -<%
  107.54 -  root.doFlushState();
  107.55 -%>
  107.56 -
  107.57 -
  107.58 -</td>
  107.59 -</tbody>
  107.60 -</table>
  107.61 -
  107.62 -
  107.63 -
  107.64 -<!-- end content -->
   108.1 --- a/tools/control/web/tmpl/vd-pv.tmpl	Fri Nov 21 12:05:32 2003 +0000
   108.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.3 @@ -1,54 +0,0 @@
   108.4 -View Partitions
   108.5 -SECTION&XenoServers
   108.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   108.7 -
   108.8 -<!-- content -->
   108.9 -<img src="pixel.gif" class="block" width="1" height="12">
  108.10 -
  108.11 -<table cellpadding="0" cellspacing="0" border="0">
  108.12 -<tbody>
  108.13 -INCLUDE&vdmenu.tmpl
  108.14 -<td valign="top">
  108.15 -note: highlighted entries are currently being used as xeno partitions.
  108.16 -<br><br>
  108.17 -
  108.18 -<table cellpadding="2" cellspacing="0" border="0">
  108.19 -<tbody>
  108.20 -  <tr class="vdh"><td>maj:min</td><td>blocks</td><td>start sect</td><td>num sects</td><td>name</td></tr>
  108.21 -  <%
  108.22 -    int count = root.pm().getPartitionCount();
  108.23 -    for (int loop = 0; loop < count; loop++)
  108.24 -    {
  108.25 -      Partition p = root.pm().getPartition(loop);
  108.26 -      if (p.isXeno() == true)
  108.27 -      {
  108.28 -  %>
  108.29 -  <tr class="vds">
  108.30 -  <%
  108.31 -      }
  108.32 -      else
  108.33 -      {
  108.34 -  %>
  108.35 -  <tr class="vdt">
  108.36 -  <%
  108.37 -     }
  108.38 -  %>
  108.39 -  <td><%= p.getMajor() %>:<%= p.getMinor() %></td>
  108.40 -  <td align="right"><%= p.getBlocks() %></td>
  108.41 -  <td align="right"><%= p.getStartSect() %> </td>
  108.42 -  <td align="right"><%= p.getNumSects() %> </td>
  108.43 -  <td><%= p.getName() %> </td>
  108.44 -  <%
  108.45 -    }
  108.46 -  %>
  108.47 -</tbody>
  108.48 -</table>
  108.49 -
  108.50 -</td>
  108.51 -</tbody>
  108.52 -</table>
  108.53 -
  108.54 -
  108.55 -
  108.56 -
  108.57 -<!-- end content -->
   109.1 --- a/tools/control/web/tmpl/vd-vbdc.tmpl	Fri Nov 21 12:05:32 2003 +0000
   109.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.3 @@ -1,94 +0,0 @@
   109.4 -Create Virtual Block Device
   109.5 -SECTION&XenoServers
   109.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   109.7 -
   109.8 -<!-- content -->
   109.9 -<img src="pixel.gif" class="block" width="1" height="12">
  109.10 -
  109.11 -<table cellpadding="0" cellspacing="0" border="0">
  109.12 -<tbody>
  109.13 -INCLUDE&vdmenu.tmpl
  109.14 -<td valign="top">
  109.15 -
  109.16 -<form method="post" action="vd-vbdcr.jsp">
  109.17 -<table cellpadding="0" cellspacing="0" border="0">
  109.18 -<tbody>
  109.19 -<tr><td>
  109.20 -<table cellpadding="2" cellspacing="0" border="0">
  109.21 -<tbody>
  109.22 -  <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>
  109.23 -
  109.24 -  <%
  109.25 -    Iterator i = root.vdm().getVirtualDisks();
  109.26 -    while (i.hasNext())
  109.27 -    {
  109.28 -      VirtualDisk vd = (VirtualDisk) i.next();
  109.29 -  %>
  109.30 -    <tr class="vdt">
  109.31 -      <td>
  109.32 -        <input type="radio" name="vd" value="<%= vd.getKey() %>">
  109.33 -      </td>
  109.34 -      <td><%= vd.getKey() %></td>
  109.35 -      <td></td>
  109.36 -      <td><%= vd.getName() %></td>
  109.37 -      <td></td>
  109.38 -      <td><%= vd.getExpiry() %></td>
  109.39 -      <td></td>
  109.40 -      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
  109.41 -    </tr>
  109.42 -  <%
  109.43 -    }
  109.44 -  %>
  109.45 -
  109.46 -</tbody>
  109.47 -</table>
  109.48 -</td></tr>
  109.49 -
  109.50 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  109.51 -
  109.52 -<tr><td>
  109.53 -<table cellpadding="0" cellspacing="0" border="0">
  109.54 -<tbody>
  109.55 -
  109.56 -<tr>
  109.57 -  <td width="100"></td>
  109.58 -  <td width="7"></td>
  109.59 -  <td></td>
  109.60 -</tr>
  109.61 -
  109.62 -<tr>
  109.63 -  <td align="right">domain</td>
  109.64 -  <td></td>
  109.65 -  <td> <input type="text" size="3" name="domain"> </td>
  109.66 -</tr>
  109.67 -<tr>
  109.68 -  <td align="right">vbd number</td>
  109.69 -  <td></td>
  109.70 -  <td> <input type="text" size="3" name="vbd"> </td>
  109.71 -</tr>
  109.72 -<tr>
  109.73 -  <td align="right"></td>
  109.74 -  <td></td>
  109.75 -  <td> <input type="radio" name="mode" value="ro" checked>RO
  109.76 -       <input type="radio" name="mode" value="rw">RW</td>
  109.77 -</tr>
  109.78 -</tbody>
  109.79 -</table>
  109.80 -</td></tr>
  109.81 -
  109.82 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  109.83 -
  109.84 -<tr>
  109.85 -  <td><input type="submit" name="action" value="create virtual block device"></td>
  109.86 -</tr>
  109.87 -</table>
  109.88 -</form>
  109.89 -
  109.90 -</td>
  109.91 -</tbody>
  109.92 -</table>
  109.93 -
  109.94 -
  109.95 -
  109.96 -
  109.97 -<!-- end content -->
   110.1 --- a/tools/control/web/tmpl/vd-vbdcr.tmpl	Fri Nov 21 12:05:32 2003 +0000
   110.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.3 @@ -1,92 +0,0 @@
   110.4 -Create Virtual Block Device
   110.5 -SECTION&XenoServers
   110.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   110.7 -
   110.8 -<!-- content -->
   110.9 -<img src="pixel.gif" class="block" width="1" height="12">
  110.10 -
  110.11 -<table cellpadding="0" cellspacing="0" border="0">
  110.12 -<tbody>
  110.13 -INCLUDE&vdmenu.tmpl
  110.14 -<td valign="top">
  110.15 -
  110.16 -<b>Create Virtual Block Device Results</b>
  110.17 -<br>
  110.18 -
  110.19 -<%
  110.20 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
  110.21 -
  110.22 -  if (hsrw.getParameter("vd") == null ||
  110.23 -      hsrw.getParameter("vd").trim().equals(""))
  110.24 -  {
  110.25 -%>
  110.26 -Error: No virtual disk chosen.<br>
  110.27 -<%
  110.28 -  }
  110.29 -  else if (hsrw.getParameter("domain") == null ||
  110.30 -           hsrw.getParameter("domain").trim().equals(""))
  110.31 -  {
  110.32 -%>
  110.33 -Error: No domain specified.<br>
  110.34 -<%
  110.35 -  }
  110.36 -  else if (hsrw.getParameter("vbd") == null ||
  110.37 -           hsrw.getParameter("vbd").trim().equals(""))
  110.38 -  {
  110.39 -%>
  110.40 -Error: No virtual block device number specified.<br>
  110.41 -<%
  110.42 -  }
  110.43 -  else
  110.44 -  {
  110.45 -    int domain = -1;
  110.46 -    int vbd = -1;
  110.47 -
  110.48 -    try
  110.49 -    {
  110.50 -      domain = Integer.decode(hsrw.getParameter("domain")).intValue();
  110.51 -      vbd = Integer.decode(hsrw.getParameter("vbd")).intValue();
  110.52 -      Mode mode;
  110.53 -      if (hsrw.getParameter("mode").equals("rw")) {
  110.54 -        mode = Mode.READ_WRITE;
  110.55 -      } else {
  110.56 -        mode = Mode.READ_ONLY;
  110.57 -      }
  110.58 -      
  110.59 -%>
  110.60 -output =<br>
  110.61 -<%= new CommandVbdCreate(hsrw.getParameter("vd"),
  110.62 -                                    domain, vbd,
  110.63 -                                     mode).executeWeb()  %>
  110.64 -<%
  110.65 -    }
  110.66 -    catch (NumberFormatException e)
  110.67 -    {
  110.68 -      if (domain == -1)
  110.69 -      {
  110.70 -%>
  110.71 -Error: invalid domain specification.<br>
  110.72 -<%
  110.73 -      }
  110.74 -      else
  110.75 -      {
  110.76 -%>
  110.77 -Error: invalid virtual block device number specification.<br>
  110.78 -<%
  110.79 -      }
  110.80 -    }
  110.81 -  }
  110.82 -%>
  110.83 -
  110.84 -<%
  110.85 -  root.doFlushState();
  110.86 -%>
  110.87 -
  110.88 -</td>
  110.89 -</tbody>
  110.90 -</table>
  110.91 -
  110.92 -
  110.93 -
  110.94 -
  110.95 -<!-- end content -->
   111.1 --- a/tools/control/web/tmpl/vd-vbdv.tmpl	Fri Nov 21 12:05:32 2003 +0000
   111.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.3 @@ -1,57 +0,0 @@
   111.4 -View Virtual Block Devices
   111.5 -SECTION&XenoServers
   111.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   111.7 -
   111.8 -<!-- content -->
   111.9 -<img src="pixel.gif" class="block" width="1" height="12">
  111.10 -
  111.11 -<table cellpadding="0" cellspacing="0" border="0">
  111.12 -<tbody>
  111.13 -INCLUDE&vdmenu.tmpl
  111.14 -<td valign="top">
  111.15 -<%
  111.16 -  CommandVbdList list = new CommandVbdList();
  111.17 -  String output = list.executeWeb();
  111.18 -  VirtualBlockDevice[] vbds = list.vbds();
  111.19 -  if (output != null)
  111.20 -  {
  111.21 -%>
  111.22 -<%= output %>
  111.23 -<%
  111.24 -  } else {
  111.25 -%>
  111.26 -<table cellpadding="2" cellspacing="0" border="0">
  111.27 -<tbody>
  111.28 -  <tr class="vdh"><td>dom</td><td>vbd</td><td>mode</td><td>vd key</td><td>vd name</td></tr>
  111.29 -
  111.30 -
  111.31 -  <%
  111.32 -    for (int i=0;i<vbds.length;i++)
  111.33 -    {
  111.34 -      VirtualBlockDevice vbd = vbds[i];
  111.35 -      VirtualDisk vd = vbd.getVirtualDisk(); 
  111.36 -  %>
  111.37 -    <tr class="vdt">
  111.38 -      <td><%= vbd.getDomain() %></td>
  111.39 -      <td><%= vbd.getVbdNum() %></td>
  111.40 -      <td><%= vbd.getMode().toString() %></td>
  111.41 -      <td><%= vd.getKey() %></td>
  111.42 -      <td><%= vd.getName() %></td>
  111.43 -    </tr>
  111.44 -  <%
  111.45 -    }
  111.46 -  %>
  111.47 -</tbody>
  111.48 -</table>
  111.49 -<%
  111.50 -  }
  111.51 -%>
  111.52 -
  111.53 -</td>
  111.54 -</tbody>
  111.55 -</table>
  111.56 -
  111.57 -
  111.58 -
  111.59 -
  111.60 -<!-- end content -->
   112.1 --- a/tools/control/web/tmpl/vd-vdc.tmpl	Fri Nov 21 12:05:32 2003 +0000
   112.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.3 @@ -1,67 +0,0 @@
   112.4 -Create New Virtual Disk
   112.5 -SECTION&XenoServers
   112.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   112.7 -
   112.8 -<!-- content -->
   112.9 -<img src="pixel.gif" class="block" width="1" height="12">
  112.10 -
  112.11 -<table cellpadding="0" cellspacing="0" border="0">
  112.12 -<tbody>
  112.13 -INCLUDE&vdmenu.tmpl
  112.14 -<td valign="top">
  112.15 -
  112.16 -<form method="post" action="vd-vdcr.jsp">
  112.17 -<table cellpadding="0" cellspacing="0" border="0">
  112.18 -<tbody>
  112.19 -
  112.20 -<tr>
  112.21 -  <td width="50"></td>
  112.22 -  <td width="7"></td>
  112.23 -  <td></td>
  112.24 -</tr>
  112.25 -
  112.26 -<tr>
  112.27 -  <td align="right">name</td>
  112.28 -  <td></td>
  112.29 -  <td> <input type="text" size="40" name="name" value="name of disk"> </td>
  112.30 -</tr>
  112.31 -
  112.32 -<tr>
  112.33 -  <td align="right">size</td>
  112.34 -  <td></td>
  112.35 -  <td> <input type="text" size="10" name="size">
  112.36 -       <input type="radio" name="sizeunits" value="mb" checked>MB
  112.37 -       <input type="radio" name="sizeunits" value="gb">GB
  112.38 -  </td>
  112.39 -</tr>
  112.40 -
  112.41 -<tr>
  112.42 -  <td align="right">expiry</td>
  112.43 -  <td></td>
  112.44 -  <td> <input type="text" size="3" name="expiry">
  112.45 -       <input type="radio" name="expiryunits" value="d" checked>days 
  112.46 -       <input type="radio" name="expiryunits" value="w">weeks
  112.47 -       <input type="radio" name="expiryunits" value="m">months
  112.48 -       <input type="radio" name="expiryunits" value="y">years
  112.49 -  </td>
  112.50 -</tr>
  112.51 -
  112.52 -##WHITESPACE## ##GREYLINE3## ##WHITESPACE##
  112.53 -
  112.54 -<tr>
  112.55 -  <td></td>
  112.56 -  <td></td>
  112.57 -  <td><input type="submit" name="action" value="create virtual disk"></td>
  112.58 -</tr>
  112.59 -
  112.60 -</tbody>
  112.61 -</table>
  112.62 -</form>
  112.63 -</td>
  112.64 -</tbody>
  112.65 -</table>
  112.66 -
  112.67 -
  112.68 -
  112.69 -
  112.70 -<!-- end content -->
   113.1 --- a/tools/control/web/tmpl/vd-vdcr.tmpl	Fri Nov 21 12:05:32 2003 +0000
   113.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.3 @@ -1,91 +0,0 @@
   113.4 -Create New Virtual Disk
   113.5 -SECTION&XenoServers
   113.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   113.7 -
   113.8 -<!-- content -->
   113.9 -<img src="pixel.gif" class="block" width="1" height="12">
  113.10 -
  113.11 -<table cellpadding="0" cellspacing="0" border="0">
  113.12 -<tbody>
  113.13 -INCLUDE&vdmenu.tmpl
  113.14 -<td valign="top">
  113.15 -
  113.16 -
  113.17 -<b>Create Virtual Disk Results</b>
  113.18 -<br>
  113.19 -
  113.20 -<%
  113.21 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
  113.22 -  String size = null;
  113.23 -  String expiry_string = null;
  113.24 -  long expiry = 0;
  113.25 -
  113.26 -  if (hsrw.getParameter("size") == null ||
  113.27 -      hsrw.getParameter("size").trim().equals(""))
  113.28 -  {
  113.29 -%>
  113.30 -Error: size not specified.<br>
  113.31 -<%
  113.32 -  }
  113.33 -  else if (hsrw.getParameter("expiry") == null ||
  113.34 -           hsrw.getParameter("expiry").trim().equals(""))
  113.35 -  {
  113.36 -%>
  113.37 -Error: expiry time not specified.<br>
  113.38 -<%
  113.39 -  }
  113.40 -  else
  113.41 -  {
  113.42 -    size = hsrw.getParameter("size").trim() +
  113.43 -           hsrw.getParameter("sizeunits").trim();
  113.44 -
  113.45 -    try
  113.46 -    {
  113.47 -      expiry = Long.decode(hsrw.getParameter("expiry")).longValue(); 
  113.48 -
  113.49 -      /* not perfect, but good enough for now... */
  113.50 -      if ( hsrw.getParameter("expiryunits").equals("d"))
  113.51 -      {
  113.52 -        expiry *= 24 * 60 * 60 * 1000;
  113.53 -      }
  113.54 -      else if ( hsrw.getParameter("expiryunits").equals("w"))
  113.55 -      {
  113.56 -        expiry *= 24 * 60 * 60 * 1000 * 7;
  113.57 -      }
  113.58 -      else if ( hsrw.getParameter("expiryunits").equals("m"))
  113.59 -      {
  113.60 -        expiry *= 24 * 60 * 60 * 1000 * 30;
  113.61 -      }
  113.62 -      else if ( hsrw.getParameter("expiryunits").equals("y"))
  113.63 -      {
  113.64 -        expiry *= 24 * 60 * 60 * 1000 * 365;
  113.65 -      }
  113.66 -      
  113.67 -      expiry += System.currentTimeMillis();
  113.68 -%>
  113.69 -output =<br>
  113.70 -<%= new CommandVdCreate( hsrw.getParameter("name"), Library.parseSize(size), new Date(expiry)).executeWeb() %>
  113.71 -<br>
  113.72 -<%
  113.73 -    }
  113.74 -    catch (NumberFormatException e)
  113.75 -    {
  113.76 -%>
  113.77 -Error: invalid expiry time specification.<br>
  113.78 -<%
  113.79 -    }
  113.80 -  }
  113.81 -%>
  113.82 -
  113.83 -<%
  113.84 -  root.doFlushState();
  113.85 -%>
  113.86 -
  113.87 -</td>
  113.88 -</tbody>
  113.89 -</table>
  113.90 -
  113.91 -
  113.92 -
  113.93 -
  113.94 -<!-- end content -->
   114.1 --- a/tools/control/web/tmpl/vd-vdd.tmpl	Fri Nov 21 12:05:32 2003 +0000
   114.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.3 @@ -1,60 +0,0 @@
   114.4 -Delete Virtual Disk
   114.5 -SECTION&XenoServers
   114.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   114.7 -
   114.8 -<!-- content -->
   114.9 -<img src="pixel.gif" class="block" width="1" height="12">
  114.10 -
  114.11 -<table cellpadding="0" cellspacing="0" border="0">
  114.12 -<tbody>
  114.13 -INCLUDE&vdmenu.tmpl
  114.14 -<td valign="top">
  114.15 -
  114.16 -<form method="post" action="vd-vddr.jsp">
  114.17 -<table cellpadding="0" cellspacing="0" border="0">
  114.18 -<tbody>
  114.19 -<tr><td>
  114.20 -<table cellpadding="2" cellspacing="0" border="0">
  114.21 -<tbody>
  114.22 -  <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>
  114.23 -
  114.24 -  <%
  114.25 -    Iterator i = root.vdm().getVirtualDisks();
  114.26 -    while (i.hasNext())
  114.27 -    {
  114.28 -      VirtualDisk vd = (VirtualDisk) i.next();
  114.29 -  %>
  114.30 -    <tr class="vdt">
  114.31 -      <td><input type="checkbox" name="vd" value="<%= vd.getKey() %>"></td>
  114.32 -      <td><%= vd.getKey() %></td>
  114.33 -      <td></td>
  114.34 -      <td><%= vd.getName() %></td>
  114.35 -      <td></td>
  114.36 -      <td><%= vd.getExpiry() %></td>
  114.37 -      <td></td>
  114.38 -      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
  114.39 -    </tr>
  114.40 -  <%
  114.41 -    }
  114.42 -  %>
  114.43 -
  114.44 -
  114.45 -</tbody>
  114.46 -</table>
  114.47 -</td></tr>
  114.48 -
  114.49 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  114.50 -
  114.51 -<tr>
  114.52 -  <td><input type="submit" name="action" value="delete virtual disk"></td>
  114.53 -</tr>
  114.54 -</table>
  114.55 -</form>
  114.56 -</td>
  114.57 -</tbody>
  114.58 -</table>
  114.59 -
  114.60 -
  114.61 -
  114.62 -
  114.63 -<!-- end content -->
   115.1 --- a/tools/control/web/tmpl/vd-vddr.tmpl	Fri Nov 21 12:05:32 2003 +0000
   115.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.3 @@ -1,34 +0,0 @@
   115.4 -Delete Virtual Disk
   115.5 -SECTION&XenoServers
   115.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   115.7 -
   115.8 -<!-- content -->
   115.9 -<img src="pixel.gif" class="block" width="1" height="12">
  115.10 -
  115.11 -<table cellpadding="0" cellspacing="0" border="0">
  115.12 -<tbody>
  115.13 -INCLUDE&vdmenu.tmpl
  115.14 -<td valign="top">
  115.15 -
  115.16 -<b>Delete Virtual Disk Results</b>
  115.17 -<br>
  115.18 -<%
  115.19 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
  115.20 -%>
  115.21 -
  115.22 -vd= <%= hsrw.getParameter("vd") %>
  115.23 -
  115.24 -vd= <%= new CommandVdDelete(hsrw.getParameter("vd"),false).executeWeb() %>
  115.25 -
  115.26 -<%
  115.27 -  root.doFlushState();
  115.28 -%>
  115.29 -
  115.30 -</td>
  115.31 -</tbody>
  115.32 -</table>
  115.33 -
  115.34 -
  115.35 -
  115.36 -
  115.37 -<!-- end content -->
   116.1 --- a/tools/control/web/tmpl/vd-vdr.tmpl	Fri Nov 21 12:05:32 2003 +0000
   116.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.3 @@ -1,85 +0,0 @@
   116.4 -Refresh Virtual Disk
   116.5 -SECTION&XenoServers
   116.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   116.7 -
   116.8 -<!-- content -->
   116.9 -<img src="pixel.gif" class="block" width="1" height="12">
  116.10 -
  116.11 -<table cellpadding="0" cellspacing="0" border="0">
  116.12 -<tbody>
  116.13 -INCLUDE&vdmenu.tmpl
  116.14 -<td valign="top">
  116.15 -
  116.16 -<form method="post" action="vd-vdrr.jsp">
  116.17 -<table cellpadding="0" cellspacing="0" border="0">
  116.18 -<tbody>
  116.19 -<tr><td>
  116.20 -<table cellpadding="2" cellspacing="0" border="0">
  116.21 -<tbody>
  116.22 -  <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>
  116.23 -
  116.24 -  <%
  116.25 -    Iterator i = root.vdm().getVirtualDisks();
  116.26 -    while (i.hasNext())
  116.27 -    {
  116.28 -      VirtualDisk vd = (VirtualDisk) i.next();
  116.29 -  %>
  116.30 -    <tr class="vdt">
  116.31 -      <td><input type="checkbox" name="vd" value="<%= vd.getKey() %>"></td>
  116.32 -      <td><%= vd.getKey() %></td>
  116.33 -      <td></td>
  116.34 -      <td><%= vd.getName() %></td>
  116.35 -      <td></td>
  116.36 -      <td><%= vd.getExpiry() %></td>
  116.37 -      <td></td>
  116.38 -      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
  116.39 -    </tr>
  116.40 -  <%
  116.41 -    }
  116.42 -  %>
  116.43 -
  116.44 -</tbody>
  116.45 -</table>
  116.46 -</td></tr>
  116.47 -
  116.48 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  116.49 -
  116.50 -<tr><td>
  116.51 -<table cellpadding="0" cellspacing="0" border="0">
  116.52 -<tbody>
  116.53 -
  116.54 -<tr>
  116.55 -  <td width="50"></td>
  116.56 -  <td width="7"></td>
  116.57 -  <td></td>
  116.58 -</tr>
  116.59 -
  116.60 -<tr>
  116.61 -  <td align="right">new<br>expiry</td>
  116.62 -  <td></td>
  116.63 -  <td> <input type="text" size="3" name="expiry">
  116.64 -       <input type="radio" name="expiryunits" value="d" checked>days 
  116.65 -       <input type="radio" name="expiryunits" value="w">weeks
  116.66 -       <input type="radio" name="expiryunits" value="m">months
  116.67 -       <input type="radio" name="expiryunits" value="y">years
  116.68 -  </td>
  116.69 -</tr>
  116.70 -</tbody>
  116.71 -</table>
  116.72 -</td></tr>
  116.73 -
  116.74 -##WHITESPACE## ##GREYLINE1## ##WHITESPACE##
  116.75 -
  116.76 -<tr>
  116.77 -  <td><input type="submit" name="action" value="refresh expiry time"></td>
  116.78 -</tr>
  116.79 -</table>
  116.80 -</form>
  116.81 -</td>
  116.82 -</tbody>
  116.83 -</table>
  116.84 -
  116.85 -
  116.86 -
  116.87 -
  116.88 -<!-- end content -->
   117.1 --- a/tools/control/web/tmpl/vd-vdrr.tmpl	Fri Nov 21 12:05:32 2003 +0000
   117.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.3 @@ -1,77 +0,0 @@
   117.4 -Refresh Virtual Disk
   117.5 -SECTION&XenoServers
   117.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   117.7 -
   117.8 -<!-- content -->
   117.9 -<img src="pixel.gif" class="block" width="1" height="12">
  117.10 -
  117.11 -<table cellpadding="0" cellspacing="0" border="0">
  117.12 -<tbody>
  117.13 -INCLUDE&vdmenu.tmpl
  117.14 -<td valign="top">
  117.15 -
  117.16 -<%
  117.17 -  HttpServletRequestWrapper hsrw = new HttpServletRequestWrapper(request);
  117.18 -
  117.19 -  String vds[] = hsrw.getParameterValues("vd");
  117.20 -  long expiry;
  117.21 -
  117.22 -  if (vds == null || vds.length == 0)
  117.23 -  {
  117.24 -%>
  117.25 -Error: No virtual disk chosen.<br>
  117.26 -<%
  117.27 -  }
  117.28 -  else if (hsrw.getParameter("expiry") == null ||
  117.29 -           hsrw.getParameter("expiry").trim().equals(""))
  117.30 -  {
  117.31 -%>
  117.32 -Error: expiry time not specified.<br>
  117.33 -<%
  117.34 -  }
  117.35 -  else
  117.36 -  {
  117.37 -    expiry = Long.decode(hsrw.getParameter("expiry")).longValue(); 
  117.38 -
  117.39 -    /* not perfect, but good enough for now... */
  117.40 -    if ( hsrw.getParameter("expiryunits").equals("d"))
  117.41 -    {
  117.42 -      expiry *= 24 * 60 * 60 * 1000;
  117.43 -    }
  117.44 -    else if ( hsrw.getParameter("expiryunits").equals("w"))
  117.45 -    {
  117.46 -      expiry *= 24 * 60 * 60 * 1000 * 7;
  117.47 -    }
  117.48 -    else if ( hsrw.getParameter("expiryunits").equals("m"))
  117.49 -    {
  117.50 -      expiry *= 24 * 60 * 60 * 1000 * 30;
  117.51 -    }
  117.52 -    else if ( hsrw.getParameter("expiryunits").equals("y"))
  117.53 -    {
  117.54 -      expiry *= 24 * 60 * 60 * 1000 * 365;
  117.55 -    }
  117.56 -
  117.57 -	expiry += System.currentTimeMillis();
  117.58 -	
  117.59 -    for (int i = 0; i < vds.length; i++)
  117.60 -    {
  117.61 -%>
  117.62 -vd = <%= new CommandVdRefresh(vds[i], new Date(expiry)).executeWeb() %> <br>
  117.63 -<%
  117.64 -    }
  117.65 -  }
  117.66 -%>
  117.67 -
  117.68 -<%
  117.69 -  root.doFlushState();
  117.70 -%>
  117.71 -
  117.72 -
  117.73 -</td>
  117.74 -</tbody>
  117.75 -</table>
  117.76 -
  117.77 -
  117.78 -
  117.79 -
  117.80 -<!-- end content -->
   118.1 --- a/tools/control/web/tmpl/vd-vdv.tmpl	Fri Nov 21 12:05:32 2003 +0000
   118.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.3 @@ -1,45 +0,0 @@
   118.4 -View Virtual Disks
   118.5 -SECTION&XenoServers
   118.6 -BREADCRUMB&Virtual Disk Manager&vd.jsp
   118.7 -
   118.8 -<!-- content -->
   118.9 -<img src="pixel.gif" class="block" width="1" height="12">
  118.10 -
  118.11 -<table cellpadding="0" cellspacing="0" border="0">
  118.12 -<tbody>
  118.13 -INCLUDE&vdmenu.tmpl
  118.14 -<td valign="top">
  118.15 -
  118.16 -<table cellpadding="2" cellspacing="0" border="0">
  118.17 -<tbody>
  118.18 -  <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>
  118.19 -
  118.20 -  <%
  118.21 -    Iterator i = root.vdm().getVirtualDisks();
  118.22 -    while (i.hasNext())
  118.23 -    {
  118.24 -      VirtualDisk vd = (VirtualDisk) i.next();
  118.25 -  %>
  118.26 -    <tr class="vdt">
  118.27 -      <td><%= vd.getKey() %></td>
  118.28 -      <td></td>
  118.29 -      <td><%= vd.getName() %></td>
  118.30 -      <td></td>
  118.31 -      <td><%= vd.getExpiry() %></td>
  118.32 -      <td></td>
  118.33 -      <td><%= Library.formatSize(vd.getSize()*Settings.SECTOR_SIZE,8,false) %></td>
  118.34 -    </tr>
  118.35 -  <%
  118.36 -    }
  118.37 -  %>
  118.38 -
  118.39 -</tbody>
  118.40 -</table>
  118.41 -</td>
  118.42 -</tbody>
  118.43 -</table>
  118.44 -
  118.45 -
  118.46 -
  118.47 -
  118.48 -<!-- end content -->
   119.1 --- a/tools/control/web/tmpl/vd.tmpl	Fri Nov 21 12:05:32 2003 +0000
   119.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.3 @@ -1,24 +0,0 @@
   119.4 -Virtual Disk Manager
   119.5 -SECTION&XenoServers
   119.6 -
   119.7 -<!-- content -->
   119.8 -<img src="pixel.gif" class="block" width="1" height="12">
   119.9 -
  119.10 -<table cellpadding="0" cellspacing="0" border="0">
  119.11 -<tbody>
  119.12 -INCLUDE&vdmenu.tmpl
  119.13 -<td valign="top">
  119.14 -<table cellpadding="0" cellspacing="0" border="0">
  119.15 -<tbody>
  119.16 -  <tr><td nowrap="nowrap">Virtual Disk Manager</td></tr>
  119.17 -
  119.18 -</tbody>
  119.19 -</table>
  119.20 -</td>
  119.21 -</tbody>
  119.22 -</table>
  119.23 -
  119.24 -
  119.25 -
  119.26 -
  119.27 -<!-- end content -->
   120.1 --- a/tools/control/web/tmpl/vdmenu.tmpl	Fri Nov 21 12:05:32 2003 +0000
   120.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.3 @@ -1,57 +0,0 @@
   120.4 -<td width="10" valign="top" align="right"></td>
   120.5 -
   120.6 -<td valign="top">
   120.7 -<table cellpadding="0" cellspacing="0" border="0">
   120.8 -<tbody>
   120.9 -<tr>
  120.10 -  <td class="menuheader" width="100">Partitions</td>
  120.11 -</tr>
  120.12 -<tr>
  120.13 -  <td class="sidemenu" width="100"><a href="vd-pv.jsp">View</a></td>
  120.14 -</tr>
  120.15 -<tr>
  120.16 -  <td class="sidemenu" width="100"><a href="vd-pa.jsp">Add</a></td>
  120.17 -</tr>
  120.18 -##WHITESPACE##
  120.19 -<tr>
  120.20 -  <td class="menuheader" width="100">Virtual Disk</td>
  120.21 -</tr>
  120.22 -<tr>
  120.23 -  <td class="sidemenu" width="100"><a href="vd-vdv.jsp">View</a></td>
  120.24 -</tr>
  120.25 -<tr>
  120.26 -  <td class="sidemenu" width="100"><a href="vd-vdc.jsp">Create</a></td>
  120.27 -</tr>
  120.28 -<tr>
  120.29 -  <td class="sidemenu" width="100"><a href="vd-vdd.jsp">Delete</a></td>
  120.30 -</tr>
  120.31 -<tr>
  120.32 -  <td class="sidemenu" width="100"><a href="vd-vdr.jsp">Refresh</a></td>
  120.33 -</tr>
  120.34 -##WHITESPACE##
  120.35 -<tr>
  120.36 -  <td class="menuheader" width="100">Free Space</td>
  120.37 -</tr>
  120.38 -<tr>
  120.39 -  <td class="sidemenu" width="100"><a href="vd-fv.jsp">View</a></td>
  120.40 -</tr>
  120.41 -##WHITESPACE##
  120.42 -<tr>
  120.43 -  <td class="menuheader" width="100">Virtual Block Device</td>
  120.44 -</tr>
  120.45 -<tr>
  120.46 -  <td class="sidemenu" width="100"><a href="vd-vbdv.jsp">View</a></td>
  120.47 -</tr>
  120.48 -<tr>
  120.49 -  <td class="sidemenu" width="100"><a href="vd-vbdc.jsp">Create</a></td>
  120.50 -</tr>
  120.51 -
  120.52 -</tbody>
  120.53 -</table>
  120.54 -</td>
  120.55 -
  120.56 -<td width="5" valign="top" align="right"></td>
  120.57 -
  120.58 -<td bgcolor="#666666" width="2"><img src="img/pixel.gif" class="block" width="2" height="50"></td>
  120.59 -
  120.60 -<td width="15" valign="top" align="right"></td>
   121.1 --- a/tools/control/web/tmpl/xenofoot.def	Fri Nov 21 12:05:32 2003 +0000
   121.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.3 @@ -1,28 +0,0 @@
   121.4 -<!-- START OF STANDARD FOOTER-->
   121.5 -</td>
   121.6 -</tr></table>
   121.7 -<!-- end body text -->
   121.8 -
   121.9 -<!-- footer -->
  121.10 -<br />
  121.11 -<table cellpadding="0" cellspacing="0" border="0" width="98%" summary="footer">
  121.12 -<tr><td bgcolor="#0099cc" colspan="2"><img
  121.13 -src="http://www.cl.cam.ac.uk/UoCCL/images/pixel.gif" class="block" width="1" height="4" border="0" alt="" /></td>
  121.14 -</tr>
  121.15 -<tr><td bgcolor="#cccccc" colspan="2"><img
  121.16 -src="http://www.cl.cam.ac.uk/UoCCL/images/pixel.gif" class="block" width="1" height="2" border="0" alt="" /></td>
  121.17 -</tr>
  121.18 -
  121.19 -<tr><td>
  121.20 -<div class="footer">
  121.21 -<!--Add Department name and email contact here-->