aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenmgr/lib/server/SrvConsoleServer.py
diff options
context:
space:
mode:
authorxenbk@gandalf.hpl.hp.com <xenbk@gandalf.hpl.hp.com>2004-06-21 15:58:22 +0000
committerxenbk@gandalf.hpl.hp.com <xenbk@gandalf.hpl.hp.com>2004-06-21 15:58:22 +0000
commiteece4eed11b2ed310789369d168d112ea08adcca (patch)
tree9649ba0e505506a6e2fa5de80f07e1d10d849eea /tools/xenmgr/lib/server/SrvConsoleServer.py
parent550c7818a91b74b5a1171cb582f00a7fbdc75b9f (diff)
parent3e795cee8d160e0ea0ff47005d795d79e7d948a9 (diff)
downloadxen-eece4eed11b2ed310789369d168d112ea08adcca.tar.gz
xen-eece4eed11b2ed310789369d168d112ea08adcca.tar.bz2
xen-eece4eed11b2ed310789369d168d112ea08adcca.zip
bitkeeper revision 1.995 (40d7059ek3ICHR5Iebek8AzkIdzn7Q)
Merge http://xen.bkbits.net:8080/xeno-unstable.bk into gandalf.hpl.hp.com:/var/bk/xeno-unstable.bk
Diffstat (limited to 'tools/xenmgr/lib/server/SrvConsoleServer.py')
-rw-r--r--tools/xenmgr/lib/server/SrvConsoleServer.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/tools/xenmgr/lib/server/SrvConsoleServer.py b/tools/xenmgr/lib/server/SrvConsoleServer.py
index 88f3964811..6059ef2ebf 100644
--- a/tools/xenmgr/lib/server/SrvConsoleServer.py
+++ b/tools/xenmgr/lib/server/SrvConsoleServer.py
@@ -21,6 +21,8 @@ from twisted.internet import protocol
from twisted.internet import abstract
from twisted.internet import defer
+import Xc; xc = Xc.new()
+
import xend.utils
from xenmgr import sxp
@@ -289,6 +291,12 @@ class EventProtocol(protocol.Protocol):
else:
self.send_error()
+ def loseConnection(self):
+ if self.transport:
+ self.transport.loseConnection()
+ if self.connected:
+ reactor.callLater(0, self.connectionLost)
+
def connectionLost(self, reason=None):
self.unsubscribe()
@@ -559,6 +567,16 @@ class Daemon:
reactor.diconnectAll()
sys.exit(0)
+ def blkif_set_control_domain(self, dom):
+ """Set the block device backend control domain.
+ """
+ return self.blkifCF.setControlDomain(dom)
+
+ def blkif_get_control_domain(self, dom):
+ """Get the block device backend control domain.
+ """
+ return self.blkifCF.getControlDomain()
+
def blkif_create(self, dom):
"""Create a block device interface controller.
@@ -579,6 +597,16 @@ class Daemon:
d = ctrl.attach_device(vdev, mode, segment)
return d
+ def netif_set_control_domain(self, dom):
+ """Set the network interface backend control domain.
+ """
+ return self.netifCF.setControlDomain(dom)
+
+ def netif_get_control_domain(self, dom):
+ """Get the network interface backend control domain.
+ """
+ return self.netifCF.getControlDomain()
+
def netif_create(self, dom):
"""Create a network interface controller.
@@ -622,6 +650,28 @@ class Daemon:
if console.conn:
console.conn.loseConnection()
+ def domain_start(self, id):
+ """Start domain running.
+ """
+ dom = int(id)
+ if dom <= 0: return 0
+ return xc.domain_start(dom=dom)
+
+ def domain_stop(self, id):
+ """Stop domain running.
+ """
+ dom = int(id)
+ if dom <= 0: return 0
+ xc.domain_stop(dom=dom)
+
+ def domain_destroy(self, id, force=0):
+ """Destroy a domain. Shutdown if force=0, terminate immediately if force=1.
+ """
+ dom = int(id)
+ if dom <= 0: return 0
+ return xc.domain_destroy(dom=dom, force=force)
+
+
def instance():
global inst
try: