aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/xenmgr/lib/XendClient.py29
-rw-r--r--tools/xenmgr/lib/XendDomain.py41
-rw-r--r--tools/xenmgr/lib/server/SrvConsoleServer.py44
3 files changed, 44 insertions, 70 deletions
diff --git a/tools/xenmgr/lib/XendClient.py b/tools/xenmgr/lib/XendClient.py
index 76f49f49bd..7eec62290f 100644
--- a/tools/xenmgr/lib/XendClient.py
+++ b/tools/xenmgr/lib/XendClient.py
@@ -244,29 +244,12 @@ class Xend:
return xend_get(self.domainurl(id),
{ 'op' : 'vifs' })
- def xend_domain_vif_stats(self, id, vif):
- return xend_get(self.domainurl(id),
- { 'op' : 'vif_stats',
- 'vif' : vif})
-
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_vif_scheduler_set(id, vif, bytes, usecs):
- return xend_call(self.domainurl(id),
- {'op' : 'vif_scheduler_set',
- 'vif' : vif,
- 'bytes' : bytes,
- 'usecs' : usecs })
-
- def xend_domain_vif_scheduler_get(id, vif):
- return xend_get(self.domainurl(id),
- {'op' : 'vif_scheduler_get',
- 'vif' : vif})
-
def xend_domain_vbds(self, id):
return xend_get(self.domainurl(id),
{'op' : 'vbds'})
@@ -276,18 +259,6 @@ class Xend:
{'op' : 'vbd',
'vbd' : vbd})
-## def xend_domain_vbd_add(self, id, uname, dev, mode):
-## return xend_call(self.domainurl(id),
-## {'op' : 'vbd_add',
-## 'uname' : uname,
-## 'dev' : dev,
-## 'mode' : mode})
-
-## def xend_domain_vbd_remove(self, id, dev):
-## return xend_call(self.domainurl(id),
-## {'op' : 'vbd_remove',
-## 'dev' : dev})
-
def xend_consoles(self):
return xend_get(self.consoleurl())
diff --git a/tools/xenmgr/lib/XendDomain.py b/tools/xenmgr/lib/XendDomain.py
index 794c1f2931..9ed3c6370d 100644
--- a/tools/xenmgr/lib/XendDomain.py
+++ b/tools/xenmgr/lib/XendDomain.py
@@ -251,21 +251,6 @@ class XendDomain:
self._add_domain(dominfo.id, dominfo)
return dominfo
- def domain_device_add(self, id, info):
- """Add a device to a domain.
- """
- pass
-
- def domain_device_remove(self, id, dev):
- """Delete a device from a domain.
- """
- pass
-
- def domain_device_configure(self, id, dev, info):
- """Configure a domain device.
- """
- pass
-
#============================================================================
# Backward compatibility stuff from here on.
@@ -301,23 +286,10 @@ class XendDomain:
if not dominfo: return None
return dominfo.get_device_by_index(vif)
- def domain_vif_stats(self, dom, vif):
- dom = int(dom)
- return xc.vif_stats_get(dom=dom, vif=vif)
-
def domain_vif_ip_add(self, dom, vif, ip):
dom = int(dom)
return xenctl.ip.setup_vfr_rules_for_vif(dom, vif, ip)
- def domain_vif_scheduler_set(self, dom, vif, bytes, usecs):
- dom = int(dom)
- return xc.xc_vif_scheduler_set(dom=dom, vif=vif,
- credit_bytes=bytes, credit_usecs=usecs)
-
- def domain_vif_scheduler_get(self, dom, vif):
- dom = int(dom)
- return xc.vif_scheduler_get(dom=dom, vif=vif)
-
def domain_vbd_ls(self, dom):
dominfo = self.domain_get(dom)
if not dominfo: return []
@@ -333,19 +305,6 @@ class XendDomain:
return v
return None
-## def domain_vbd_add(self, dom, uname, dev, mode):
-## dom = int(dom)
-## vbd = vm.make_disk(dom, uname, dev, mode)
-## return vbd
-
-## def domain_vbd_remove(self, dom, dev):
-## dom = int(dom)
-## vbd = xenctl.vdisk.blkdev_name_to_number(dev)
-## if vbd < 0: return vbd
-## err = xc.vbd_destroy(dom, vbd)
-## if err < 0: return err
-## return vbd
-
def domain_shadow_control(self, dom, op):
dom = int(dom)
return xc.shadow_control(dom, op)
diff --git a/tools/xenmgr/lib/server/SrvConsoleServer.py b/tools/xenmgr/lib/server/SrvConsoleServer.py
index 88f3964811..c33ddbd832 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
@@ -559,6 +561,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 +591,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 +644,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=0)
+
+
def instance():
global inst
try: