ia64/xen-unstable

changeset 6938:e517f6599e54

Added getTargetMemory, getSsidref methods to XendDomainInfo, and use these and
getDomain, getName in SrvDomainDir, to decouple the latter from the internals of
the former, in preparation for changes internal to XendDomainInfo.

Signed-off-by: Ewan Mellor<ewan@xensource.com>
author emellor@ewan
date Sat Sep 17 16:10:04 2005 +0100 (2005-09-17)
parents 567debb22ac0
children adbf85204d29
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/server/SrvDomainDir.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Sat Sep 17 13:59:35 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Sat Sep 17 16:10:04 2005 +0100
     1.3 @@ -334,6 +334,13 @@ class XendDomainInfo:
     1.4      def getName(self):
     1.5          return self.name
     1.6  
     1.7 +    def getSsidref(self):
     1.8 +        return self.ssidref
     1.9 +
    1.10 +    def getTargetMemory(self):
    1.11 +        """Get this domain's target memory size, in MiB."""
    1.12 +        return self.memory
    1.13 +
    1.14      def setStoreRef(self, ref):
    1.15          self.store_mfn = ref
    1.16          self.storeDom("store/ring-ref", ref)
     2.1 --- a/tools/python/xen/xend/server/SrvDomainDir.py	Sat Sep 17 13:59:35 2005 +0100
     2.2 +++ b/tools/python/xen/xend/server/SrvDomainDir.py	Sat Sep 17 16:10:04 2005 +0100
     2.3 @@ -85,7 +85,7 @@ class SrvDomainDir(SrvDir):
     2.4      def _op_create_cb(self, dominfo, configstring, req):
     2.5          """Callback to handle domain creation.
     2.6          """
     2.7 -        dom = dominfo.name
     2.8 +        dom = dominfo.getName()
     2.9          domurl = "%s/%s" % (req.prePathURL(), dom)
    2.10          req.setResponseCode(http.CREATED, "created")
    2.11          req.setHeader("Location", domurl)
    2.12 @@ -112,7 +112,7 @@ class SrvDomainDir(SrvDir):
    2.13          fn = FormFn(self.xd.domain_restore,
    2.14                      [['file', 'str']])
    2.15          dominfo = fn(req.args)
    2.16 -        dom = dominfo.name
    2.17 +        dom = dominfo.getName()
    2.18          domurl = "%s/%s" % (req.prePathURL(), dom)
    2.19          req.setResponseCode(http.CREATED)
    2.20          req.setHeader("Location", domurl)
    2.21 @@ -153,10 +153,10 @@ class SrvDomainDir(SrvDir):
    2.22              req.write('<ul>')
    2.23              for d in domains:
    2.24                 req.write('<li><a href="%s%s"> Domain %s</a>'
    2.25 -                         % (url, d.name, d.name))
    2.26 -               req.write('id=%s' % d.domid)
    2.27 -               req.write('memory=%d'% d.memory)
    2.28 -               req.write('ssidref=%d'% d.ssidref)
    2.29 +                         % (url, d.getName(), d.getName()))
    2.30 +               req.write('id=%s' % d.getDomain())
    2.31 +               req.write('memory=%d'% d.getTargetMemory())
    2.32 +               req.write('ssidref=%d'% d.getSsidref())
    2.33                 req.write('</li>')
    2.34              req.write('</ul>')
    2.35