ia64/xen-unstable

changeset 5143:e41c470ae8b5

bitkeeper revision 1.1545 (42943a77oCSQWIL-DLwwTV7xUND3eQ)

Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
author cl349@firebug.cl.cam.ac.uk
date Wed May 25 08:42:31 2005 +0000 (2005-05-25)
parents 91dcc24c50de 17af4f434d0e
children c0d620b026e7
files .rootkeys tools/misc/Makefile tools/misc/xensv tools/python/setup.py tools/python/xen/sv/CreateDomain.py tools/python/xen/sv/Daemon.py tools/python/xen/sv/DomInfo.py tools/python/xen/sv/DomList.py tools/python/xen/sv/GenTabbed.py tools/python/xen/sv/HTMLBase.py tools/python/xen/sv/Main.py tools/python/xen/sv/MigrateDomain.py tools/python/xen/sv/NodeInfo.py tools/python/xen/sv/RestoreDomain.py tools/python/xen/sv/SaveDomain.py tools/python/xen/sv/TabView.py tools/python/xen/sv/Wizard.py tools/python/xen/sv/__init__.py tools/python/xen/sv/params.py tools/python/xen/sv/util.py tools/sv/Main.rpy tools/sv/Makefile tools/sv/images/destroy.png tools/sv/images/finish.png tools/sv/images/left-end-highlight.jpg tools/sv/images/left-end-no-highlight.jpg tools/sv/images/middle-highlight.jpg tools/sv/images/middle-no-highlight.jpg tools/sv/images/next.png tools/sv/images/orb_01.jpg tools/sv/images/orb_02.jpg tools/sv/images/pause.png tools/sv/images/previous.png tools/sv/images/reboot.png tools/sv/images/right-end-highlight.jpg tools/sv/images/right-end-no-highlight.jpg tools/sv/images/seperator-left-highlight.jpg tools/sv/images/seperator-right-highlight.jpg tools/sv/images/seperator.jpg tools/sv/images/shutdown.png tools/sv/images/small-destroy.png tools/sv/images/small-pause.png tools/sv/images/small-unpause.png tools/sv/images/unpause.png tools/sv/images/xen.png tools/sv/inc/script.js tools/sv/inc/style.css
line diff
     1.1 --- a/.rootkeys	Wed May 25 08:02:20 2005 +0000
     1.2 +++ b/.rootkeys	Wed May 25 08:42:31 2005 +0000
     1.3 @@ -732,7 +732,6 @@ 3f5ef5a2dTZP0nnsFoeq2jRf3mWDDg tools/mis
     1.4  405eedf6_nnNhFQ1I85lhCkLK6jFGA tools/misc/xencons
     1.5  40c9c4697z76HDfkCLdMhmaEwzFoNQ tools/misc/xend
     1.6  41adc641dV-0cDLSyzMs5BT8nL7v3Q tools/misc/xenperf.c
     1.7 -4107986eMWVdBoz4tXYoOscpN_BCYg tools/misc/xensv
     1.8  4056f5155QYZdsk-1fLdjsZPFTnlhg tools/misc/xensymoops
     1.9  40cf2937dqM1jWW87O5OoOYND8leuA tools/misc/xm
    1.10  4270cc81g3nSNYCZ1ryCMDEbLtMtbQ tools/pygrub/Makefile
    1.11 @@ -803,22 +802,6 @@ 40dfd40aMOhnw_cQLve9462UR5yYxQ tools/pyt
    1.12  3fbd0a42l40lM0IICw2jXbQBVZSdZg tools/python/xen/lowlevel/xc/xc.c
    1.13  40dc4076St6AmPTmQPrtQ6LGHPxGmw tools/python/xen/lowlevel/xu/__init__.py
    1.14  40dc4076CwBYRTUQDdbdU1L6KcLgSw tools/python/xen/lowlevel/xu/xu.c
    1.15 -41052eb84_irpx0E9N_kqBp9eoin5g tools/python/xen/sv/CreateDomain.py
    1.16 -4107986egkTAMIHW7n-i4ShvCGWpLQ tools/python/xen/sv/Daemon.py
    1.17 -40fcefb2qm13BbRZBydAatOavaS0fQ tools/python/xen/sv/DomInfo.py
    1.18 -40fcefb2-RIU8GB67mJMRzybME9bxw tools/python/xen/sv/DomList.py
    1.19 -40fcefb23FfQn-ZBCbcHqA0cPGqQxw tools/python/xen/sv/GenTabbed.py
    1.20 -40fcefb2QZAn3u3sX-M7NXBjOv5HGg tools/python/xen/sv/HTMLBase.py
    1.21 -40fcefb2vnfDbl4w_yCTedROPuqs0g tools/python/xen/sv/Main.py
    1.22 -4186e24fZMp7_bX4f50MvUscdrST9Q tools/python/xen/sv/MigrateDomain.py
    1.23 -40fcefb24h-04WaHag-Tg4nxWPhTig tools/python/xen/sv/NodeInfo.py
    1.24 -4186e24fb4YtJw155tNtSXXN6nEWqA tools/python/xen/sv/RestoreDomain.py
    1.25 -4186e24fVXt0lfeQSAy1eiFKnPCHTg tools/python/xen/sv/SaveDomain.py
    1.26 -40fcefb2Sif__6AqrANeBQZZfvP-6w tools/python/xen/sv/TabView.py
    1.27 -41052eb8UrgtUkuJPg7oY1tutVQHsg tools/python/xen/sv/Wizard.py
    1.28 -40fcefb2DqteqCCZYDCvvh4Q5jBd0w tools/python/xen/sv/__init__.py
    1.29 -4107986e6qN1IdvIDdId0AYFmDMkiQ tools/python/xen/sv/params.py
    1.30 -40fcefb4rnaZNjqsBu7A5V2rlLyqRw tools/python/xen/sv/util.py
    1.31  40d8915cyoVA0hJxiBFNymL7YvDaRg tools/python/xen/util/Brctl.py
    1.32  40dfd40aGqGkiopOOgJxSF4iCbHM0Q tools/python/xen/util/__init__.py
    1.33  4270e4efFg3wHCCxXpA0h6yoMTkeSQ tools/python/xen/util/blkif.py
    1.34 @@ -894,33 +877,6 @@ 411b2c1ehdEGO_CwG0tvn85Q-Tfh5g tools/pyt
    1.35  40cf2937PSslwBliN1g7ofDy2H_RhA tools/python/xen/xm/opts.py
    1.36  40cf2937Z8WCNOnO2FcWdubvEAF9QQ tools/python/xen/xm/shutdown.py
    1.37  41b88ba6_C4---jeA895Efg9YFZgKA tools/python/xen/xm/sysrq.py
    1.38 -40fcefb2K1xqVVT4D-p7nL2GzS4scg tools/sv/Main.rpy
    1.39 -40ffbcb66Dj5F-1kCK9BcgSqCWkt1w tools/sv/Makefile
    1.40 -4120b0e5L_nW-u0MWRfIdXg4ng4OjA tools/sv/images/destroy.png
    1.41 -4107c921_OR9NTSv2dKFiLCXxrXoxA tools/sv/images/finish.png
    1.42 -40fcefb3wXQMsl9WkgQAVtdrupm4sw tools/sv/images/left-end-highlight.jpg
    1.43 -40fcefb3K6ESt5sQhD9aCQRscQIlXQ tools/sv/images/left-end-no-highlight.jpg
    1.44 -40fcefb3BUT98zPzW8kAFKuxGdh4XA tools/sv/images/middle-highlight.jpg
    1.45 -40fcefb38OTgsUKHBpwshLLIsiIaCA tools/sv/images/middle-no-highlight.jpg
    1.46 -41052eb9SDUqSLGtG6rxk6Ep5fOhFA tools/sv/images/next.png
    1.47 -40fcefb32SPtrw36c4S6YGFlLvkKuw tools/sv/images/orb_01.jpg
    1.48 -40fcefb3Ok5qkX3iM7ZEPVkRInrUpg tools/sv/images/orb_02.jpg
    1.49 -4104ffca9_GhWOxRE-83uZIad2Z1gg tools/sv/images/pause.png
    1.50 -41052eb9NQqHe_f9-ev1CaA3y5YYZg tools/sv/images/previous.png
    1.51 -41013a82ILk71xLqWFH5ZO5VmOIvBw tools/sv/images/reboot.png
    1.52 -40fcefb3JnT5XeKTuVF4yUMGOtuNZg tools/sv/images/right-end-highlight.jpg
    1.53 -40fcefb3-DuYOS7noo2W7b_0p7TOUg tools/sv/images/right-end-no-highlight.jpg
    1.54 -40fcefb3qNbAZR5FYGPAZ9sFPVMTDA tools/sv/images/seperator-left-highlight.jpg
    1.55 -40fcefb3dgsa24WLk_BJeYQHrDLuOg tools/sv/images/seperator-right-highlight.jpg
    1.56 -40fcefb3FtiX4Pd2kT8wDlp8u8xRhQ tools/sv/images/seperator.jpg
    1.57 -41013a82sUdUqBv8EoAUJii3gsZ-4g tools/sv/images/shutdown.png
    1.58 -4120b0e5RyNoIQNMjUs4A2kshovjaQ tools/sv/images/small-destroy.png
    1.59 -4120b0e6vW66wW6WvjQyFD0AZH2tng tools/sv/images/small-pause.png
    1.60 -4120b0e6USof7ieyGxEvtCdTMpxaQw tools/sv/images/small-unpause.png
    1.61 -4104ffca-jPHLVOrW0n0VghEXXtKxg tools/sv/images/unpause.png
    1.62 -40fcefb3yMSrZvApO9ToIi-iQwnchA tools/sv/images/xen.png
    1.63 -41013a83z27rKvWIxAfUBMVZ1eDCDg tools/sv/inc/script.js
    1.64 -40fcefb3zGC9XNBkSwTEobCoq8YClA tools/sv/inc/style.css
    1.65  422f27c8MDeRoOWZNdcRC5VDTcj3TQ tools/tests/Makefile
    1.66  422f27c81CCtXt4Lthf7JF3Ajr0fUA tools/tests/test_x86_emulator.c
    1.67  420b963dK3yGNtqxRM8npGZtrCQd1g tools/vnet/00INSTALL
     2.1 --- a/tools/misc/Makefile	Wed May 25 08:02:20 2005 +0000
     2.2 +++ b/tools/misc/Makefile	Wed May 25 08:42:31 2005 +0000
     2.3 @@ -16,7 +16,7 @@ HDRS     = $(wildcard *.h)
     2.4  TARGETS  = xenperf xc_shadow
     2.5  
     2.6  INSTALL_BIN  = $(TARGETS) xencons
     2.7 -INSTALL_SBIN = netfix xm xend xensv xenperf
     2.8 +INSTALL_SBIN = netfix xm xend xenperf
     2.9  
    2.10  all: build
    2.11  build: $(TARGETS)
     3.1 --- a/tools/misc/xensv	Wed May 25 08:02:20 2005 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,137 +0,0 @@
     3.4 -#!/usr/bin/env python
     3.5 -#  -*- mode: python; -*-
     3.6 -#============================================================================
     3.7 -# Copyright (C) 2004 Tom Wilkie <tw275@cl.cam.ac.uk>
     3.8 -# Copyright (C) 2004 Mike Wray  <mike.wray@hp.com>
     3.9 -#============================================================================
    3.10 -
    3.11 -"""SV web interface Lives in /usr/sbin.
    3.12 -   Provides pretty HTML management interface.
    3.13 -
    3.14 -   Run:
    3.15 -
    3.16 -   sv start
    3.17 -
    3.18 -   The daemon is stopped with:
    3.19 -
    3.20 -   sv stop
    3.21 -   
    3.22 -   The daemon will be accessible from http://localhost:8080/
    3.23 -"""
    3.24 -import os
    3.25 -import sys
    3.26 -import re
    3.27 -
    3.28 -# add fallback path for non-native python path installs if needed
    3.29 -sys.path.append('/usr/lib/python')
    3.30 -sys.path.append('/usr/lib64/python')
    3.31 -from xen.xend.server.params import XEND_PID_FILE
    3.32 -
    3.33 -class CheckError(ValueError):
    3.34 -    pass
    3.35 -
    3.36 -def hline():
    3.37 -    print >>sys.stderr, "*" * 70
    3.38 -
    3.39 -def msg(message):
    3.40 -    print >>sys.stderr, "*" * 3, message
    3.41 -
    3.42 -def check_logging():
    3.43 -    """Check python logging is installed and raise an error if not.
    3.44 -    Logging is standard from Python 2.3 on.
    3.45 -    """
    3.46 -    try:
    3.47 -        import logging
    3.48 -    except ImportError:
    3.49 -        hline()
    3.50 -        msg("Python logging is not installed.")
    3.51 -        msg("Use 'make install-logging' at the xen root to install.")
    3.52 -        msg("")
    3.53 -        msg("Alternatively download and install from")
    3.54 -        msg("http://www.red-dove.com/python_logging.html")
    3.55 -        hline()
    3.56 -        raise CheckError("logging is not installed")
    3.57 -
    3.58 -def check_twisted_version():
    3.59 -    """Check twisted is installed with a supported version and print a warning if not.
    3.60 -    Raises an error if twisted is not installed.
    3.61 -    """
    3.62 -    # Supported twisted release and major version.
    3.63 -    RELEASE = 1
    3.64 -    MAJOR   = 3
    3.65 -    try:
    3.66 -        from twisted.copyright import version
    3.67 -    except ImportError:
    3.68 -        hline()
    3.69 -        msg("The Twisted framework is not installed.")
    3.70 -        msg("Use 'make install-twisted' at the xen root to install.")
    3.71 -        msg("")
    3.72 -        msg("Alternatively download and install version %d.%d or higher" % (RELEASE, MAJOR))
    3.73 -        msg("from http://www.twistedmatrix.com/products")
    3.74 -        hline()
    3.75 -        raise CheckError("twisted is not installed")
    3.76 -        
    3.77 -    
    3.78 -    (release, major, minor) = version.split('.')
    3.79 -    release = int(release)
    3.80 -    major = int(major)
    3.81 -    if release > RELEASE: return
    3.82 -    if release == RELEASE and major >= MAJOR: return
    3.83 -    hline()
    3.84 -    msg("Warning: Twisted version not supported: %s" % version)
    3.85 -    msg("Use Twisted version %d.%d.0 or higher" % (RELEASE, MAJOR))
    3.86 -    hline()
    3.87 -    
    3.88 -def check_xend():
    3.89 -    """Check xend is running
    3.90 -    """
    3.91 -    
    3.92 -    if not os.path.isfile(XEND_PID_FILE) or not os.path.getsize(XEND_PID_FILE):
    3.93 -    	hline()
    3.94 -        msg( "Warning: Xend has not been detected as running." )
    3.95 -        msg( "Please start it immediately with: xend start " )
    3.96 -        hline()
    3.97 -        return 0
    3.98 -        
    3.99 -    # Read the pid of the previous invocation and search active process list.
   3.100 -    pid = open(XEND_PID_FILE, 'r').read()
   3.101 -    lines = os.popen('ps ' + pid + ' 2>/dev/null').readlines()
   3.102 -    for line in lines:
   3.103 -        if re.search('^ *' + pid + '.+xend', line):
   3.104 -            return 1
   3.105 -
   3.106 -    hline()
   3.107 -    msg( "Warning: Xend has not been detected as running." )
   3.108 -    msg( "Please start it immediately with: xend start " )
   3.109 -    hline() 
   3.110 -    return 0
   3.111 -    
   3.112 -def main():
   3.113 -    try:
   3.114 -        check_logging()
   3.115 -        check_twisted_version()
   3.116 -        check_xend()
   3.117 -    except CheckError:
   3.118 -        sys.exit(1)
   3.119 -    
   3.120 -    from xen.sv import Daemon
   3.121 -
   3.122 -    daemon = Daemon.instance()
   3.123 -    
   3.124 -    if not sys.argv[1:]:
   3.125 -        print 'usage: %s {start|stop|restart}' % sys.argv[0]
   3.126 -    elif os.fork():
   3.127 -        pid, status = os.wait()
   3.128 -        return status >> 8
   3.129 -    elif sys.argv[1] == 'start':
   3.130 -        return daemon.start()
   3.131 -    elif sys.argv[1] == 'stop':
   3.132 -        return daemon.stop()
   3.133 -    elif sys.argv[1] == 'restart':
   3.134 -        return daemon.stop() or daemon.start()
   3.135 -    else:
   3.136 -        print 'not an option:', sys.argv[1]
   3.137 -    return 1
   3.138 -
   3.139 -if __name__ == '__main__':
   3.140 -    sys.exit(main())
     4.1 --- a/tools/python/setup.py	Wed May 25 08:02:20 2005 +0000
     4.2 +++ b/tools/python/setup.py	Wed May 25 08:42:31 2005 +0000
     4.3 @@ -39,7 +39,6 @@ setup(name            = 'xen',
     4.4                           'xen.util',
     4.5                           'xen.xend',
     4.6                           'xen.xend.server',
     4.7 -                         'xen.sv',
     4.8                           'xen.xm',
     4.9                           'xen.web',
    4.10                           ],
     5.1 --- a/tools/python/xen/sv/CreateDomain.py	Wed May 25 08:02:20 2005 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,163 +0,0 @@
     5.4 -from xen.sv.Wizard import *
     5.5 -from xen.sv.util import *
     5.6 -from xen.sv.GenTabbed import PreTab
     5.7 -
     5.8 -from xen.xm.create import make_config, OptVals
     5.9 -
    5.10 -from xen.xend.XendClient import server
    5.11 -
    5.12 -class CreateDomain( Wizard ):
    5.13 -    def __init__( self, urlWriter ):
    5.14 -    	
    5.15 -    	sheets = [ CreatePage0,
    5.16 -          	   CreatePage1,
    5.17 -          	   CreatePage2,
    5.18 -                   CreatePage3,
    5.19 -                   CreatePage4,
    5.20 -                   CreateFinish ]
    5.21 -    
    5.22 -    	Wizard.__init__( self, urlWriter, "Create Domain", sheets )
    5.23 -       
    5.24 -class CreatePage0( Sheet ):
    5.25 -
    5.26 -    def __init__( self, urlWriter ):
    5.27 -        Sheet.__init__( self, urlWriter, "General", 0 )
    5.28 -        self.addControl( InputControl( 'name', 'VM Name', 'VM Name:', "[\\w|\\S]+", "You must enter a name in this field" ) )
    5.29 -        self.addControl( InputControl( 'memory', '64', 'Memory (Mb):', "[\\d]+", "You must enter a number in this field" ) )
    5.30 -        self.addControl( InputControl( 'cpu', '0', 'CPU:', "[\\d]+", "You must enter a number in this feild" ) )
    5.31 -        self.addControl( InputControl( 'cpu_weight', '1', 'CPU Weight:', "[\\d]+", "You must enter a number in this feild" ) )
    5.32 -                        
    5.33 -class CreatePage1( Sheet ):
    5.34 -
    5.35 -    def __init__( self, urlWriter ):
    5.36 -        Sheet.__init__( self, urlWriter, "Setup Kernel Image", 1 )
    5.37 -# For now we don't need to select a builder...
    5.38 -#        self.addControl( ListControl( 'builder', [('linux', 'Linux'), ('netbsd', 'NetBSD')], 'Kernel Type:' ) )
    5.39 -        self.addControl( FileControl( 'kernel', '/boot/vmlinuz-2.6.9-xenU', 'Kernel Image:' ) )
    5.40 -        self.addControl( InputControl( 'extra', '', 'Kernel Command Line Parameters:' ) )
    5.41 -
    5.42 -class CreatePage2( Sheet ):
    5.43 -
    5.44 -    def __init__( self, urlWriter ):
    5.45 -    	Sheet.__init__( self, urlWriter, "Setup Virtual Block Device", 2 )
    5.46 -        self.addControl( InputControl( 'num_vbds', '1', 'Number of VBDs:', '[\\d]+', "You must enter a number in this field" ) )
    5.47 -
    5.48 -class CreatePage3( Sheet ):
    5.49 -
    5.50 -    def __init__( self, urlWriter ):
    5.51 -        Sheet.__init__( self, urlWriter, "Setup Virtual Block Device", 3 )
    5.52 -        
    5.53 -    def write_BODY( self, request, err ):
    5.54 -        if not self.passback: self.parseForm( request )
    5.55 -    
    5.56 -    	previous_values = sxp2hash( string2sxp( self.passback ) ) #get the hash for quick reference
    5.57 -        
    5.58 -        num_vbds = previous_values.get( 'num_vbds' )
    5.59 -        
    5.60 -        for i in range( int( num_vbds ) ):
    5.61 -            self.addControl( InputControl( 'vbd%s_dom0' % i, 'phy:sda%s' % str(i + 1), 'Device %s name:' % i  ) )
    5.62 -            self.addControl( InputControl( 'vbd%s_domU' % i, 'sda%s' % str(i + 1), 'Virtualized device %s:' % i ) )
    5.63 -            self.addControl( ListControl( 'vbd%s_mode' % i, [('w', 'Read + Write'), ('r', 'Read Only')], 'Device %s mode:' % i ) )
    5.64 -            
    5.65 -        self.addControl( InputControl( 'root', '/dev/sda1', 'Root device (in VM):' ) )
    5.66 -        
    5.67 -        Sheet.write_BODY( self, request, err )
    5.68 -                
    5.69 -class CreatePage4( Sheet ):
    5.70 -
    5.71 -    def __init__( self, urlWriter ):        
    5.72 -        Sheet.__init__( self, urlWriter, "Network settings", 4 )
    5.73 -        self.addControl( ListControl( 'dhcp', [('off', 'No'), ('dhcp', 'Yes')], 'Use DHCP:' ) )
    5.74 -        self.addControl( InputControl( 'hostname', 'hostname', 'VM Hostname:' ) )
    5.75 -        self.addControl( InputControl( 'ip_addr', '1.2.3.4', 'VM IP Address:' ) )
    5.76 -        self.addControl( InputControl( 'ip_subnet', '255.255.255.0', 'VM Subnet Mask:' ) ) 
    5.77 -        self.addControl( InputControl( 'ip_gateway', '1.2.3.4', 'VM Gateway:' ) )           
    5.78 -        self.addControl( InputControl( 'ip_nfs', '1.2.3.4', 'NFS Server:' ) )  
    5.79 -                 
    5.80 -class CreateFinish( Sheet ):
    5.81 -
    5.82 -    def __init__( self, urlWriter ):
    5.83 -        Sheet.__init__( self, urlWriter, "All Done", 5 )
    5.84 -        
    5.85 -    def write_BODY( self, request, err ):
    5.86 -    
    5.87 -        if not self.passback: self.parseForm( request )
    5.88 -        
    5.89 -        xend_sxp = self.translate_sxp( string2sxp( self.passback ) )
    5.90 -        
    5.91 -        try:
    5.92 -            dom_sxp = server.xend_domain_create( xend_sxp )
    5.93 -            success = "Your domain was successfully created.\n"
    5.94 -        except:
    5.95 -            success = "There was an error creating your domain.\nThe configuration used is as follows:\n"
    5.96 -            dom_sxp = xend_sxp
    5.97 -            
    5.98 -            
    5.99 -        
   5.100 -        pt = PreTab( success + sxp2prettystring( dom_sxp ) )
   5.101 -        pt.write_BODY( request )
   5.102 -
   5.103 -        request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
   5.104 -        request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )
   5.105 -    
   5.106 -    def translate_sxp( self, fin_sxp ):
   5.107 -   	fin_hash = ssxp2hash( fin_sxp )
   5.108 -    
   5.109 -        def get( key ):
   5.110 -            ret = fin_hash.get( key )
   5.111 -            if ret:
   5.112 -                return ret
   5.113 -            else:
   5.114 -                return ""
   5.115 -        
   5.116 -    	vals = OptVals()
   5.117 -        
   5.118 -        vals.name = 	get( 'name' )
   5.119 -        vals.memory = 	get( 'memory' )
   5.120 -        vals.maxmem =   get( 'maxmem' )
   5.121 -        vals.cpu =  	get( 'cpu' )
   5.122 -        vals.cpu_weight = get( 'cpu_weight' )
   5.123 -        
   5.124 -        vals.builder =  get( 'builder' )       
   5.125 -        vals.kernel =   get( 'kernel' )
   5.126 -	vals.root = 	get( 'root' )
   5.127 -        vals.extra = 	get( 'extra' )
   5.128 -        
   5.129 -        #setup vbds
   5.130 -        
   5.131 -        vbds = []
   5.132 -        
   5.133 -        for i in range( int( get( 'num_vbds' ) ) ):
   5.134 -            vbds.append( ( get( 'vbd%s_dom0' % i ), get('vbd%s_domU' % i ), get( 'vbd%s_mode' % i ) ) )
   5.135 -        
   5.136 -        vals.disk = vbds    
   5.137 -            
   5.138 -        #misc
   5.139 -        
   5.140 -        vals.pci = []
   5.141 -        
   5.142 -        vals.blkif = None
   5.143 -        vals.netif = None
   5.144 -        vals.restart = None
   5.145 -        vals.console = None
   5.146 -        vals.ramdisk = None
   5.147 -        
   5.148 -        #setup vifs
   5.149 -        
   5.150 -        vals.vif = []
   5.151 -        vals.nics = 1
   5.152 -                
   5.153 -        ip =   get( 'ip_addr' )
   5.154 -        nfs =  get( 'ip_nfs' )
   5.155 -        gate = get( 'ip_gateway' )
   5.156 -        mask = get( 'ip_subnet' )
   5.157 -        host = get( 'hostname' )
   5.158 -        dhcp = get( 'dhcp' )
   5.159 -        
   5.160 -        vals.cmdline_ip = "%s:%s:%s:%s:%s:eth0:%s" % (ip, nfs, gate, mask, host, dhcp)
   5.161 -        
   5.162 -        try:
   5.163 -            return make_config( vals )
   5.164 -        except:
   5.165 -            return [["Error creating domain config."]]    
   5.166 -        
     6.1 --- a/tools/python/xen/sv/Daemon.py	Wed May 25 08:02:20 2005 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,108 +0,0 @@
     6.4 -###########################################################
     6.5 -## XenSV Web Control Interface Daemon
     6.6 -## Copyright (C) 2004, K A Fraser (University of Cambridge)
     6.7 -## Copyright (C) 2004, Mike Wray <mike.wray@hp.com>
     6.8 -## Copyright (C) 2004, Tom Wilkie <tw275@cam.ac.uk>
     6.9 -###########################################################
    6.10 -
    6.11 -import os
    6.12 -import os.path
    6.13 -import sys
    6.14 -import re
    6.15 -
    6.16 -from xen.sv.params import *
    6.17 -
    6.18 -from twisted.internet import reactor
    6.19 -from twisted.web import static, server, script
    6.20 -
    6.21 -class Daemon:
    6.22 -    """The xend daemon.
    6.23 -    """
    6.24 -    def __init__(self):
    6.25 -        self.shutdown = 0
    6.26 -        self.traceon = 0
    6.27 -
    6.28 -    def daemon_pids(self):
    6.29 -        pids = []
    6.30 -        pidex = '(?P<pid>\d+)'
    6.31 -        pythonex = '(?P<python>\S*python\S*)'
    6.32 -        cmdex = '(?P<cmd>.*)'
    6.33 -        procre = re.compile('^\s*' + pidex + '\s*' + pythonex + '\s*' + cmdex + '$')
    6.34 -        xendre = re.compile('^/usr/sbin/xend\s*(start|restart)\s*.*$')
    6.35 -        procs = os.popen('ps -e -o pid,args 2>/dev/null')
    6.36 -        for proc in procs:
    6.37 -            pm = procre.match(proc)
    6.38 -            if not pm: continue
    6.39 -            xm = xendre.match(pm.group('cmd'))
    6.40 -            if not xm: continue
    6.41 -            #print 'pid=', pm.group('pid'), 'cmd=', pm.group('cmd')
    6.42 -            pids.append(int(pm.group('pid')))
    6.43 -        return pids
    6.44 -
    6.45 -    def new_cleanup(self, kill=0):
    6.46 -        err = 0
    6.47 -        pids = self.daemon_pids()
    6.48 -        if kill:
    6.49 -            for pid in pids:
    6.50 -                print "Killing daemon pid=%d" % pid
    6.51 -                os.kill(pid, signal.SIGHUP)
    6.52 -        elif pids:
    6.53 -            err = 1
    6.54 -            print "Daemon already running: ", pids
    6.55 -        return err
    6.56 -            
    6.57 -    def cleanup(self, kill=False):
    6.58 -        # No cleanup to do if PID_FILE is empty.
    6.59 -        if not os.path.isfile(PID_FILE) or not os.path.getsize(PID_FILE):
    6.60 -            return 0
    6.61 -        # Read the pid of the previous invocation and search active process list.
    6.62 -        pid = open(PID_FILE, 'r').read()
    6.63 -        lines = os.popen('ps ' + pid + ' 2>/dev/null').readlines()
    6.64 -        for line in lines:
    6.65 -            if re.search('^ *' + pid + '.+xensv', line):
    6.66 -                if not kill:
    6.67 -                    print "Daemon is already running (pid %d)" % int(pid)
    6.68 -                    return 1
    6.69 -                # Old daemon is still active: terminate it.
    6.70 -                os.kill(int(pid), 1)
    6.71 -        # Delete the stale PID_FILE.
    6.72 -        os.remove(PID_FILE)
    6.73 -        return 0
    6.74 -
    6.75 -    def start(self, trace=0):
    6.76 -        if self.cleanup(kill=False):
    6.77 -            return 1
    6.78 -   
    6.79 -        # Fork -- parent writes PID_FILE and exits.
    6.80 -        pid = os.fork()
    6.81 -        if pid:
    6.82 -            # Parent
    6.83 -            pidfile = open(PID_FILE, 'w')
    6.84 -            pidfile.write(str(pid))
    6.85 -            pidfile.close()
    6.86 -            return 0
    6.87 -        # Child
    6.88 -        self.run()
    6.89 -        return 0
    6.90 -
    6.91 -    def stop(self):
    6.92 -        return self.cleanup(kill=True)
    6.93 -
    6.94 -    def run(self):
    6.95 -	root = static.File( SV_ROOT )
    6.96 -        root.indexNames = [ 'Main.rpy' ]
    6.97 -        root.processors = { '.rpy': script.ResourceScript }
    6.98 -        reactor.listenTCP( SV_PORT, server.Site( root ) )
    6.99 -        reactor.run()
   6.100 -
   6.101 -    def exit(self):
   6.102 -        reactor.disconnectAll()
   6.103 -        sys.exit(0)
   6.104 -
   6.105 -def instance():
   6.106 -    global inst
   6.107 -    try:
   6.108 -        inst
   6.109 -    except:
   6.110 -        inst = Daemon()
   6.111 -    return inst
     7.1 --- a/tools/python/xen/sv/DomInfo.py	Wed May 25 08:02:20 2005 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,149 +0,0 @@
     7.4 -from xen.xend.XendClient import getAsynchServer
     7.5 -server = getAsynchServer()
     7.6 -from xen.xend import PrettyPrint
     7.7 -
     7.8 -from xen.sv.HTMLBase import HTMLBase
     7.9 -from xen.sv.util import *
    7.10 -from xen.sv.GenTabbed import *
    7.11 -
    7.12 -DEBUG=1
    7.13 -
    7.14 -class DomInfo( GenTabbed ):
    7.15 -
    7.16 -    def __init__( self, urlWriter ):
    7.17 -        
    7.18 -        self.dom = 0;
    7.19 -    
    7.20 -        def tabUrlWriter( tab ):
    7.21 -            return urlWriter( "&dom=%s%s" % ( self.dom, tab ) )
    7.22 -        
    7.23 -        GenTabbed.__init__( self, "Domain Info", tabUrlWriter, [ 'General', 'SXP', 'Devices' ], [ DomGeneralTab, DomSXPTab, NullTab ]  )
    7.24 -
    7.25 -    def write_BODY( self, request ):
    7.26 -        dom = request.args.get('dom')
    7.27 -        
    7.28 -        if dom is None or len(dom) != 1:
    7.29 -            request.write( "<p>Please Select a Domain</p>" )
    7.30 -            return None
    7.31 -        else:
    7.32 -            self.dom = dom[0]
    7.33 -        
    7.34 -        GenTabbed.write_BODY( self, request )
    7.35 -        
    7.36 -    def write_MENU( self, request ):
    7.37 -        pass
    7.38 -
    7.39 -class DomGeneralTab( CompositeTab ):
    7.40 -    def __init__( self ):
    7.41 -       CompositeTab.__init__( self, [ DomGenTab, DomActionTab ] )        
    7.42 -        
    7.43 -class DomGenTab( GeneralTab ):
    7.44 -
    7.45 -    def __init__( self ):
    7.46 -    
    7.47 -        titles = {}
    7.48 -    
    7.49 -        titles[ 'ID' ] = 'dom'      
    7.50 -        titles[ 'Name' ] = 'name'
    7.51 -        titles[ 'CPU' ] = 'cpu'
    7.52 -        titles[ 'Memory' ] = ( 'mem', memoryFormatter )
    7.53 -        titles[ 'State' ] = ( 'state', stateFormatter )
    7.54 -        titles[ 'Total CPU' ] = ( 'cpu_time', smallTimeFormatter )
    7.55 -        titles[ 'Up Time' ] = ( 'up_time', bigTimeFormatter )
    7.56 -    
    7.57 -        GeneralTab.__init__( self, {}, titles )
    7.58 -        
    7.59 -    def write_BODY( self, request ):
    7.60 -    
    7.61 -        self.dom = getVar('dom', request)
    7.62 -        
    7.63 -        if self.dom is None:
    7.64 -            request.write( "<p>Please Select a Domain</p>" )
    7.65 -            return None
    7.66 -            
    7.67 -        self.dict = getDomInfoHash( self.dom )
    7.68 -        
    7.69 -        GeneralTab.write_BODY( self, request )
    7.70 -            
    7.71 -class DomSXPTab( PreTab ):
    7.72 -
    7.73 -    def __init__( self ):
    7.74 -        self.dom = 0
    7.75 -        PreTab.__init__( self, "" )
    7.76 -
    7.77 -
    7.78 -    def write_BODY( self, request ):
    7.79 -        self.dom = getVar('dom', request)
    7.80 -        
    7.81 -        if self.dom is None:
    7.82 -            request.write( "<p>Please Select a Domain</p>" )
    7.83 -            return None
    7.84 -
    7.85 -        try:
    7.86 -            domInfo = server.xend_domain( self.dom )
    7.87 -        except:
    7.88 -            domInfo = [["Error getting domain details."]]
    7.89 -            
    7.90 -        self.source = sxp2prettystring( domInfo )
    7.91 -        
    7.92 -        PreTab.write_BODY( self, request )
    7.93 -        
    7.94 -class DomActionTab( ActionTab ):
    7.95 -
    7.96 -    def __init__( self ):
    7.97 -    	actions = { "shutdown" : ( "Shutdown the Domain", "shutdown.png" ),
    7.98 -        	    "reboot" : ( "Reboot the Domain", "reboot.png" ),
    7.99 -                    "pause" : ( "Pause the Domain", "pause.png" ),
   7.100 -                    "unpause" : ( "Unpause the Domain", "unpause.png" ),
   7.101 -                    "destroy" : ( "Destroy the Domain", "destroy.png" ) }
   7.102 -        ActionTab.__init__( self, actions )    
   7.103 -        
   7.104 -    def op_shutdown( self, request ):
   7.105 -   	dom = getVar( 'dom', request )
   7.106 -        if not dom is None and dom != '0':
   7.107 -    	   if DEBUG: print ">DomShutDown %s" % dom
   7.108 -           try:
   7.109 -    	   	server.xend_domain_shutdown( int( dom ), "halt" )
   7.110 -           except:
   7.111 -           	pass
   7.112 -    
   7.113 -    def op_reboot( self, request ):
   7.114 -       	dom = getVar( 'dom', request )
   7.115 -        if not dom is None and dom != '0':
   7.116 -    	    if DEBUG: print ">DomReboot %s" % dom
   7.117 -            try:
   7.118 -            	server.xend_domain_shutdown( int( dom ), "reboot" )
   7.119 -            except:
   7.120 -            	pass
   7.121 -                
   7.122 -    def op_pause( self, request ):
   7.123 -       	dom = getVar( 'dom', request )
   7.124 -        if not dom is None and dom != '0':
   7.125 -    	    if DEBUG: print ">DomPause %s" % dom
   7.126 -            try:
   7.127 -                server.xend_domain_pause( int( dom ) )
   7.128 -            except:
   7.129 -            	pass
   7.130 -               
   7.131 -    def op_unpause( self, request ):
   7.132 -       	dom = getVar( 'dom', request )
   7.133 -        if not dom is None and dom != '0':
   7.134 -    	   if DEBUG: print ">DomUnpause %s" % dom
   7.135 -           try:
   7.136 -               server.xend_domain_unpause( int( dom ) )
   7.137 -    	   except:
   7.138 -               pass
   7.139 -               
   7.140 -    def op_destroy( self, request ):
   7.141 -    	dom = getVar( 'dom', request )
   7.142 -        if not dom is None and dom != '0':
   7.143 -    	   if DEBUG: print ">DomDestroy %s" % dom
   7.144 -           try:
   7.145 -           	server.xend_domain_destroy( int( dom ), "halt" )
   7.146 -           except:
   7.147 -           	pass
   7.148 -        
   7.149 -    
   7.150 -    
   7.151 -        
   7.152 -
     8.1 --- a/tools/python/xen/sv/DomList.py	Wed May 25 08:02:20 2005 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,81 +0,0 @@
     8.4 -from xen.xend.XendClient import server
     8.5 -from xen.xend import sxp
     8.6 -
     8.7 -from xen.sv.HTMLBase import HTMLBase
     8.8 -from xen.sv.util import *
     8.9 -
    8.10 -class DomList( HTMLBase ):
    8.11 -    
    8.12 -    isLeaf = True
    8.13 -
    8.14 -    def __init__( self, urlWriter ):
    8.15 -        HTMLBase.__init__(self)
    8.16 -        self.urlWriter = urlWriter
    8.17 -        
    8.18 -    def write_MENU( self, request ):
    8.19 -    	return self.write_BODY( request, head=True, long=False ) 
    8.20 -
    8.21 -    def write_BODY( self, request, head=True, long=True ):
    8.22 -        
    8.23 -    	domains = None
    8.24 -    
    8.25 -    	try:
    8.26 -        	domains = server.xend_domains()
    8.27 -        	domains.sort()
    8.28 -  	except:
    8.29 -        	pass
    8.30 -                
    8.31 -        request.write( "\n<table style='border:0px solid white' cellspacing='0' cellpadding='0' border='0' width='100%'>\n" )
    8.32 -        
    8.33 -        if head:
    8.34 -            request.write( "<tr class='domainInfoHead'>" )
    8.35 -            self.write_DOMAIN_HEAD( request, long )
    8.36 -            request.write( "</tr>" )
    8.37 -        
    8.38 -        odd = True
    8.39 -        
    8.40 -        if not domains is None:
    8.41 -            for domain in domains:
    8.42 -                if odd:
    8.43 -                    request.write( "<tr class='domainInfoOdd'>\n" )
    8.44 -                    odd = False
    8.45 -                else:
    8.46 -                    request.write( "<tr class='domainInfoEven'>\n" )
    8.47 -                    odd = True
    8.48 -                self.write_DOMAIN( request, getDomInfoHash( domain ), long )
    8.49 -                request.write( "</tr>\n" )
    8.50 -        else:
    8.51 -        	request.write( "<tr colspan='10'><p class='small'>Error getting domain list<br/>Perhaps XenD not running?</p></tr>")
    8.52 -                
    8.53 -        request.write( "</table>\n" )
    8.54 -            
    8.55 -    def write_DOMAIN( self, request, domInfoHash, long=True ):   
    8.56 -        request.write( "<td class='domainInfo' align='center'>%(id)s</td>\n" % domInfoHash )
    8.57 -
    8.58 -        url = self.urlWriter( "&mod=info&dom=%(id)s" % domInfoHash )
    8.59 -
    8.60 -        request.write( "<td class='domainInfo' align='center'><a href='%s'>%s</a></td>\n" % ( url, domInfoHash['name'] ) )
    8.61 -        if long: 
    8.62 -            request.write( "<td class='domainInfo' align='center'>%(memory)5s</td>\n" % domInfoHash )
    8.63 -            request.write( "<td class='domainInfo' align='center'>%(cpu)2s</td>\n" % domInfoHash )
    8.64 -        request.write( "<td class='domainInfo' align='center'>%(state)5s</td>\n" % domInfoHash )
    8.65 -        if domInfoHash[ 'id' ] != "0":
    8.66 -            request.write( "<td class='domainInfo' align='center'>" )
    8.67 -            
    8.68 -            if domInfoHash[ 'state' ][ 2 ] == "-":
    8.69 -                request.write( "<img src='images/small-pause.png' onclick='doOp2( \"pause\", \"%(dom)-4s\" )'>" % domInfoHash )
    8.70 -            else:
    8.71 -                request.write( "<img src='images/small-unpause.png' onclick='doOp2( \"unpause\", \"%(dom)-4s\" )'>" % domInfoHash )              
    8.72 -            
    8.73 -            request.write( "<img src='images/small-destroy.png' onclick='doOp2( \"destroy\", \"%(dom)-4s\" )'></td>" % domInfoHash)
    8.74 -        else:
    8.75 -            request.write( "<td>&nbsp;</td>" )
    8.76 -
    8.77 -    def write_DOMAIN_HEAD( self, request, long=True ):
    8.78 -        request.write( "<td class='domainInfoHead' align='center'>Domain</td>\n" )      
    8.79 -        request.write( "<td class='domainInfoHead' align='center'>Name</td>\n" )      
    8.80 -        if long:
    8.81 -            request.write( "<td class='domainInfoHead' align='center'>Memory / Mb</td>\n" )      
    8.82 -            request.write( "<td class='domainInfoHead' align='center'>CPU</td>\n" )      
    8.83 -        request.write( "<td class='domainInfoHead' align='center'>State</td>\n" )      
    8.84 -        request.write( "<td class='domainInfoHead' align='center'></td>\n" )
     9.1 --- a/tools/python/xen/sv/GenTabbed.py	Wed May 25 08:02:20 2005 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,131 +0,0 @@
     9.4 -import types
     9.5 -
     9.6 -from xen.sv.HTMLBase import HTMLBase
     9.7 -from xen.sv.TabView import TabView
     9.8 -from xen.sv.util import getVar
     9.9 -
    9.10 -class GenTabbed( HTMLBase ):
    9.11 -
    9.12 -    def __init__( self, title, urlWriter, tabStrings, tabObjects ):
    9.13 -        HTMLBase.__init__(self)
    9.14 -        self.tabStrings = tabStrings
    9.15 -        self.tabObjects = tabObjects
    9.16 -        self.urlWriter = urlWriter
    9.17 -        self.title = title
    9.18 -
    9.19 -    def write_BODY( self, request, urlWriter = None ):
    9.20 -    
    9.21 -        tab = int( getVar( 'tab', request, 0 ) )
    9.22 -            
    9.23 -        request.write( "<table style='' width='100%' border='0' cellspacing='0' cellpadding='0'>" )
    9.24 -        request.write( "<tr><td>" )
    9.25 -        
    9.26 -        request.write( "<p align='center'><u>%s</u></p>" % self.title )
    9.27 -        
    9.28 -        TabView( tab, self.tabStrings, self.urlWriter ).write_BODY( request )
    9.29 -        
    9.30 -        request.write( "</td></tr><tr><td>" )
    9.31 -        
    9.32 -        render_tab = self.tabObjects[ tab ]
    9.33 -                
    9.34 -        if render_tab is None:
    9.35 -            request.write( "<p>Bad Tab</p>" )
    9.36 -            self.finish_BODY( request )
    9.37 -        else:
    9.38 -            render_tab().write_BODY( request )
    9.39 -
    9.40 -        request.write( "</td></tr></table>" )
    9.41 -       
    9.42 -    def perform( self, request ):
    9.43 -        tab = int( getVar( 'tab', request, 0 ) )
    9.44 -            
    9.45 -        op_tab = self.tabObjects[ tab ]
    9.46 -        
    9.47 -        if op_tab:
    9.48 -            op_tab().perform( request )
    9.49 -        
    9.50 -class PreTab( HTMLBase ):
    9.51 -
    9.52 -    def __init__( self, source ):
    9.53 -        HTMLBase.__init__( self )
    9.54 -        self.source = source
    9.55 -    
    9.56 -    def write_BODY( self, request ):
    9.57 -        
    9.58 -        request.write( "<div style='display: block; overflow: auto; border: 0px solid black; width: 540px; padding: 5px; z-index:0; align: center'><pre>" )
    9.59 -        
    9.60 -        request.write( self.source )
    9.61 -        
    9.62 -        request.write( "</pre></div>" )
    9.63 -
    9.64 -class GeneralTab( HTMLBase ):
    9.65 -                        
    9.66 -    def __init__( self, dict, titles ):
    9.67 -        HTMLBase.__init__( self )
    9.68 -        self.dict = dict
    9.69 -        self.titles = titles
    9.70 -                        
    9.71 -    def write_BODY( self, request ): 
    9.72 -        
    9.73 -        request.write( "<table width='100%' cellspacing='0' cellpadding='0' border='0'>" )
    9.74 -        
    9.75 -        def writeAttr( niceName, attr, formatter=None ):
    9.76 -            if type( attr ) is types.TupleType:
    9.77 -                ( attr, formatter ) = attr
    9.78 -            
    9.79 -            if attr in self.dict:
    9.80 -                if formatter:
    9.81 -                    temp = formatter( self.dict[ attr ] )
    9.82 -                else:
    9.83 -                    temp = str( self.dict[ attr ] )
    9.84 -                request.write( "<tr><td width='50%%'><p>%s:</p></td><td width='50%%'><p>%s</p></td></tr>" % ( niceName, temp ) )
    9.85 -        
    9.86 -        for niceName, attr in self.titles.items():
    9.87 -            writeAttr( niceName, attr )
    9.88 -                            
    9.89 -        request.write( "</table>" )
    9.90 -
    9.91 -class NullTab( HTMLBase ):
    9.92 -    
    9.93 -    def __init__( self ):
    9.94 -        HTMLBase.__init__( self )
    9.95 -        self.title = "Null Tab"
    9.96 -        
    9.97 -    def write_BODY( self, request ):
    9.98 -        request.write( "<p>%s</p>" % self.title )
    9.99 -
   9.100 -class ActionTab( HTMLBase ):
   9.101 -
   9.102 -    def __init__( self, actions ):
   9.103 -        self.actions = actions
   9.104 -        HTMLBase.__init__( self )
   9.105 -        
   9.106 -    def write_BODY( self, request ):
   9.107 -        request.write("<p align='center'>")
   9.108 -         
   9.109 -        for ( command, ( text, image ) ) in self.actions.items():
   9.110 -            request.write("<img src='images/%s' width='54' height='54' onclick='doOp( \"%s\" )' onmouseover='update( \"button_desc\", \"%s\" )' " % ( image, command, text ) )
   9.111 -            request.write("onmouseout='update( \"button_desc\", \"&nbsp;\" )' style='button'>")
   9.112 -            request.write("&nbsp;&nbsp;")
   9.113 -    
   9.114 -        request.write("<p align='center'><span id='button_desc'>&nbsp;</span></p>")   
   9.115 -        request.write("</p>")        
   9.116 -        
   9.117 -class CompositeTab( HTMLBase ):
   9.118 -
   9.119 -    def __init__( self, tabs ):
   9.120 -    	HTMLBase.__init__( self )
   9.121 -        self.tabs = tabs
   9.122 -        
   9.123 -    def write_BODY( self, request ):
   9.124 -    	for tab in self.tabs:
   9.125 -            request.write( "<br/>" )
   9.126 -            tab().write_BODY( request )
   9.127 -            
   9.128 -    def perform( self, request ):
   9.129 -    	for tab in self.tabs:
   9.130 -            tab().perform( request )
   9.131 -    
   9.132 -    
   9.133 -       
   9.134 -        
    10.1 --- a/tools/python/xen/sv/HTMLBase.py	Wed May 25 08:02:20 2005 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,63 +0,0 @@
    10.4 -from twisted.web.resource import Resource
    10.5 -from xen.sv.util import *
    10.6 -
    10.7 -class HTMLBase( Resource ):
    10.8 -
    10.9 -    isLeaf = True
   10.10 - 
   10.11 -    def __init__( self ):
   10.12 -        Resource.__init__(self)
   10.13 -
   10.14 -    def render_POST( self, request ):
   10.15 -        self.perform( request )
   10.16 -        return self.render_GET( request )
   10.17 -        
   10.18 -    def render_GET( self, request ):
   10.19 -        self.write_TOP( request )
   10.20 -        self.write_BODY( request )
   10.21 -        self.write_BOTTOM( request )
   10.22 -        return ''
   10.23 -                
   10.24 -    def write_BODY( self, request ):
   10.25 -        request.write( "BODY" )
   10.26 -        
   10.27 -    def write_TOP( self, request ):
   10.28 -        request.write( '<html><head><title>Xen</title><link rel="stylesheet" type="text/css" href="inc/style.css" />' )
   10.29 -        request.write( '<script src="inc/script.js"></script>' )
   10.30 -        request.write( '</head><body>' )
   10.31 -        request.write('<form method="post" action="%s">' % request.uri)
   10.32 -
   10.33 -    def write_BOTTOM( self, request ):
   10.34 -        request.write('<input type="hidden" name="op" value="">')
   10.35 -        request.write('<input type="hidden" name="args" value="">')
   10.36 -        request.write('</form>')
   10.37 -        request.write( "</body></html>" )
   10.38 -
   10.39 -    def get_op_method(self, op):
   10.40 -        """Get the method for an operation.
   10.41 -        For operation 'foo' looks for 'op_foo'.
   10.42 -
   10.43 -        op	operation name
   10.44 -        returns method or None
   10.45 -        """
   10.46 -        op_method_name = 'op_' + op
   10.47 -        return getattr(self, op_method_name, None)
   10.48 -        
   10.49 -    def perform(self, req):
   10.50 -        """General operation handler for posted operations.
   10.51 -        For operation 'foo' looks for a method op_foo and calls
   10.52 -        it with op_foo(req). Replies with code 500 if op_foo
   10.53 -        is not found.
   10.54 -
   10.55 -        The method must return a list when req.use_sxp is true
   10.56 -        and an HTML string otherwise (or list).
   10.57 -        Methods may also return a Deferred (for incomplete processing).
   10.58 -
   10.59 -        req	request
   10.60 -        """
   10.61 -        op = req.args.get('op')
   10.62 -        if not op is None and len(op) == 1:
   10.63 -            op = op[0]
   10.64 -            op_method = self.get_op_method(op)
   10.65 -            if op_method:
   10.66 -                op_method( req )   
    11.1 --- a/tools/python/xen/sv/Main.py	Wed May 25 08:02:20 2005 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,113 +0,0 @@
    11.4 -from xen.sv.HTMLBase import HTMLBase
    11.5 -from xen.sv.DomList  import DomList
    11.6 -from xen.sv.NodeInfo import NodeInfo
    11.7 -from xen.sv.DomInfo  import DomInfo
    11.8 -from xen.sv.CreateDomain import CreateDomain
    11.9 -from xen.sv.MigrateDomain import MigrateDomain
   11.10 -from xen.sv.SaveDomain import SaveDomain
   11.11 -from xen.sv.RestoreDomain import RestoreDomain
   11.12 -
   11.13 -from xen.xend.XendClient import server
   11.14 -
   11.15 -from xen.sv.util import getVar
   11.16 -
   11.17 -class Main( HTMLBase ):
   11.18 -    
   11.19 -    isLeaf = True
   11.20 -
   11.21 -    def __init__( self, urlWriter = None ):
   11.22 -        self.modules = { "node": NodeInfo, 
   11.23 -                         "list": DomList, 
   11.24 -                         "info": DomInfo,
   11.25 -                         "create": CreateDomain,
   11.26 -                         "migrate" : MigrateDomain,
   11.27 -                         "save" : SaveDomain,
   11.28 -                         "restore" : RestoreDomain }
   11.29 -
   11.30 -        # ordered list of module menus to display
   11.31 -        self.module_menus = [ "node", "create", "migrate", "save",
   11.32 -                              "restore", "list" ]
   11.33 -        HTMLBase.__init__(self)
   11.34 -        
   11.35 -    def render_POST( self, request ):
   11.36 -    
   11.37 -    	#decide what module post'd the action
   11.38 -                
   11.39 -    	args = getVar( 'args', request )
   11.40 -
   11.41 -        mod = getVar( 'mod', request )
   11.42 -                
   11.43 -        if not mod is None and args is None:
   11.44 -            module = self.modules[ mod ]
   11.45 -            #check module exists
   11.46 -            if module:
   11.47 -               module( self.mainUrlWriter ).perform( request )
   11.48 -        else:
   11.49 -            self.perform( request )     
   11.50 -    
   11.51 -        return self.render_GET( request )
   11.52 -
   11.53 -    def mainUrlWriter( self, module ):
   11.54 -    	def fun( f ):
   11.55 -            return "Main.rpy?mod=%s%s" % ( module, f )
   11.56 -        return fun    
   11.57 -        
   11.58 -    def write_BODY( self, request ):
   11.59 -    
   11.60 -        request.write( "\n<table style='border:0px solid black; background: url(images/orb_01.jpg) no-repeat' cellspacing='0' cellpadding='0' border='0' width='780px' height='536px'>\n" )
   11.61 -        request.write( "<tr>\n" )
   11.62 -        request.write( " <td width='15px'>&nbsp;</td>" )
   11.63 -        request.write( " <td width='175px' align='center' valign'center'>" )
   11.64 -        request.write( "  <table cellspacing='0' cellpadding='0' border='0' width='100%' height='100%'>" )
   11.65 -        request.write( "   <tr><td height='140px' align='center' valign='bottom'><a href='http://www.cl.cam.ac.uk/Research/SRG/netos/xen/'>" )
   11.66 -        request.write( "   <img src='images/xen.png' width='150' height='75' border='0'/></a><br/></td></tr>" )
   11.67 -        request.write( "   <tr><td height='60px' align='center'><p class='small'>SV Web Interface<br/>(C) <a href='mailto:tw275@cam.ac.uk'>Tom Wilkie</a> 2004</p></td></tr>")
   11.68 -        request.write( "   <tr><td align='center' valign='top'>" )
   11.69 -
   11.70 -        for modName in self.module_menus:
   11.71 -            self.modules[modName]( self.mainUrlWriter( modName ) ).write_MENU( request )
   11.72 -        
   11.73 -        request.write( "   </td></tr>" )
   11.74 -        request.write( "  </table>" )
   11.75 -        request.write( " &nbsp;" )
   11.76 -        request.write( " </td>\n" )
   11.77 -        request.write( " <td width='15px'>&nbsp;</td>" )
   11.78 -        request.write( " <td width='558px' align='left' valign='top'>" )
   11.79 -        request.write( "  <table cellspacing='0' cellpadding='0' border='0' width='100%' height='100%'>" )
   11.80 -        request.write( "   <tr><td height='20px'></td></tr>" )
   11.81 -        request.write( "   <tr><td align='center' valign='top'>" )
   11.82 -        
   11.83 -        modName = getVar('mod', request)
   11.84 -        
   11.85 -        if modName is None:
   11.86 -            request.write( '<p>Please select a module</p>' )
   11.87 -        else:
   11.88 -            module = self.modules[ modName ]
   11.89 -            if module:
   11.90 -               module( self.mainUrlWriter( modName ) ).write_BODY( request )  
   11.91 -            else:
   11.92 -               request.write( '<p>Invalid module. Please select another</p>' )
   11.93 -    
   11.94 -        request.write( "   </td></tr>" )
   11.95 -        request.write( "  </table>" )
   11.96 -        request.write( " </td>\n" )
   11.97 -        request.write( " <td width='17px'>&nbsp;</td>" )
   11.98 -        request.write( "</tr>\n" )
   11.99 -        
  11.100 -        request.write( "</table>\n" )
  11.101 -        
  11.102 -                
  11.103 -    def op_destroy( self, request ):
  11.104 -    	dom = getVar( 'dom', request )
  11.105 -        if not dom is None and dom != "0":
  11.106 -            server.xend_domain_destroy( int( dom ), "halt" ) 
  11.107 -                 
  11.108 -    def op_pause( self, request ):
  11.109 -    	dom = getVar( 'dom', request )
  11.110 -        if not dom is None and dom != "0":
  11.111 -            server.xend_domain_pause( int( dom ) )      
  11.112 -    
  11.113 -    def op_unpause( self, request ):
  11.114 -    	dom = getVar( 'dom', request )
  11.115 -        if not dom is None and dom != "0":
  11.116 -            server.xend_domain_unpause( int( dom ) )      
    12.1 --- a/tools/python/xen/sv/MigrateDomain.py	Wed May 25 08:02:20 2005 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,72 +0,0 @@
    12.4 -from xen.sv.Wizard import *
    12.5 -from xen.sv.util import *
    12.6 -from xen.sv.GenTabbed import PreTab
    12.7 -
    12.8 -from xen.xm.create import make_config, OptVals
    12.9 -
   12.10 -from xen.xend.XendClient import server
   12.11 -
   12.12 -class MigrateDomain( Wizard ):
   12.13 -    def __init__( self, urlWriter ):
   12.14 -
   12.15 -        sheets = [ ChooseMigrateDomain,
   12.16 -                   DoMigrate ]
   12.17 -
   12.18 -        Wizard.__init__( self, urlWriter, "Migrate Domain", sheets )
   12.19 -
   12.20 -
   12.21 -class ChooseMigrateDomain( Sheet ):
   12.22 -    def __init__( self, urlWriter ):
   12.23 -        Sheet.__init__( self, urlWriter, "Configure Migration", 0)
   12.24 -        try:
   12.25 -            domains = server.xend_domains()
   12.26 -            domains.sort()
   12.27 -        except:
   12.28 -            pass
   12.29 -
   12.30 -        domnames = []
   12.31 -        for i in domains:
   12.32 -            if i != 'Domain-0': domnames.append((i,i))
   12.33 -        
   12.34 -        self.addControl( ListControl('domid',
   12.35 -                                     domnames,
   12.36 -                                     'Domain ID:') )
   12.37 -        self.addControl( TickControl('live',
   12.38 -                                     'True',
   12.39 -                                     'Live migrate:') )
   12.40 -        self.addControl( InputControl('rate',
   12.41 -                                      '0',
   12.42 -                                      'Rate limit:') )
   12.43 -        self.addControl( InputControl( 'dest', 'myhost.mydomain',
   12.44 -                                       'Name or IP address:',
   12.45 -                                       ".*") )
   12.46 -
   12.47 -class DoMigrate( Sheet ):
   12.48 -    def __init__(self, urlWriter ):
   12.49 -        Sheet.__init__(self, urlWriter, "Migration Done", 1)
   12.50 -
   12.51 -    def write_BODY( self, request, err ):
   12.52 -
   12.53 -        if not self.passback: self.parseForm( request )
   12.54 -
   12.55 -#        print string2sxp(self.passback)
   12.56 -        
   12.57 -        config = ssxp2hash ( string2sxp( self.passback ) )
   12.58 -      
   12.59 -        try:
   12.60 -            print config
   12.61 -            print config['domid'], config['dest']
   12.62 -            dom_sxp = server.xend_domain_migrate( config['domid'],
   12.63 -                                                  config['dest'],
   12.64 -                                                  config.get('live') == 'True',
   12.65 -                                                  config['rate'] )
   12.66 -            success = "Your domain was successfully Migrated.\n"
   12.67 -        except Exception, e:
   12.68 -            success = "There was an error migrating your domain\n"
   12.69 -            dom_sxp = str(e)
   12.70 -        
   12.71 -        pt = PreTab( success + dom_sxp ) # sxp2prettystring( dom_sxp ) )
   12.72 -        pt.write_BODY( request )
   12.73 -
   12.74 -        request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
   12.75 -        request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )
    13.1 --- a/tools/python/xen/sv/NodeInfo.py	Wed May 25 08:02:20 2005 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,64 +0,0 @@
    13.4 -from xen.xend.XendClient import server
    13.5 -
    13.6 -from xen.sv.util import *
    13.7 -from xen.sv.GenTabbed import *
    13.8 -
    13.9 -class NodeInfo( GenTabbed ):
   13.10 -
   13.11 -    def __init__( self, urlWriter ):
   13.12 -    
   13.13 -        GenTabbed.__init__( self, "Node Details", urlWriter, [ 'General', 'Dmesg', ], [ NodeGeneralTab, NodeDmesgTab ] )
   13.14 -    
   13.15 -    def write_MENU( self, request ):
   13.16 -        request.write( "<p class='small'><a href='%s'>Node details</a></p>" % self.urlWriter( '' ) )
   13.17 -
   13.18 -class NodeGeneralTab( CompositeTab ):
   13.19 -    def __init__( self ):
   13.20 -    	CompositeTab.__init__( self, [ NodeInfoTab, NodeActionTab ] )        
   13.21 -        
   13.22 -class NodeInfoTab( GeneralTab ):
   13.23 -                        
   13.24 -    def __init__( self ):
   13.25 -         
   13.26 -    	nodeInfo = {}
   13.27 -        try:
   13.28 -            nodeInfo = sxp2hash( server.xend_node() )
   13.29 -   	except:
   13.30 -            nodeInfo[ 'system' ] = 'Error getting node info'
   13.31 -             
   13.32 -        dictTitles = {}
   13.33 -        dictTitles[ 'System' ] = 'system'
   13.34 -        dictTitles[ 'Hostname' ] = 'host' 
   13.35 -        dictTitles[ 'Release' ] = 'release' 
   13.36 -        dictTitles[ 'Version' ] ='version' 
   13.37 -        dictTitles[ 'Machine' ] = 'machine' 
   13.38 -        dictTitles[ 'Cores' ] = 'cores' 
   13.39 -        dictTitles[ 'Hyperthreading' ] = ( 'hyperthreads_per_core', hyperthreadFormatter )
   13.40 -        dictTitles[ 'CPU Speed' ] = ( 'cpu_mhz', cpuFormatter )
   13.41 -        dictTitles[ 'Memory' ] = ( 'memory', memoryFormatter )
   13.42 -        dictTitles[ 'Free Memory' ] = ( 'free_memory', memoryFormatter )
   13.43 -        
   13.44 -        GeneralTab.__init__( self, dict=nodeInfo, titles=dictTitles )
   13.45 -
   13.46 -class NodeDmesgTab( PreTab ):
   13.47 -
   13.48 -    def __init__( self ):
   13.49 -    	try:
   13.50 -            dmesg = server.xend_node_get_dmesg()
   13.51 -        except:
   13.52 -            dmesg = "Error getting node information: XenD not running?"
   13.53 -        PreTab.__init__( self, dmesg )
   13.54 -  
   13.55 -class NodeActionTab( ActionTab ):
   13.56 -
   13.57 -    def __init__( self ):
   13.58 -        ActionTab.__init__( self, { "shutdown" : ( "Shutdown the Node", "shutdown.png" ),
   13.59 -        	"reboot" : ( "Reboot the Node", "reboot.png" ) } )    
   13.60 -        
   13.61 -    def op_shutdown( self, request ):
   13.62 -    	print ">NodeShutDown"
   13.63 -    	server.xend_node_shutdown()
   13.64 -    
   13.65 -    def op_reboot( self, request ):
   13.66 -    	print ">NodeReboot"
   13.67 -        server.xend_node_reboot()
    14.1 --- a/tools/python/xen/sv/RestoreDomain.py	Wed May 25 08:02:20 2005 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,46 +0,0 @@
    14.4 -from xen.sv.Wizard import *
    14.5 -from xen.sv.util import *
    14.6 -from xen.sv.GenTabbed import PreTab
    14.7 -
    14.8 -from xen.xm.create import make_config, OptVals
    14.9 -
   14.10 -from xen.xend.XendClient import server
   14.11 -
   14.12 -class RestoreDomain( Wizard ):
   14.13 -    def __init__( self, urlWriter ):
   14.14 -
   14.15 -        sheets = [ ChooseRestoreDomain,
   14.16 -                   DoRestore ]
   14.17 -
   14.18 -        Wizard.__init__( self, urlWriter, "Restore Domain", sheets )
   14.19 -
   14.20 -
   14.21 -class ChooseRestoreDomain( Sheet ):
   14.22 -    def __init__( self, urlWriter ):
   14.23 -        Sheet.__init__( self, urlWriter, "Configure Restore", 0)
   14.24 -        
   14.25 -        self.addControl( InputControl( 'file', '',
   14.26 -                                       'Suspend file name:',
   14.27 -                                       ".*") )
   14.28 -
   14.29 -class DoRestore( Sheet ):
   14.30 -    def __init__(self, urlWriter ):
   14.31 -        Sheet.__init__(self, urlWriter, "Restore Done", 1)
   14.32 -
   14.33 -    def write_BODY( self, request, err ):
   14.34 -
   14.35 -        if not self.passback: self.parseForm( request )
   14.36 -        config = ssxp2hash ( string2sxp( self.passback ) )
   14.37 -      
   14.38 -        try:
   14.39 -            dom_sxp = server.xend_domain_restore( config['file'] )
   14.40 -            success = "Your domain was successfully restored.\n"
   14.41 -        except Exception, e:
   14.42 -            success = "There was an error restoring your domain\n"
   14.43 -            dom_sxp = str(e)
   14.44 -        
   14.45 -        pt = PreTab( success + sxp2prettystring( dom_sxp ) )
   14.46 -        pt.write_BODY( request )
   14.47 -
   14.48 -        request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
   14.49 -        request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )
    15.1 --- a/tools/python/xen/sv/SaveDomain.py	Wed May 25 08:02:20 2005 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,59 +0,0 @@
    15.4 -from xen.sv.Wizard import *
    15.5 -from xen.sv.util import *
    15.6 -from xen.sv.GenTabbed import PreTab
    15.7 -
    15.8 -from xen.xm.create import make_config, OptVals
    15.9 -
   15.10 -from xen.xend.XendClient import server
   15.11 -
   15.12 -class SaveDomain( Wizard ):
   15.13 -    def __init__( self, urlWriter ):
   15.14 -
   15.15 -        sheets = [ ChooseSaveDomain,
   15.16 -                   DoSave ]
   15.17 -
   15.18 -        Wizard.__init__( self, urlWriter, "Save Domain", sheets )
   15.19 -
   15.20 -
   15.21 -class ChooseSaveDomain( Sheet ):
   15.22 -    def __init__( self, urlWriter ):
   15.23 -        Sheet.__init__( self, urlWriter, "Configure Save", 0)
   15.24 -        try:
   15.25 -            domains = server.xend_domains()
   15.26 -            domains.sort()
   15.27 -        except:
   15.28 -            pass
   15.29 -
   15.30 -        domnames = []
   15.31 -        for i in domains:
   15.32 -            if i != 'Domain-0': domnames.append((i,i))
   15.33 -        
   15.34 -        self.addControl( ListControl('domid',
   15.35 -                                     domnames,
   15.36 -                                     'Domain ID:') )
   15.37 -        self.addControl( InputControl( 'file', '',
   15.38 -                                       'Suspend file name:',
   15.39 -                                       ".*") )
   15.40 -
   15.41 -class DoSave( Sheet ):
   15.42 -    def __init__(self, urlWriter ):
   15.43 -        Sheet.__init__(self, urlWriter, "Save Done", 1)
   15.44 -
   15.45 -    def write_BODY( self, request, err ):
   15.46 -
   15.47 -        if not self.passback: self.parseForm( request )
   15.48 -        config = ssxp2hash ( string2sxp( self.passback ) )
   15.49 -      
   15.50 -        try:
   15.51 -            dom_sxp = server.xend_domain_save( config['domid'],
   15.52 -                                                  config['file'] )
   15.53 -            success = "Your domain was successfully saved.\n"
   15.54 -        except Exception, e:
   15.55 -            success = "There was an error saving your domain\n"
   15.56 -            dom_sxp = str(e)
   15.57 -        
   15.58 -        pt = PreTab( success + dom_sxp ) # sxp2prettystring( dom_sxp ) )
   15.59 -        pt.write_BODY( request )
   15.60 -
   15.61 -        request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
   15.62 -        request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )
    16.1 --- a/tools/python/xen/sv/TabView.py	Wed May 25 08:02:20 2005 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,49 +0,0 @@
    16.4 -from xen.sv.HTMLBase import HTMLBase
    16.5 -
    16.6 -class TabView( HTMLBase ):
    16.7 -
    16.8 -    def __init__( self, tab, tabs, urlWriter ):
    16.9 -        HTMLBase.__init__(self)
   16.10 -        self.tab = tab # interger - tab id
   16.11 -        self.tabs = tabs
   16.12 -        self.urlWriter = urlWriter
   16.13 -
   16.14 -    def write_BODY( self, request ):
   16.15 -        request.write( "<table style='' border='0' cellspacing='0' cellpadding='0' align='center'>" )
   16.16 -        request.write( "<tr height='22'>" )
   16.17 -        
   16.18 -        if self.tab == 0:
   16.19 -            image = "left-end-highlight.jpg"
   16.20 -        else:
   16.21 -            image = "left-end-no-highlight.jpg"
   16.22 -            
   16.23 -        request.write( "<td height='22' width='14'><image src='images/%s' width='14' height='22'></td>" % image )  
   16.24 -                  
   16.25 -        count = len( self.tabs )
   16.26 -
   16.27 -        for i in range( count ):
   16.28 -        
   16.29 -            if i == self.tab:
   16.30 -                image = "middle-highlight.jpg" 
   16.31 -            else:
   16.32 -                image = "middle-no-highlight.jpg"
   16.33 -            
   16.34 -            request.write( "<td style='background: url(images/%s)'><p align='center'><a href='%s'>%s</a></p></td>" % ( image, self.urlWriter( "&tab=%s" % i ), self.tabs[ i ] ) )
   16.35 -
   16.36 -            if i < count-1:
   16.37 -                if i == self.tab:
   16.38 -                    image = "seperator-left-highlight.jpg"
   16.39 -                elif self.tab == i+1:
   16.40 -                    image = "seperator-right-highlight.jpg"                 
   16.41 -                else:
   16.42 -                    image = "seperator.jpg"
   16.43 -                    
   16.44 -                request.write( "<td height='22' width='23'><image src='images/%s' width='23' height='22'></td>" % image )
   16.45 -                    
   16.46 -        if self.tab == count - 1:
   16.47 -            image = "right-end-highlight.jpg"
   16.48 -        else:
   16.49 -            image = "right-end-no-highlight.jpg"
   16.50 -        
   16.51 -        request.write( "<td height='22' width='14'><image src='images/%s' width='14' height='22'></td>" % image )  
   16.52 -        request.write( "</tr></table>" )
    17.1 --- a/tools/python/xen/sv/Wizard.py	Wed May 25 08:02:20 2005 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,269 +0,0 @@
    17.4 -from xen.sv.util import *
    17.5 -from xen.sv.HTMLBase import HTMLBase
    17.6 -from xen.xend import sxp
    17.7 -
    17.8 -import re
    17.9 -
   17.10 -DEBUG = 0
   17.11 -
   17.12 -class Wizard( HTMLBase ):
   17.13 -
   17.14 -    def __init__( self, urlWriter, title, sheets ):
   17.15 -        HTMLBase.__init__( self )
   17.16 -        self.title = title
   17.17 -        self.sheets = sheets
   17.18 -        self.urlWriter = urlWriter
   17.19 -        
   17.20 -    def write_MENU( self, request ):
   17.21 -    	request.write( "<p class='small'><a href='%s'>%s</a></p>" % (self.urlWriter( '' ), self.title) ) 
   17.22 -    
   17.23 -    def write_BODY( self, request ):
   17.24 -        
   17.25 -   	request.write( "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>" )
   17.26 -        request.write( "<p align='center'><u>%s</u></p></td></tr><tr><td>" % self.title )
   17.27 -        
   17.28 -        currSheet = getVar( 'sheet', request )
   17.29 -    
   17.30 -        if not currSheet is None:
   17.31 -            currSheet = int( currSheet )
   17.32 -        else:
   17.33 -            currSheet = 0
   17.34 -            
   17.35 -        sheet = self.sheets[ currSheet ]( self.urlWriter )
   17.36 -        
   17.37 -        err = not sheet.validate( request )
   17.38 -        
   17.39 -        if not err:    
   17.40 -            op = getVar( 'op', request )
   17.41 -        
   17.42 -            if op == 'next':
   17.43 -               currSheet += 1
   17.44 -            elif op == 'prev':
   17.45 -               currSheet -= 1
   17.46 -             
   17.47 -            sheet = self.sheets[ currSheet ]( self.urlWriter )
   17.48 -        
   17.49 -        if getVar( 'visited-sheet%s' % currSheet, request ):
   17.50 -            sheet.write_BODY( request, err )
   17.51 -        else:
   17.52 -            sheet.write_BODY( request, False )
   17.53 -
   17.54 -        
   17.55 -        request.write( "</td></tr><tr><td><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>" )
   17.56 -        request.write( "<td width='80%'></td><td width='20%' align='center'><p align='center'>" )
   17.57 -	if currSheet > 0:
   17.58 -       	    request.write( "<img src='images/previous.png' onclick='doOp( \"prev\" )' onmouseover='update( \"wizText\", \"Previous\" )' onmouseout='update( \"wizText\", \"&nbsp;\" )'>&nbsp;" )
   17.59 -        if currSheet < ( len( self.sheets ) - 2 ):        
   17.60 -            request.write( "<img src='images/next.png' onclick='doOp( \"next\" )' onmouseover='update( \"wizText\", \"Next\" )' onmouseout='update( \"wizText\", \"&nbsp;\" )'>" )
   17.61 -        elif currSheet == ( len( self.sheets ) - 2 ):
   17.62 -            request.write( "<img src='images/finish.png' onclick='doOp( \"next\" )' onmouseover='update( \"wizText\", \"Finish\" )' onmouseout='update( \"wizText\", \"&nbsp;\" )'>" )
   17.63 -        request.write( "</p><p align='center'><span id='wizText'></span></p></td></tr></table>" )
   17.64 -        request.write( "</td></tr></table>" )
   17.65 -        
   17.66 -    def op_next( self, request ):
   17.67 -    	pass
   17.68 -        
   17.69 -    def op_prev( self, request ):
   17.70 -    	pass
   17.71 -        
   17.72 -    def op_finish( self, request ):
   17.73 -    	pass  
   17.74 -        
   17.75 -class Sheet( HTMLBase ):
   17.76 -
   17.77 -    def __init__( self, urlWriter, title, location ):
   17.78 -        HTMLBase.__init__( self )
   17.79 -        self.urlWriter = urlWriter
   17.80 -        self.feilds = []
   17.81 -        self.title = title
   17.82 -        self.location = location
   17.83 -        self.passback = None
   17.84 -        
   17.85 -    def parseForm( self, request ):
   17.86 -    	do_not_parse = [ 'mod', 'op', 'sheet', 'passback' ] 
   17.87 -    
   17.88 -    	passed_back = request.args
   17.89 -        
   17.90 -        temp_passback = passed_back.get( "passback" )
   17.91 -        
   17.92 -        if temp_passback is not None and len( temp_passback ) > 0:
   17.93 -            temp_passback = temp_passback[ len( temp_passback )-1 ]
   17.94 -        else:
   17.95 -            temp_passback = "( )"        
   17.96 -        
   17.97 -        last_passback = ssxp2hash( string2sxp( temp_passback ) ) #use special function - will work with no head on sxp
   17.98 -        
   17.99 -        if DEBUG: print last_passback
  17.100 -        
  17.101 -        for (key, value) in passed_back.items():
  17.102 -            if key not in do_not_parse:
  17.103 -                last_passback[ key ] = value[ len( value ) - 1 ]
  17.104 -                
  17.105 -        self.passback = sxp2string( hash2sxp( last_passback ) ) #store the sxp
  17.106 -        
  17.107 -        if DEBUG: print self.passback
  17.108 -        
  17.109 -    def write_BODY( self, request, err ):
  17.110 -    
  17.111 -    	if not self.passback: self.parseForm( request )
  17.112 -        
  17.113 -   	request.write( "<p>%s</p>" % self.title )
  17.114 -    
  17.115 -    	previous_values = ssxp2hash( string2sxp( self.passback ) ) #get the hash for quick reference
  17.116 -        
  17.117 -        request.write( "<table width='100%' cellpadding='0' cellspacing='1' border='0'>" )
  17.118 -        
  17.119 -    	for (feild, control) in self.feilds:
  17.120 -            control.write_Control( request, previous_values.get( feild ) )
  17.121 -            if err and not control.validate( previous_values.get( feild ) ):
  17.122 -            	control.write_Help( request )
  17.123 -            
  17.124 -        request.write( "</table>" )
  17.125 -            
  17.126 -        request.write( "<input type='hidden' name='passback' value=\"%s\"></p>" % self.passback )
  17.127 -        request.write( "<input type='hidden' name='sheet' value='%s'></p>" % self.location )
  17.128 -        request.write( "<input type='hidden' name='visited-sheet%s' value='True'></p>" % self.location )
  17.129 -                
  17.130 -    def addControl( self, control ):
  17.131 -    	self.feilds.append( [ control.getName(), control ] )
  17.132 -        
  17.133 -    def validate( self, request ):
  17.134 -    
  17.135 -        if not self.passback: self.parseForm( request )
  17.136 -            
  17.137 -    	check = True
  17.138 -        
  17.139 -        previous_values = ssxp2hash( string2sxp( self.passback ) ) #get the hash for quick reference
  17.140 -    	if DEBUG: print previous_values
  17.141 -      
  17.142 -      	for (feild, control) in self.feilds:
  17.143 -            if not control.validate( previous_values.get( feild ) ):
  17.144 -                check = False
  17.145 -                if DEBUG: print "> %s = %s" % (feild, previous_values.get( feild ))
  17.146 -
  17.147 -        return check
  17.148 -        
  17.149 -class SheetControl( HTMLBase ):
  17.150 -
  17.151 -    def __init__( self, reg_exp = ".*" ):
  17.152 -        HTMLBase.__init__( self )
  17.153 -        self.name = ""
  17.154 -        self.reg_exp = reg_exp 
  17.155 -        
  17.156 -    def write_Control( self, request, persistedValue ):
  17.157 -        request.write( "<tr colspan='2'><td>%s</td></tr>" % persistedValue )
  17.158 -        
  17.159 -    def write_Help( self, request ):
  17.160 -        request.write( "<tr><td align='right' colspan='2'><p class='small'>Text must match pattern:" )
  17.161 -        request.write( " %s</p></td></tr>" % self.reg_exp )
  17.162 -        
  17.163 -    def validate( self, persistedValue ):
  17.164 -    	if persistedValue is None:
  17.165 -            persistedValue = ""
  17.166 -            
  17.167 -        return not re.compile( self.reg_exp ).match( persistedValue ) is None
  17.168 -
  17.169 -    def getName( self ):
  17.170 -    	return self.name
  17.171 -        
  17.172 -    def setName( self, name ):
  17.173 -    	self.name = name
  17.174 -        
  17.175 -class InputControl( SheetControl ):
  17.176 -
  17.177 -    def __init__( self, name, defaultValue, humanText,  reg_exp = ".*", help_text = "You must enter the appropriate details in this feild." ):
  17.178 -        SheetControl.__init__( self, reg_exp )
  17.179 -        self.setName( name )
  17.180 -        
  17.181 -        self.defaultValue = defaultValue
  17.182 -        self.humanText = humanText
  17.183 -        self.help_text = help_text
  17.184 -        
  17.185 -    def write_Control( self, request, persistedValue ):
  17.186 -    	if persistedValue is None:
  17.187 -            persistedValue = self.defaultValue
  17.188 -        
  17.189 -        request.write( "<tr><td width='50%%'><p>%s</p></td><td width='50%%'><input size='40'type='text' name='%s' value=\"%s\"></td></tr>" % (self.humanText, self.getName(), persistedValue) )
  17.190 -
  17.191 -    def write_Help( self, request ):
  17.192 -        request.write( "<tr><td align='right' colspan='2'><p class='small'>" )
  17.193 -        request.write( " %s</p></td></tr>" % self.help_text )         
  17.194 -        
  17.195 -class TextControl( SheetControl ):
  17.196 -
  17.197 -    def __init__( self, text ):
  17.198 -    	SheetControl.__init__( self )
  17.199 -        self.text = text
  17.200 -        
  17.201 -    def write_Control( self, request, persistedValue ):
  17.202 -    	request.write( "<tr><td colspan='2'><p>%s</p></td></tr>" % self.text )
  17.203 -
  17.204 -class SmallTextControl( SheetControl ):
  17.205 -
  17.206 -    def __init__( self, text ):
  17.207 -    	SheetControl.__init__( self )
  17.208 -        self.text = text
  17.209 -        
  17.210 -    def write_Control( self, request, persistedValue ):
  17.211 -    	request.write( "<tr><td colspan='2'><p class='small'>%s</p></tr></td>" % self.text )
  17.212 -        
  17.213 -class ListControl( SheetControl ):
  17.214 -
  17.215 -    def __init__( self, name, options, humanText ):
  17.216 -    	SheetControl.__init__( self )
  17.217 -        self.setName( name )
  17.218 -        self.options = options
  17.219 -        self.humanText = humanText
  17.220 -        
  17.221 -    def write_Control( self, request, persistedValue ):
  17.222 -        request.write( "<tr><td width='50%%'><p>%s</p></td><td width='50%%'>" % self.humanText )
  17.223 -    	request.write( "<select name='%s'>" % self.getName() )
  17.224 -        for (value, text) in self.options:
  17.225 -            if value == persistedValue:
  17.226 -            	request.write( "<option value='%s' selected>%s\n" % (value, text) )
  17.227 -            else:
  17.228 -                request.write( "<option value='%s'>%s\n" % (value, text) )
  17.229 -        request.write( "</select></td></tr>" )
  17.230 -
  17.231 -    def validate( self, persistedValue ):
  17.232 -        for (value, text) in self.options:
  17.233 -            if value == persistedValue:
  17.234 -                return True
  17.235 -                
  17.236 -        return False
  17.237 -        
  17.238 -class FileControl( InputControl ):
  17.239 -
  17.240 -    def __init__( self, name, defaultValue, humanText,  reg_exp = ".*", help_text = "You must enter the appropriate details in this feild." ):
  17.241 -	InputControl.__init__( self, name, defaultValue, humanText )
  17.242 -        
  17.243 -    def validate( self, persistedValue ):
  17.244 -        if persistedValue is None: return False
  17.245 -        try:
  17.246 -            open( persistedValue )
  17.247 -            return True
  17.248 -        except IOError, TypeError:
  17.249 -            return False
  17.250 -    
  17.251 -    def write_Help( self, request ):
  17.252 -        request.write( "<tr><td colspan='2' align='right'><p class='small'>File does not exist: you must enter a valid, absolute file path.</p></td></tr>" )
  17.253 -
  17.254 -class TickControl( SheetControl ):
  17.255 -
  17.256 -    def __init__( self, name, defaultValue, humanText ):
  17.257 -        SheetControl.__init__( self )
  17.258 -        self.setName( name )
  17.259 -        self.defaultValue = defaultValue
  17.260 -        self.humanText = humanText
  17.261 -        
  17.262 -    def write_Control( self, request, persistedValue ):
  17.263 -        request.write( "<tr><td width='50%%'><p>%s</p></td><td width='50%%'>" % self.humanText )
  17.264 -        
  17.265 -        if persistedValue == 'True':
  17.266 -    	    request.write( "<input type='checkbox' name='%s' value='True' checked>" % self.getName() )
  17.267 -        else:
  17.268 -    	    request.write( "<input type='checkbox' name='%s' value='True'>" % self.getName() )
  17.269 -            
  17.270 -        request.write( "</select></td></tr>" )
  17.271 -
  17.272 -      
    18.1 --- a/tools/python/xen/sv/__init__.py	Wed May 25 08:02:20 2005 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,1 +0,0 @@
    18.4 - 
    19.1 --- a/tools/python/xen/sv/params.py	Wed May 25 08:02:20 2005 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,3 +0,0 @@
    19.4 -SV_PORT = 8080
    19.5 -SV_ROOT = "/var/lib/xen/sv/"
    19.6 -PID_FILE = "/var/run/xen-sv.pid"
    20.1 --- a/tools/python/xen/sv/util.py	Wed May 25 08:02:20 2005 +0000
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,123 +0,0 @@
    20.4 -from xen.xend.XendClient import server
    20.5 -from xen.xend import sxp
    20.6 -from xen.xend import PrettyPrint
    20.7 -
    20.8 -import types
    20.9 -
   20.10 -def getDomInfoHash( domain ):
   20.11 -    domInfoHash = {}
   20.12 -    try:
   20.13 -        domInfoHash = sxp2hash( server.xend_domain( domain ) )
   20.14 -        domInfoHash['dom'] = domain
   20.15 -    except:
   20.16 -    	domInfoHash['name'] = "Error getting domain details"
   20.17 -    return domInfoHash
   20.18 -
   20.19 -def sxp2hash( s ):
   20.20 -    sxphash = {}
   20.21 -        
   20.22 -    for child in sxp.children( s ):
   20.23 -    	if isinstance( child, types.ListType ) and len( child ) > 1:
   20.24 -            if isinstance( child[1], types.ListType ) and len( child ) > 1:
   20.25 -                sxphash[ child[0] ] = sxp2hash( child[1] )
   20.26 -            else:
   20.27 -                sxphash[ child[0] ] = child[1]
   20.28 -        
   20.29 -    return sxphash  
   20.30 -    
   20.31 -def ssxp2hash( s ):
   20.32 -    sxphash = {}
   20.33 -    
   20.34 -    for i in s:
   20.35 -       if isinstance( i, types.ListType ) and len( i ) > 1:
   20.36 -          sxphash[ i[0] ] = i[1]
   20.37 -    
   20.38 -    return sxphash 
   20.39 -    
   20.40 -def hash2sxp( h ):
   20.41 -    hashsxp = []
   20.42 -    
   20.43 -    for (key, item) in h.items():
   20.44 -    	hashsxp.append( [key, item] )
   20.45 -        
   20.46 -    return hashsxp    
   20.47 -    
   20.48 -def string2sxp( string ):
   20.49 -    pin = sxp.Parser()
   20.50 -    pin.input( string )
   20.51 -    return pin.get_val()    
   20.52 -
   20.53 -def sxp2string( sexp ):
   20.54 -    return sxp.to_string( sexp )    
   20.55 -    
   20.56 -def sxp2prettystring( sxp ):
   20.57 -    class tmp:
   20.58 -        def __init__( self ):
   20.59 -                self.str = ""
   20.60 -        def write( self, str ):
   20.61 -                self.str = self.str + str
   20.62 -    temp = tmp()
   20.63 -    PrettyPrint.prettyprint( sxp, out=temp )
   20.64 -    return temp.str
   20.65 -
   20.66 -def getVar( var, request, default=None ):
   20.67 -   
   20.68 -    arg = request.args.get( var )
   20.69 -
   20.70 -    if arg is None:
   20.71 -        return default
   20.72 -    else:
   20.73 -        return arg[ len( arg )-1 ]
   20.74 -
   20.75 -def bigTimeFormatter( time ):
   20.76 -    time = float( time )
   20.77 -    weeks = time // 604800
   20.78 -    remainder = time % 604800
   20.79 -    days = remainder // 86400
   20.80 -    
   20.81 -    remainder = remainder % 86400
   20.82 -
   20.83 -    hms = smallTimeFormatter( remainder )
   20.84 -    
   20.85 -    return "%d weeks, %d days, %s" % ( weeks, days, hms )
   20.86 -
   20.87 -def smallTimeFormatter( time ):
   20.88 -    time = float( time )
   20.89 -    hours = time // 3600
   20.90 -    remainder = time % 3600
   20.91 -    mins = remainder // 60
   20.92 -    secs = time % 60
   20.93 -    return "%02d:%02d:%04.1f (hh:mm:ss.s)" % ( hours, mins, secs ) 
   20.94 -
   20.95 -def stateFormatter( state ):
   20.96 -    states = [ 'Running', 'Blocked', 'Paused', 'Shutdown', 'Crashed' ]
   20.97 -    
   20.98 -    stateStr = ""
   20.99 -    
  20.100 -    for i in range( len( state ) ):
  20.101 -        if state[i] != "-":
  20.102 -            stateStr += "%s, " % states[ i ] 
  20.103 -           
  20.104 -    return stateStr + " (%s)" % state
  20.105 -
  20.106 -def memoryFormatter( mem ):
  20.107 -    mem = int( mem )
  20.108 -    if mem >= 1024:
  20.109 -        mem = float( mem ) / 1024
  20.110 -        return "%3.2fGb" % mem
  20.111 -    else:    
  20.112 -        return "%7dMb" % mem
  20.113 -
  20.114 -def cpuFormatter( mhz ):
  20.115 -    mhz = int( mhz )
  20.116 -    if mhz > 1000:
  20.117 -        ghz = float( mhz ) / 1000.0
  20.118 -        return "%4.2fGHz" % ghz
  20.119 -    else:
  20.120 -        return "%4dMHz" % mhz
  20.121 -        
  20.122 -def hyperthreadFormatter( threads ):
  20.123 -    if int( threads ) > 1:
  20.124 -        return "Yes (%d)" % threads
  20.125 -    else:
  20.126 -        return "No"
    21.1 --- a/tools/sv/Main.rpy	Wed May 25 08:02:20 2005 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,3 +0,0 @@
    21.4 -from xen.sv.Main import Main
    21.5 -
    21.6 -resource = Main()
    22.1 --- a/tools/sv/Makefile	Wed May 25 08:02:20 2005 +0000
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,34 +0,0 @@
    22.4 -sv_insdir := /var/lib/xen/sv
    22.5 -INSTALL		= install
    22.6 -INSTALL_DIR	= $(INSTALL) -d -m0755
    22.7 -INSTALL_DATA	= $(INSTALL) -m0644
    22.8 -
    22.9 -all:
   22.10 -
   22.11 -IMAGES	 = xen.png orb_01.jpg orb_02.jpg
   22.12 -IMAGES	+= left-end-highlight.jpg left-end-no-highlight.jpg
   22.13 -IMAGES	+= right-end-highlight.jpg right-end-no-highlight.jpg
   22.14 -IMAGES	+= middle-highlight.jpg middle-no-highlight.jpg
   22.15 -IMAGES	+= seperator.jpg
   22.16 -IMAGES	+= seperator-left-highlight.jpg seperator-right-highlight.jpg
   22.17 -IMAGES	+= shutdown.png reboot.png pause.png unpause.png destroy.png
   22.18 -IMAGES	+= small-destroy.png small-pause.png small-unpause.png
   22.19 -IMAGES	+= next.png previous.png finish.png
   22.20 -
   22.21 -install:
   22.22 -	# copy XenSV Main.rpy file
   22.23 -	@[ -d $(DESTDIR)$(sv_insdir) ] || $(INSTALL_DIR) $(DESTDIR)$(sv_insdir)
   22.24 -	@$(INSTALL_DATA) Main.rpy $(DESTDIR)$(sv_insdir)
   22.25 -
   22.26 -	# copy XenSV images
   22.27 -	@[ -d $(DESTDIR)$(sv_insdir)/images ] || \
   22.28 -		$(INSTALL_DIR) $(DESTDIR)$(sv_insdir)/images
   22.29 -	@(cd images && $(INSTALL_DATA) $(IMAGES) $(DESTDIR)$(sv_insdir)/images)
   22.30 -
   22.31 -	# copy XenSV stylesheet
   22.32 -	@[ -d $(DESTDIR)$(sv_insdir)/inc ] || \
   22.33 -		$(INSTALL_DIR) $(DESTDIR)$(sv_insdir)/inc
   22.34 -	@$(INSTALL_DATA) inc/style.css inc/script.js $(DESTDIR)$(sv_insdir)/inc
   22.35 -
   22.36 -clean:
   22.37 -
    23.1 Binary file tools/sv/images/destroy.png has changed
    24.1 Binary file tools/sv/images/finish.png has changed
    25.1 Binary file tools/sv/images/left-end-highlight.jpg has changed
    26.1 Binary file tools/sv/images/left-end-no-highlight.jpg has changed
    27.1 Binary file tools/sv/images/middle-highlight.jpg has changed
    28.1 Binary file tools/sv/images/middle-no-highlight.jpg has changed
    29.1 Binary file tools/sv/images/next.png has changed
    30.1 Binary file tools/sv/images/orb_01.jpg has changed
    31.1 Binary file tools/sv/images/orb_02.jpg has changed
    32.1 Binary file tools/sv/images/pause.png has changed
    33.1 Binary file tools/sv/images/previous.png has changed
    34.1 Binary file tools/sv/images/reboot.png has changed
    35.1 Binary file tools/sv/images/right-end-highlight.jpg has changed
    36.1 Binary file tools/sv/images/right-end-no-highlight.jpg has changed
    37.1 Binary file tools/sv/images/seperator-left-highlight.jpg has changed
    38.1 Binary file tools/sv/images/seperator-right-highlight.jpg has changed
    39.1 Binary file tools/sv/images/seperator.jpg has changed
    40.1 Binary file tools/sv/images/shutdown.png has changed
    41.1 Binary file tools/sv/images/small-destroy.png has changed
    42.1 Binary file tools/sv/images/small-pause.png has changed
    43.1 Binary file tools/sv/images/small-unpause.png has changed
    44.1 Binary file tools/sv/images/unpause.png has changed
    45.1 Binary file tools/sv/images/xen.png has changed
    46.1 --- a/tools/sv/inc/script.js	Wed May 25 08:02:20 2005 +0000
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,22 +0,0 @@
    46.4 -function update( objRef, text )
    46.5 -{
    46.6 -    if ( document.all || document.getElementById )
    46.7 -    {
    46.8 -        obj = ( document.getElementById )? document.getElementById( objRef ) : document.all( objRef );
    46.9 -
   46.10 -        obj.innerHTML= text
   46.11 -    }
   46.12 -}
   46.13 -
   46.14 -function doOp( op )
   46.15 -{
   46.16 -    document.forms[0].op.value = op
   46.17 -    document.forms[0].submit()
   46.18 -}
   46.19 -
   46.20 -function doOp2( op, args )
   46.21 -{
   46.22 -    document.forms[0].op.value = op
   46.23 -    document.forms[0].args.value = args
   46.24 -    document.forms[0].submit()
   46.25 -}
    47.1 --- a/tools/sv/inc/style.css	Wed May 25 08:02:20 2005 +0000
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,32 +0,0 @@
    47.4 -
    47.5 -P       {font-family: verdana, arial; font-size: 12px; color: black}
    47.6 -.small  {font-size: 10px}
    47.7 -
    47.8 -TD.domainInfo     {font-family: verdana, arial; font-size: 10px; color: black}
    47.9 -TD.domainInfoHead {font-family: verdana, arial; font-size: 10px; color: white; font-face: bold}
   47.10 -
   47.11 -TD.domainInfoHead {background-color: black}
   47.12 -TR.domainInfoOdd  {background-color: white}
   47.13 -TR.domainInfoEven {background-color: lightgrey}
   47.14 -
   47.15 -body { 
   47.16 -	width: 670px;
   47.17 -	margin: 0px;
   47.18 -	padding: 0px;
   47.19 -	background-color: #fff;
   47.20 -	background-image: url(../images/orb_02.jpg);
   47.21 -	background-repeat: repeat-y;
   47.22 -	background-position: left top;
   47.23 -	font-family: Arial, Helvetica, sans-serif;
   47.24 -	font-weight: bold;
   47.25 -	color: #333333;
   47.26 -	letter-spacing: 0px;
   47.27 -	scrollbar-base-color: #333333;
   47.28 -	scrollbar-track-color: #666666;
   47.29 -	scrollbar-face-color: #fff;
   47.30 -	
   47.31 -	
   47.32 -	}
   47.33 -        
   47.34 -.button (cursor:hand)
   47.35 -