ia64/xen-unstable

changeset 8060:84cf3d018bea

Fix handling of devid_end when devid is an integer, but not present as a device.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Fri Nov 25 17:05:45 2005 +0000 (2005-11-25)
parents 28a117c5ea94
children 4f25a6b49445
files tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Fri Nov 25 11:19:09 2005 +0000
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Fri Nov 25 17:05:45 2005 +0000
     1.3 @@ -93,10 +93,11 @@ class BlkifController(DevController):
     1.4          try:
     1.5              DevController.destroyDevice(self, int(devid))
     1.6          except ValueError:
     1.7 -            devid_end = devid.split('/')[-1]
     1.8 +            devid_end = type(devid) is str and devid.split('/')[-1] or None
     1.9 +
    1.10              for i in self.deviceIDs():
    1.11                  d = self.readBackend(i, 'dev')
    1.12 -                if d == devid or d == devid_end:
    1.13 +                if d == devid or (devid_end and d == devid_end):
    1.14                      DevController.destroyDevice(self, i)
    1.15                      return
    1.16              raise VmError("Device %s not connected" % devid)