ia64/xen-unstable

changeset 7099:b55a43d39a40

merge?
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 28 14:08:52 2005 +0100 (2005-09-28)
parents 8204a2d6cd55 ea373837d474
children 0422243f5602
files
line diff
     1.1 --- a/tools/python/xen/web/SrvBase.py	Wed Sep 28 14:07:57 2005 +0100
     1.2 +++ b/tools/python/xen/web/SrvBase.py	Wed Sep 28 14:08:52 2005 +0100
     1.3 @@ -81,7 +81,14 @@ class SrvBase(resource.Resource):
     1.4              req.write("Operation not implemented: " + op)
     1.5              return ''
     1.6          else:
     1.7 -            return op_method(op, req)
     1.8 +            try:
     1.9 +                res = op_method(op, req)
    1.10 +            except Exception, exn:
    1.11 +                log.exception("Request %s failed.", op)
    1.12 +                if req.useSxp():
    1.13 +                    return ['xend.err', "Exception: " + str(exn)]
    1.14 +                else:
    1.15 +                    return "<p>%s</p>" % str(exn)
    1.16  
    1.17      def print_path(self, req):
    1.18          """Print the path with hyperlinks.
     2.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Sep 28 14:07:57 2005 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Sep 28 14:08:52 2005 +0100
     2.3 @@ -547,6 +547,7 @@ class XendDomain:
     2.4          except XendError:
     2.5              raise
     2.6          except Exception, exn:
     2.7 +            log.exception("")
     2.8              raise XendError(str(exn))
     2.9  
    2.10  
     3.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Sep 28 14:07:57 2005 +0100
     3.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Sep 28 14:08:52 2005 +0100
     3.3 @@ -615,7 +615,7 @@ class XendDomainInfo:
     3.4          if not reason in shutdown_reasons.values():
     3.5              raise XendError('invalid reason:' + reason)
     3.6          self.storeVm("control/shutdown", reason)
     3.7 -        if not reason in ['suspend']:
     3.8 +        if not reason == 'suspend':
     3.9              self.storeVm('xend/shutdown_start_time', time.time())
    3.10  
    3.11  
     4.1 --- a/tools/python/xen/xend/server/SrvDomainDir.py	Wed Sep 28 14:07:57 2005 +0100
     4.2 +++ b/tools/python/xen/xend/server/SrvDomainDir.py	Wed Sep 28 14:08:52 2005 +0100
     4.3 @@ -152,11 +152,11 @@ class SrvDomainDir(SrvDir):
     4.4              domains = self.xd.list_sorted()
     4.5              req.write('<ul>')
     4.6              for d in domains:
     4.7 -                req.write('<li><a href="%s%s"> Domain %s</a>'
     4.8 -                          % (url, d.getName(), d.getName()))
     4.9 -                req.write('id=%s' % d.getDomain())
    4.10 -                req.write('memory=%d'% d.getMemoryTarget())
    4.11 -                req.write('ssidref=%d'% d.getSsidref())
    4.12 +                req.write(
    4.13 +                    '<li><a href="%s%s">Domain %s</a>: id = %s, memory = %d, '
    4.14 +                    'ssidref = %d.'
    4.15 +                    % (url, d.getName(), d.getName(), d.getDomid(),
    4.16 +                       d.getMemoryTarget(), d.getSsidref()))
    4.17                  req.write('</li>')
    4.18              req.write('</ul>')
    4.19  
     5.1 --- a/tools/python/xen/xend/server/SrvNode.py	Wed Sep 28 14:07:57 2005 +0100
     5.2 +++ b/tools/python/xen/xend/server/SrvNode.py	Wed Sep 28 14:08:52 2005 +0100
     5.3 @@ -62,7 +62,7 @@ class SrvNode(SrvDir):
     5.4              for d in self.info():
     5.5                  req.write('<li> %10s: %s' % (d[0], str(d[1])))
     5.6              req.write('<li><a href="%sdmesg">Xen dmesg output</a>' % url)
     5.7 -            req.write('<li><a href="%slog>Xend log</a>' % url)
     5.8 +            req.write('<li><a href="%slog">Xend log</a>' % url)
     5.9              req.write('</ul>')
    5.10              req.write('</body></html>')
    5.11              
     6.1 --- a/tools/python/xen/xend/xenstore/xstransact.py	Wed Sep 28 14:07:57 2005 +0100
     6.2 +++ b/tools/python/xen/xend/xenstore/xstransact.py	Wed Sep 28 14:08:52 2005 +0100
     6.3 @@ -42,8 +42,15 @@ class xstransact:
     6.4                                 '%s, while reading %s' % (ex.args[1], path))
     6.5  
     6.6      def read(self, *args):
     6.7 +        """If no arguments are given, return the value at this transaction's
     6.8 +        path.  If one argument is given, treat that argument as a subpath to
     6.9 +        this transaction's path, and return the value at that path.
    6.10 +        Otherwise, treat each argument as a subpath to this transaction's
    6.11 +        path, and return a list composed of the values at each of those
    6.12 +        instead.
    6.13 +        """
    6.14          if len(args) == 0:
    6.15 -            raise TypeError
    6.16 +            return xshandle().read(self.path)
    6.17          if len(args) == 1:
    6.18              return self._read(args[0])
    6.19          ret = []
    6.20 @@ -191,6 +198,13 @@ class xstransact:
    6.21  
    6.22  
    6.23      def Read(cls, path, *args):
    6.24 +        """If only one argument is given (path), return the value stored at
    6.25 +        that path.  If two arguments are given, treat the second argument as a
    6.26 +        subpath within the first, and return the value at the composed path.
    6.27 +        Otherwise, treat each argument after the first as a subpath to the
    6.28 +        given path, and return a list composed of the values at each of those
    6.29 +        instead.  This operation is performed inside a transaction.
    6.30 +        """
    6.31          while True:
    6.32              t = cls(path)
    6.33              try:
    6.34 @@ -234,6 +248,12 @@ class xstransact:
    6.35      Remove = classmethod(Remove)
    6.36  
    6.37      def List(cls, path, *args):
    6.38 +        """If no arguments are given (path), list its contents, returning the
    6.39 +        entries therein, or None if no entries are found.  Otherwise, treat
    6.40 +        each further argument as a subpath to the given path, and return the
    6.41 +        cumulative listing of each of those instead.  This operation is
    6.42 +        performed inside a transaction.
    6.43 +        """
    6.44          while True:
    6.45              t = cls(path)
    6.46              try: