direct-io.hg

changeset 8018:1cf273e133c8

Support destruction of device by /dev/sda1 (for example) even when the
configuration just said sda1.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Thu Nov 24 15:55:49 2005 +0000 (2005-11-24)
parents cbf7efa871ae
children 4d1d9f7ebcfc
files tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Thu Nov 24 15:52:42 2005 +0000
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Thu Nov 24 15:55:49 2005 +0000
     1.3 @@ -93,8 +93,10 @@ 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              for i in self.deviceIDs():
     1.9 -                if self.readBackend(i, 'dev') == devid:
    1.10 +                d = self.readBackend(i, 'dev')
    1.11 +                if d == devid or d == devid_end:
    1.12                      DevController.destroyDevice(self, i)
    1.13                      return
    1.14              raise VmError("Device %s not connected" % devid)