ia64/xen-unstable

changeset 6146:f056b0cc171e

xm block-create doesn't work. It seems like this command hasn't even
been tested (perhaps since the un-Twisting?). This particular problem
was that one function was being called with self instead of the right
argument and another function's return value was being used when it
didn't actually return anything.

This patch also improves the error handling a bit by making sure we
don't thrown an exception on a log statement with a None value. In
general, one should always use the % formatter instead of concatination
for strings in Python (even though this is not what this patch does).

Signed-off-by: Anthony Liguori
author kaf24@firebug.cl.cam.ac.uk
date Sat Aug 13 09:06:20 2005 +0000 (2005-08-13)
parents 100837b7abec
children 058e8087d36a
files tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/server/controller.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Aug 12 17:52:47 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Sat Aug 13 09:06:20 2005 +0000
     1.3 @@ -138,7 +138,7 @@ def dom_get(dom):
     1.4      if domlist and dom == domlist[0]['dom']:
     1.5          return domlist[0]
     1.6      return None
     1.7 -    
     1.8 +
     1.9  class XendDomainInfo:
    1.10      """Virtual machine object."""
    1.11  
    1.12 @@ -754,7 +754,7 @@ class XendDomainInfo:
    1.13          @param dev_config: device configuration
    1.14          """
    1.15          dev_type = sxp.name(dev_config)
    1.16 -        dev = self.createDevice(self, dev_config, change=True)
    1.17 +        dev = self.createDevice(dev_type, dev_config, change=True)
    1.18          self.config.append(['device', dev.getConfig()])
    1.19          return dev.sxpr()
    1.20  
     2.1 --- a/tools/python/xen/xend/server/controller.py	Fri Aug 12 17:52:47 2005 +0000
     2.2 +++ b/tools/python/xen/xend/server/controller.py	Sat Aug 13 09:06:20 2005 +0000
     2.3 @@ -142,7 +142,7 @@ class DevControllerTable:
     2.4      def createDevController(self, type, vm, recreate=False):
     2.5          cls = self.getDevControllerClass(type)
     2.6          if not cls:
     2.7 -            raise XendError("unknown device type: " + type)
     2.8 +            raise XendError("unknown device type: " + str(type))
     2.9          return cls.createDevController(vm, recreate=recreate)
    2.10  
    2.11  def getDevControllerTable():
    2.12 @@ -283,6 +283,8 @@ class DevController:
    2.13          dev.attach(recreate=recreate, change=change)
    2.14          dev.exportToDB()
    2.15  
    2.16 +        return dev
    2.17 +
    2.18      def configureDevice(self, id, config, change=False):
    2.19          """Reconfigure an existing device.
    2.20          May be defined in subclass."""
    2.21 @@ -325,7 +327,7 @@ class DevController:
    2.22      def getDevice(self, id, error=False):
    2.23          dev = self.devices.get(id)
    2.24          if error and not dev:
    2.25 -            raise XendError("invalid device id: " + id)
    2.26 +            raise XendError("invalid device id: " + str(id))
    2.27          return dev
    2.28  
    2.29      def getDeviceIds(self):