diff --git a/.rootkeys b/.rootkeys index a0d47907cd..424d963f29 100644 --- a/.rootkeys +++ b/.rootkeys @@ -318,6 +318,15 @@ 40dc4076St6AmPTmQPrtQ6LGHPxGmw tools/python/xen/lowlevel/xu/__init__.py 40dc4076pVeE1kEEWzcUaNZin65kCA tools/python/xen/lowlevel/xu/domain_controller.h 40dc4076CwBYRTUQDdbdU1L6KcLgSw tools/python/xen/lowlevel/xu/xu.c +40fcefb2qm13BbRZBydAatOavaS0fQ tools/python/xen/sv/DomInfo.py +40fcefb2-RIU8GB67mJMRzybME9bxw tools/python/xen/sv/DomList.py +40fcefb23FfQn-ZBCbcHqA0cPGqQxw tools/python/xen/sv/GenTabbed.py +40fcefb2QZAn3u3sX-M7NXBjOv5HGg tools/python/xen/sv/HTMLBase.py +40fcefb2vnfDbl4w_yCTedROPuqs0g tools/python/xen/sv/Main.py +40fcefb24h-04WaHag-Tg4nxWPhTig tools/python/xen/sv/NodeInfo.py +40fcefb2Sif__6AqrANeBQZZfvP-6w tools/python/xen/sv/TabView.py +40fcefb2DqteqCCZYDCvvh4Q5jBd0w tools/python/xen/sv/__init__.py +40fcefb4rnaZNjqsBu7A5V2rlLyqRw tools/python/xen/sv/util.py 40d8915cyoVA0hJxiBFNymL7YvDaRg tools/python/xen/util/Brctl.py 40dfd40aGqGkiopOOgJxSF4iCbHM0Q tools/python/xen/util/__init__.py 4055ee4dwy4l0MghZosxoiu6zmhc9Q tools/python/xen/util/console_client.py @@ -365,33 +374,6 @@ 40c9c469yrm31i60pGKslTi2Zgpotg tools/python/xen/xend/server/messages.py 40c9c46925x-Rjb0Cv2f1-l2jZrPYg tools/python/xen/xend/server/netif.py 40c9c469ZqILEQ8x6yWy0_51jopiCg tools/python/xen/xend/server/params.py -40fcefb2qm13BbRZBydAatOavaS0fQ tools/python/xen/xend/sv/DomInfo.py -40fcefb2-RIU8GB67mJMRzybME9bxw tools/python/xen/xend/sv/DomList.py -40fcefb23FfQn-ZBCbcHqA0cPGqQxw tools/python/xen/xend/sv/GenTabbed.py -40fcefb2QZAn3u3sX-M7NXBjOv5HGg tools/python/xen/xend/sv/HTMLBase.py -40fcefb2vnfDbl4w_yCTedROPuqs0g tools/python/xen/xend/sv/Main.py -40fcefb2K1xqVVT4D-p7nL2GzS4scg tools/python/xen/xend/sv/Main.rpy -40fcefb24h-04WaHag-Tg4nxWPhTig tools/python/xen/xend/sv/NodeInfo.py -40fcefb2Sif__6AqrANeBQZZfvP-6w tools/python/xen/xend/sv/TabView.py -40fcefb23s0sQlDfl4sPP0Un8oZGhg tools/python/xen/xend/sv/XendClientDeferred.py -40fcefb2DqteqCCZYDCvvh4Q5jBd0w tools/python/xen/xend/sv/__init__.py -40fcefb2Nhe-sT74KBB_3mYQg9Dl4Q tools/python/xen/xend/sv/images/internet copy.jpg -40fcefb2QmVa4xdjdnSTXEdF2fZCDA tools/python/xen/xend/sv/images/internet.jpg -40fcefb2g8Ez5jJIPHGN_KX7GtxV4w tools/python/xen/xend/sv/images/internet.psd -40fcefb3wXQMsl9WkgQAVtdrupm4sw tools/python/xen/xend/sv/images/left-end-highlight.jpg -40fcefb3K6ESt5sQhD9aCQRscQIlXQ tools/python/xen/xend/sv/images/left-end-no-highlight.jpg -40fcefb3BUT98zPzW8kAFKuxGdh4XA tools/python/xen/xend/sv/images/middle-highlight.jpg -40fcefb38OTgsUKHBpwshLLIsiIaCA tools/python/xen/xend/sv/images/middle-no-highlight.jpg -40fcefb32SPtrw36c4S6YGFlLvkKuw tools/python/xen/xend/sv/images/orb_01.jpg -40fcefb3Ok5qkX3iM7ZEPVkRInrUpg tools/python/xen/xend/sv/images/orb_02.jpg -40fcefb3JnT5XeKTuVF4yUMGOtuNZg tools/python/xen/xend/sv/images/right-end-highlight.jpg -40fcefb3-DuYOS7noo2W7b_0p7TOUg tools/python/xen/xend/sv/images/right-end-no-highlight.jpg -40fcefb3qNbAZR5FYGPAZ9sFPVMTDA tools/python/xen/xend/sv/images/seperator-left-highlight.jpg -40fcefb3dgsa24WLk_BJeYQHrDLuOg tools/python/xen/xend/sv/images/seperator-right-highlight.jpg -40fcefb3FtiX4Pd2kT8wDlp8u8xRhQ tools/python/xen/xend/sv/images/seperator.jpg -40fcefb3yMSrZvApO9ToIi-iQwnchA tools/python/xen/xend/sv/images/xen.png -40fcefb3zGC9XNBkSwTEobCoq8YClA tools/python/xen/xend/sv/inc/style.css -40fcefb4rnaZNjqsBu7A5V2rlLyqRw tools/python/xen/xend/sv/util.py 40c9c469LNxLVizOUpOjEaTKKCm8Aw tools/python/xen/xend/sxp.py 40d05079aFRp6NQdo5wIh5Ly31c0cg tools/python/xen/xm/__init__.py 40cf2937gKQcATgXKGtNeWb1PDH5nA tools/python/xen/xm/create.py @@ -400,6 +382,21 @@ 40cf2937isyS250zyd0Q2GuEDoNXfQ tools/python/xen/xm/main.py 40cf2937PSslwBliN1g7ofDy2H_RhA tools/python/xen/xm/opts.py 40cf2937Z8WCNOnO2FcWdubvEAF9QQ tools/python/xen/xm/shutdown.py +40fcefb2K1xqVVT4D-p7nL2GzS4scg tools/sv/Main.rpy +40ffbcb66Dj5F-1kCK9BcgSqCWkt1w tools/sv/Makefile +40fcefb3wXQMsl9WkgQAVtdrupm4sw tools/sv/images/left-end-highlight.jpg +40fcefb3K6ESt5sQhD9aCQRscQIlXQ tools/sv/images/left-end-no-highlight.jpg +40fcefb3BUT98zPzW8kAFKuxGdh4XA tools/sv/images/middle-highlight.jpg +40fcefb38OTgsUKHBpwshLLIsiIaCA tools/sv/images/middle-no-highlight.jpg +40fcefb32SPtrw36c4S6YGFlLvkKuw tools/sv/images/orb_01.jpg +40fcefb3Ok5qkX3iM7ZEPVkRInrUpg tools/sv/images/orb_02.jpg +40fcefb3JnT5XeKTuVF4yUMGOtuNZg tools/sv/images/right-end-highlight.jpg +40fcefb3-DuYOS7noo2W7b_0p7TOUg tools/sv/images/right-end-no-highlight.jpg +40fcefb3qNbAZR5FYGPAZ9sFPVMTDA tools/sv/images/seperator-left-highlight.jpg +40fcefb3dgsa24WLk_BJeYQHrDLuOg tools/sv/images/seperator-right-highlight.jpg +40fcefb3FtiX4Pd2kT8wDlp8u8xRhQ tools/sv/images/seperator.jpg +40fcefb3yMSrZvApO9ToIi-iQwnchA tools/sv/images/xen.png +40fcefb3zGC9XNBkSwTEobCoq8YClA tools/sv/inc/style.css 403a3edbrr8RE34gkbR40zep98SXbg tools/xentrace/Makefile 40a107afN60pFdURgBv9KwEzgRl5mQ tools/xentrace/formats 4050c413PhhLNAYk3TEwP37i_iLw9Q tools/xentrace/xentrace.8 diff --git a/tools/Makefile b/tools/Makefile index 58934639bb..e8cdd96672 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -16,6 +16,7 @@ install: all $(MAKE) -C xentrace install $(MAKE) -C python install $(MAKE) -C xfrd install + $(MAKE) -C sv install dist: $(TARGET) $(MAKE) prefix=`pwd`/../../install dist=yes install diff --git a/tools/python/setup.py b/tools/python/setup.py index d36f9177b9..4d847591d8 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -41,7 +41,7 @@ setup(name = 'xen', 'xen.util', 'xen.xend', 'xen.xend.server', - 'xen.xend.sv', + 'xen.sv', 'xen.xm', ], ext_package = "xen.lowlevel", diff --git a/tools/python/xen/xend/sv/DomInfo.py b/tools/python/xen/sv/DomInfo.py similarity index 96% rename from tools/python/xen/xend/sv/DomInfo.py rename to tools/python/xen/sv/DomInfo.py index 3c5642a770..a26736011c 100755 --- a/tools/python/xen/xend/sv/DomInfo.py +++ b/tools/python/xen/sv/DomInfo.py @@ -2,8 +2,8 @@ from HTMLBase import HTMLBase from XendClientDeferred import server from xen.xend import PrettyPrint -from xen.xend.sv.util import * -from xen.xend.sv.GenTabbed import * +from xen.sv.util import * +from xen.sv.GenTabbed import * class DomInfo( GenTabbed ): @@ -96,4 +96,4 @@ class DomSXPTab( PreTab ): deferred.addCallback( self.fn2, callback ) def errback( x ): print ">err ", x - deferred.addErrback( errback ) \ No newline at end of file + deferred.addErrback( errback ) diff --git a/tools/python/xen/xend/sv/DomList.py b/tools/python/xen/sv/DomList.py similarity index 96% rename from tools/python/xen/xend/sv/DomList.py rename to tools/python/xen/sv/DomList.py index 8fa74dff93..37229b6941 100755 --- a/tools/python/xen/xend/sv/DomList.py +++ b/tools/python/xen/sv/DomList.py @@ -1,11 +1,11 @@ from twisted.web import resource from twisted.web.server import NOT_DONE_YET -from XendClientDeferred import server as XendServer +from xen.xend.XendClient import server as XendServer from xen.xend import sxp -from xen.xend.sv.HTMLBase import HTMLBase -from xen.xend.sv.util import * +from xen.sv.HTMLBase import HTMLBase +from xen.sv.util import * from twisted.internet import reactor diff --git a/tools/python/xen/xend/sv/GenTabbed.py b/tools/python/xen/sv/GenTabbed.py similarity index 97% rename from tools/python/xen/xend/sv/GenTabbed.py rename to tools/python/xen/sv/GenTabbed.py index 4f34a0692c..2c0dd1283f 100755 --- a/tools/python/xen/xend/sv/GenTabbed.py +++ b/tools/python/xen/sv/GenTabbed.py @@ -1,7 +1,7 @@ import types -from HTMLBase import HTMLBase -from TabView import TabView +from xen.sv.HTMLBase import HTMLBase +from xen.sv.TabView import TabView class GenTabbed( HTMLBase ): @@ -100,4 +100,4 @@ class NullTab( HTMLBase ): request.write( "

%s

" % self.title ) callback( request ) - \ No newline at end of file + diff --git a/tools/python/xen/xend/sv/HTMLBase.py b/tools/python/xen/sv/HTMLBase.py similarity index 100% rename from tools/python/xen/xend/sv/HTMLBase.py rename to tools/python/xen/sv/HTMLBase.py diff --git a/tools/python/xen/xend/sv/Main.py b/tools/python/xen/sv/Main.py similarity index 98% rename from tools/python/xen/xend/sv/Main.py rename to tools/python/xen/sv/Main.py index 366e8a8124..1bbc3f0bfd 100755 --- a/tools/python/xen/xend/sv/Main.py +++ b/tools/python/xen/sv/Main.py @@ -6,7 +6,7 @@ from xen.xend import sxp from HTMLBase import HTMLBase -from xen.xend.sv import DomList, NodeInfo, DomInfo +from xen.sv import DomList, NodeInfo, DomInfo class Main( HTMLBase ): @@ -78,4 +78,4 @@ class Main( HTMLBase ): request.write( "\n" ) self.callback( request ) - \ No newline at end of file + diff --git a/tools/python/xen/xend/sv/NodeInfo.py b/tools/python/xen/sv/NodeInfo.py similarity index 92% rename from tools/python/xen/xend/sv/NodeInfo.py rename to tools/python/xen/sv/NodeInfo.py index 7d69f4eb50..c0a569db58 100755 --- a/tools/python/xen/xend/sv/NodeInfo.py +++ b/tools/python/xen/sv/NodeInfo.py @@ -1,9 +1,9 @@ from xen.xend import XendDmesg from xen.xend import XendNode -from xen.xend.sv.util import * -from xen.xend.sv.GenTabbed import * -from xen.xend.sv.HTMLBase import HTMLBase +from xen.sv.util import * +from xen.sv.GenTabbed import * +from xen.sv.HTMLBase import HTMLBase class NodeInfo( GenTabbed ): @@ -44,4 +44,4 @@ class NodeDmesgTab( PreTab ): def __init__( self ): self.xd = XendDmesg.instance() PreTab.__init__( self, self.xd.info()[0] ) - \ No newline at end of file + diff --git a/tools/python/xen/xend/sv/TabView.py b/tools/python/xen/sv/TabView.py similarity index 97% rename from tools/python/xen/xend/sv/TabView.py rename to tools/python/xen/sv/TabView.py index 70c485c329..cada51c4e8 100755 --- a/tools/python/xen/xend/sv/TabView.py +++ b/tools/python/xen/sv/TabView.py @@ -1,4 +1,4 @@ -from xen.xend.sv.HTMLBase import HTMLBase +from xen.sv.HTMLBase import HTMLBase class TabView( HTMLBase ): diff --git a/tools/python/xen/xend/sv/__init__.py b/tools/python/xen/sv/__init__.py similarity index 100% rename from tools/python/xen/xend/sv/__init__.py rename to tools/python/xen/sv/__init__.py diff --git a/tools/python/xen/xend/sv/util.py b/tools/python/xen/sv/util.py similarity index 96% rename from tools/python/xen/xend/sv/util.py rename to tools/python/xen/sv/util.py index 06b7017b0b..1d461c721b 100755 --- a/tools/python/xen/xend/sv/util.py +++ b/tools/python/xen/sv/util.py @@ -1,4 +1,4 @@ -from xen.xend.sv.XendClientDeferred import server +from xen.xend.XendClient import server from xen.xend import sxp def getDomInfoHash( domain ): @@ -61,4 +61,4 @@ def hyperthreadFormatter( threads ): if int( threads ) > 1: return "Yes (%d)" % threads else: - return "No" \ No newline at end of file + return "No" diff --git a/tools/python/xen/xend/server/SrvServer.py b/tools/python/xen/xend/server/SrvServer.py index 1ce3446058..d1aed29c6b 100644 --- a/tools/python/xen/xend/server/SrvServer.py +++ b/tools/python/xen/xend/server/SrvServer.py @@ -44,12 +44,8 @@ def create(port=None, interface=None, bridge=0): if bridge or xroot.rebooted: Vifctl.network('start') root = resource.Resource() - sv = static.File( "/usr/lib/python2.2/site-packages/xen/xend/sv/" ) - sv.indexNames=['Main.rpy'] - sv.processors={'.rpy':script.ResourceScript} xend = SrvRoot() root.putChild('xend', xend) - root.putChild('sv', sv) site = server.Site(root) reactor.listenTCP(port, site, interface=interface) diff --git a/tools/python/xen/xend/sv/Main.rpy b/tools/python/xen/xend/sv/Main.rpy deleted file mode 100755 index 90698027a6..0000000000 --- a/tools/python/xen/xend/sv/Main.rpy +++ /dev/null @@ -1,3 +0,0 @@ -from xen.xend.sv.Main import * - -resource = Main() \ No newline at end of file diff --git a/tools/python/xen/xend/sv/XendClientDeferred.py b/tools/python/xen/xend/sv/XendClientDeferred.py deleted file mode 100755 index 9f8a16d129..0000000000 --- a/tools/python/xen/xend/sv/XendClientDeferred.py +++ /dev/null @@ -1,363 +0,0 @@ -# Copyright (C) 2004 Tom Wilkie -# Copyright (C) 2004 Mike Wray -"""Client API for the HTTP interface on xend. -Callable as a script - see main(). - -This API is the 'control-plane' for xend. -The 'data-plane' is done separately. For example, consoles -are accessed via sockets on xend, but the list of consoles -is accessible via this API. - -This one is similar to mikes, but works in an async fashion -""" -import sys -import httplib -import types -from StringIO import StringIO -import urlparse - -from xen.xend.encode import * -from xen.xend.sxp import * -from xen.xend.PrettyPrint import prettyprint - -from twisted.protocols.http import HTTPClient -from twisted.internet.protocol import ClientCreator -from twisted.internet.defer import Deferred -from twisted.internet import reactor - -DEBUG = 0 - -class XendRequest( HTTPClient ): - def __init__(self, deferred, urls): - self.urls = urls - self.deferred = deferred - - def connectionMade(self): - self.sendCommand('GET', self.urls[2]) - self.sendHeader('Host', '%s:%d' % (self.urls[0], self.urls[1]) ) - self.endHeaders() - - def handleResponse(self, data): - self.deferred.callback( data ) - -def process_SXP( sexp ): - pin = Parser() - pin.input(sexp) - pin.input_eof() - return pin.get_val() - -def xend_request(url, method, data=None): - """Make a request to xend. - - url xend request url - method http method: POST or GET - data request argument data (dict) - """ - urlinfo = urlparse.urlparse(url) - (uproto, ulocation, upath, uparam, uquery, ufrag) = urlinfo - (hdr, args) = encode_data(data) - if data and method == 'GET': - upath += '?' + args - args = None - if method == "POST" and upath.endswith('/'): - upath = upath[:-1] - - deferred = Deferred() - - clientCreator = ClientCreator( reactor, XendRequest, deferred, (ulocation, 8000, upath) ) - clientCreator.connectTCP( ulocation, 8000 ) - - deferred.addCallback( process_SXP ) - - return deferred - -class XendError(RuntimeError): - pass - -class Foo(httplib.HTTPResponse): - - def begin(self): - fin = self.fp - while(1): - buf = fin.readline() - print "***", buf - if buf == '': - print - sys.exit() - - -def sxprio(sxpr): - """Convert an sxpr to a string. - """ - io = StringIO() - sxp.show(sxpr, out=io) - print >> io - io.seek(0) - return io - -def fileof(val): - """Converter for passing configs. - Handles lists, files directly. - Assumes a string is a file name and passes its contents. - """ - if isinstance(val, types.ListType): - return sxprio(val) - if isinstance(val, types.StringType): - return file(val) - if hasattr(val, 'readlines'): - return val - -# todo: need to sort of what urls/paths are using for objects. -# e.g. for domains at the moment return '0'. -# should probably return abs path w.r.t. server, e.g. /xend/domain/0. -# As an arg, assume abs path is obj uri, otherwise just id. - -# Function to convert to full url: Xend.uri(path), e.g. -# maps /xend/domain/0 to http://wray-m-3.hpl.hp.com:8000/xend/domain/0 -# And should accept urls for ids? - -def urljoin(location, root, prefix='', rest=''): - prefix = str(prefix) - rest = str(rest) - base = 'http://' + location + root + prefix - url = urlparse.urljoin(base, rest) - return url - -def nodeurl(location, root, id=''): - return urljoin(location, root, 'node/', id) - -def domainurl(location, root, id=''): - return urljoin(location, root, 'domain/', id) - -def consoleurl(location, root, id=''): - return urljoin(location, root, 'console/', id) - -def deviceurl(location, root, id=''): - return urljoin(location, root, 'device/', id) - -def vneturl(location, root, id=''): - return urljoin(location, root, 'vnet/', id) - -def eventurl(location, root, id=''): - return urljoin(location, root, 'event/', id) - -def xend_get(url, args=None): - """Make a xend request using GET. - Requests using GET are 'safe' and may be repeated without - nasty side-effects. - """ - return xend_request(url, "GET", args) - -def xend_call(url, data): - """Make xend request using POST. - Requests using POST potentially cause side-effects and should - not be repeated unless it really is wanted to do the side - effect again. - """ - return xend_request(url, "POST", data) - -class Xend: - - """Default location of the xend server.""" - SRV_DEFAULT = "localhost" - - """Default path to the xend root on the server.""" - ROOT_DEFAULT = "/xend/" - - def __init__(self, srv=None, root=None): - self.bind(srv, root) - - def bind(self, srv=None, root=None): - """Bind to a given server. - - srv server location (host:port) - root server xend root path - """ - if srv is None: srv = self.SRV_DEFAULT - if root is None: root = self.ROOT_DEFAULT - if not root.endswith('/'): root += '/' - self.location = srv - self.root = root - - def nodeurl(self, id=''): - return nodeurl(self.location, self.root, id) - - def domainurl(self, id=''): - return domainurl(self.location, self.root, id) - - def consoleurl(self, id=''): - return consoleurl(self.location, self.root, id) - - def deviceurl(self, id=''): - return deviceurl(self.location, self.root, id) - - def vneturl(self, id=''): - return vneturl(self.location, self.root, id) - - def eventurl(self, id=''): - return eventurl(self.location, self.root, id) - - def xend(self): - return xend_get(urljoin(self.location, self.root)) - - def xend_node(self): - return xend_get(self.nodeurl()) - - def xend_node_cpu_rrobin_slice_set(self, slice): - return xend_call(self.nodeurl(), - {'op' : 'cpu_rrobin_slice_set', - 'slice' : slice }) - - def xend_node_cpu_bvt_slice_set(self, ctx_allow): - return xend_call(self.nodeurl(), - {'op' : 'cpu_bvt_slice_set', - 'ctx_allow' : ctx_allow }) - - def xend_node_cpu_fbvt_slice_set(self, ctx_allow): - return xend_call(self.nodeurl(), - {'op' : 'cpu_fbvt_slice_set', - 'ctx_allow' : ctx_allow }) - - def xend_domains(self): - return xend_get(self.domainurl()) - - def xend_domain_create(self, conf): - return xend_call(self.domainurl(), - {'op' : 'create', - 'config' : fileof(conf) }) - - def xend_domain(self, id): - return xend_get(self.domainurl(id)) - - def xend_domain_unpause(self, id): - return xend_call(self.domainurl(id), - {'op' : 'unpause'}) - - def xend_domain_pause(self, id): - return xend_call(self.domainurl(id), - {'op' : 'pause'}) - - def xend_domain_shutdown(self, id, reason): - return xend_call(self.domainurl(id), - {'op' : 'shutdown', - 'reason' : reason }) - - def xend_domain_destroy(self, id): - return xend_call(self.domainurl(id), - {'op' : 'destroy'}) - - def xend_domain_save(self, id, filename): - return xend_call(self.domainurl(id), - {'op' : 'save', - 'file' : filename}) - - def xend_domain_restore(self, id, filename): - return xend_call(self.domainurl(id), - {'op' : 'restore', - 'file' : filename }) - - def xend_domain_migrate(self, id, dst): - return xend_call(self.domainurl(id), - {'op' : 'migrate', - 'destination': dst}) - - def xend_domain_pincpu(self, id, cpu): - return xend_call(self.domainurl(id), - {'op' : 'pincpu', - 'cpu' : cpu}) - - def xend_domain_cpu_bvt_set(self, id, mcuadv, warp, warpl, warpu): - return xend_call(self.domainurl(id), - {'op' : 'cpu_bvt_set', - 'mcuadv' : mcuadv, - 'warp' : warp, - 'warpl' : warpl, - 'warpu' : warpu }) - - def xend_domain_cpu_fbvt_set(self, id, mcuadv, warp, warpl, warpu): - return xend_call(self.domainurl(id), - {'op' : 'cpu_fbvt_set', - 'mcuadv' : mcuadv, - 'warp' : warp, - 'warpl' : warpl, - 'warpu' : warpu }) - - - def xend_domain_cpu_atropos_set(self, id, period, slice, latency, xtratime): - return xend_call(self.domainurl(id), - {'op' : 'cpu_atropos_set', - 'period' : period, - 'slice' : slice, - 'latency' : latency, - 'xtratime': xtratime }) - - def xend_domain_vifs(self, id): - return xend_get(self.domainurl(id), - { 'op' : 'vifs' }) - - def xend_domain_vif_ip_add(self, id, vif, ipaddr): - return xend_call(self.domainurl(id), - {'op' : 'vif_ip_add', - 'vif' : vif, - 'ip' : ipaddr }) - - def xend_domain_vbds(self, id): - return xend_get(self.domainurl(id), - {'op' : 'vbds'}) - - def xend_domain_vbd(self, id, vbd): - return xend_get(self.domainurl(id), - {'op' : 'vbd', - 'vbd' : vbd}) - - def xend_consoles(self): - return xend_get(self.consoleurl()) - - def xend_console(self, id): - return xend_get(self.consoleurl(id)) - - def xend_vnets(self): - return xend_get(self.vneturl()) - - def xend_vnet_create(self, conf): - return xend_call(self.vneturl(), - {'op': 'create', 'config': fileof(conf) }) - - def xend_vnet(self, id): - return xend_get(self.vneturl(id)) - - def xend_vnet_delete(self, id): - return xend_call(self.vneturl(id), - {'op': 'delete'}) - - def xend_event_inject(self, sxpr): - val = xend_call(self.eventurl(), - {'op': 'inject', 'event': fileof(sxpr) }) - -def main(argv): - """Call an API function: - - python XendClient.py fn args... - - The leading 'xend_' on the function can be omitted. - Example: - - > python XendClient.py domains - (domain 0 8) - > python XendClient.py domain 0 - (domain (id 0) (name Domain-0) (memory 128)) - """ - server = Xend() - fn = argv[1] - if not fn.startswith('xend'): - fn = 'xend_' + fn - args = argv[2:] - deferred = getattr(server, fn)(*args) - deferred.addCallback( prettyprint ) - reactor.run() - print - -if __name__ == "__main__": - main(sys.argv) -else: - server = Xend() diff --git a/tools/python/xen/xend/sv/images/internet copy.jpg b/tools/python/xen/xend/sv/images/internet copy.jpg deleted file mode 100755 index 92eafeb9fe..0000000000 Binary files a/tools/python/xen/xend/sv/images/internet copy.jpg and /dev/null differ diff --git a/tools/python/xen/xend/sv/images/internet.jpg b/tools/python/xen/xend/sv/images/internet.jpg deleted file mode 100755 index 74a03c3a78..0000000000 Binary files a/tools/python/xen/xend/sv/images/internet.jpg and /dev/null differ diff --git a/tools/python/xen/xend/sv/images/internet.psd b/tools/python/xen/xend/sv/images/internet.psd deleted file mode 100644 index a2e9d1754f..0000000000 Binary files a/tools/python/xen/xend/sv/images/internet.psd and /dev/null differ diff --git a/tools/sv/Main.rpy b/tools/sv/Main.rpy new file mode 100755 index 0000000000..6b75ea9431 --- /dev/null +++ b/tools/sv/Main.rpy @@ -0,0 +1,3 @@ +from xen.sv.Main import Main + +resource = Main() diff --git a/tools/sv/Makefile b/tools/sv/Makefile new file mode 100755 index 0000000000..cc411b7a11 --- /dev/null +++ b/tools/sv/Makefile @@ -0,0 +1,40 @@ +sv_insdir := $(prefix)/var/xen/sv + +all: + +install: + + + # make parent directory + mkdir -p $(sv_insdir) + + # copy Main.rpy file - references xen.sv.Main class + cp Main.rpy $(sv_insdir)/ + + # make images folder + mkdir -p $(sv_insdir)/images + + # copy images + cp images/xen.png $(sv_insdir)/images/ + cp images/orb_01.jpg $(sv_insdir)/images/ + cp images/orb_02.jpg $(sv_insdir)/images/ + + cp images/left-end-highlight.jpg $(sv_insdir)/images/ + cp images/left-end-no-highlight.jpg $(sv_insdir)/images/ + cp images/right-end-highlight.jpg $(sv_insdir)/images/ + cp images/right-end-no-highlight.jpg $(sv_insdir)/images/ + + cp images/middle-highlight.jpg $(sv_insdir)/images/ + cp images/middle-no-highlight.jpg $(sv_insdir)/images/ + + cp images/seperator.jpg $(sv_insdir)/images/ + cp images/seperator-left-highlight.jpg $(sv_insdir)/images/ + cp images/seperator-right-highlight.jpg $(sv_insdir)/images/ + + # make include folder + mkdir -p $(sv_insdir)/inc + + #copy stylesheet + cp inc/style.css $(sv_insdir)/inc/ + +clean: diff --git a/tools/python/xen/xend/sv/images/left-end-highlight.jpg b/tools/sv/images/left-end-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/left-end-highlight.jpg rename to tools/sv/images/left-end-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/left-end-no-highlight.jpg b/tools/sv/images/left-end-no-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/left-end-no-highlight.jpg rename to tools/sv/images/left-end-no-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/middle-highlight.jpg b/tools/sv/images/middle-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/middle-highlight.jpg rename to tools/sv/images/middle-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/middle-no-highlight.jpg b/tools/sv/images/middle-no-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/middle-no-highlight.jpg rename to tools/sv/images/middle-no-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/orb_01.jpg b/tools/sv/images/orb_01.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/orb_01.jpg rename to tools/sv/images/orb_01.jpg diff --git a/tools/python/xen/xend/sv/images/orb_02.jpg b/tools/sv/images/orb_02.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/orb_02.jpg rename to tools/sv/images/orb_02.jpg diff --git a/tools/python/xen/xend/sv/images/right-end-highlight.jpg b/tools/sv/images/right-end-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/right-end-highlight.jpg rename to tools/sv/images/right-end-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/right-end-no-highlight.jpg b/tools/sv/images/right-end-no-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/right-end-no-highlight.jpg rename to tools/sv/images/right-end-no-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/seperator-left-highlight.jpg b/tools/sv/images/seperator-left-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/seperator-left-highlight.jpg rename to tools/sv/images/seperator-left-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/seperator-right-highlight.jpg b/tools/sv/images/seperator-right-highlight.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/seperator-right-highlight.jpg rename to tools/sv/images/seperator-right-highlight.jpg diff --git a/tools/python/xen/xend/sv/images/seperator.jpg b/tools/sv/images/seperator.jpg similarity index 100% rename from tools/python/xen/xend/sv/images/seperator.jpg rename to tools/sv/images/seperator.jpg diff --git a/tools/python/xen/xend/sv/images/xen.png b/tools/sv/images/xen.png similarity index 100% rename from tools/python/xen/xend/sv/images/xen.png rename to tools/sv/images/xen.png diff --git a/tools/python/xen/xend/sv/inc/style.css b/tools/sv/inc/style.css similarity index 100% rename from tools/python/xen/xend/sv/inc/style.css rename to tools/sv/inc/style.css