direct-io.hg

changeset 7350:b938c4965a8f

Make the error reporting back to xm just a little bit less insane, and fix a
missing import inside blkif. Fix the command parsing for op_device_destroy and
op_device_configure -- the device IDs should be strings, to allow the user to
specify devices by name as well as number.

This is the second half to the fixes for bug #315.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Wed Oct 12 13:13:32 2005 +0100 (2005-10-12)
parents 00a324b3a2db
children 97648825856b
files tools/python/xen/web/SrvBase.py tools/python/xen/xend/server/SrvDomain.py tools/python/xen/xend/server/blkif.py tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/web/SrvBase.py	Wed Oct 12 13:00:55 2005 +0100
     1.2 +++ b/tools/python/xen/web/SrvBase.py	Wed Oct 12 13:13:32 2005 +0100
     1.3 @@ -86,7 +86,7 @@ class SrvBase(resource.Resource):
     1.4              except Exception, exn:
     1.5                  log.exception("Request %s failed.", op)
     1.6                  if req.useSxp():
     1.7 -                    return ['xend.err', "Exception: " + str(exn)]
     1.8 +                    return ['xend.err', str(exn)]
     1.9                  else:
    1.10                      return "<p>%s</p>" % str(exn)
    1.11  
     2.1 --- a/tools/python/xen/xend/server/SrvDomain.py	Wed Oct 12 13:00:55 2005 +0100
     2.2 +++ b/tools/python/xen/xend/server/SrvDomain.py	Wed Oct 12 13:13:32 2005 +0100
     2.3 @@ -146,13 +146,13 @@ class SrvDomain(SrvDir):
     2.4      def op_device_destroy(self, op, req):
     2.5          return self.call(self.dom.destroyDevice,
     2.6                           [['type', 'str'],
     2.7 -                          ['dev',  'int']],
     2.8 +                          ['dev',  'str']],
     2.9                           req)
    2.10                  
    2.11      def op_device_configure(self, op, req):
    2.12          return self.call(self.dom.device_configure,
    2.13                           [['config', 'sxpr'],
    2.14 -                          ['dev',    'int']],
    2.15 +                          ['dev',    'str']],
    2.16                           req)
    2.17  
    2.18  
     3.1 --- a/tools/python/xen/xend/server/blkif.py	Wed Oct 12 13:00:55 2005 +0100
     3.2 +++ b/tools/python/xen/xend/server/blkif.py	Wed Oct 12 13:13:32 2005 +0100
     3.3 @@ -22,6 +22,7 @@ import string
     3.4  
     3.5  from xen.util import blkif
     3.6  from xen.xend import sxp
     3.7 +from xen.xend.XendError import VmError
     3.8  
     3.9  from xen.xend.server.DevController import DevController
    3.10  
     4.1 --- a/tools/python/xen/xm/main.py	Wed Oct 12 13:00:55 2005 +0100
     4.2 +++ b/tools/python/xen/xm/main.py	Wed Oct 12 13:13:32 2005 +0100
     4.3 @@ -169,11 +169,9 @@ def handle_xend_error(cmd, dom, ex):
     4.4      if error == "Not found" and dom != None:
     4.5          err("Domain '%s' not found when running 'xm %s'" % (dom, cmd))
     4.6          sys.exit(1)
     4.7 -    elif error == "Exception: Device not connected":
     4.8 -        err("Device not connected")
     4.9 +    else:
    4.10 +        err(error)
    4.11          sys.exit(1)
    4.12 -    else:
    4.13 -        raise ex
    4.14      
    4.15  
    4.16  #########################################################################