direct-io.hg

changeset 11432:780409e8f0ba

[BLKTAP] Fix in xend to properly destroy blktap devices when deviceClass=='tap'
Submitted by Andres Lagar Cavilla
author jchesterfield@dhcp92.uk.xensource.com
date Wed Sep 06 11:42:29 2006 +0100 (2006-09-06)
parents 383bc7c7b19e
children 1de184deaa9c
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Sep 05 18:36:23 2006 -0700
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Sep 06 11:42:29 2006 +0100
     1.3 @@ -1087,6 +1087,15 @@ class XendDomainInfo:
     1.4      ## public:
     1.5  
     1.6      def destroyDevice(self, deviceClass, devid):
     1.7 +	if type(devid) is str:
     1.8 +	    devicePath = '%s/device/%s' % (self.dompath, deviceClass)
     1.9 +	    for entry in xstransact.List(devicePath):
    1.10 +		backend = xstransact.Read('%s/%s' % (devicePath, entry), "backend")
    1.11 +		devName = xstransact.Read(backend, "dev")
    1.12 +		if devName == devid:
    1.13 +		    # We found the integer matching our devid, use it instead
    1.14 +		    devid = entry
    1.15 +        	    break
    1.16          return self.getDeviceController(deviceClass).destroyDevice(devid)
    1.17  
    1.18