mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
[BLKTAP] Fix in xend to properly destroy blktap devices when deviceClass=='tap'
Submitted by Andres Lagar Cavilla
This commit is contained in:
1 parent
7c0fc730a3
commit
c2a28ee6ac
1 file changed
+9
@@ -1087,6 +1087,15 @@ class XendDomainInfo:
|
||||
## public:
|
||||
|
||||
def destroyDevice(self, deviceClass, devid):
|
||||
if type(devid) is str:
|
||||
devicePath = '%s/device/%s' % (self.dompath, deviceClass)
|
||||
for entry in xstransact.List(devicePath):
|
||||
backend = xstransact.Read('%s/%s' % (devicePath, entry), "backend")
|
||||
devName = xstransact.Read(backend, "dev")
|
||||
if devName == devid:
|
||||
# We found the integer matching our devid, use it instead
|
||||
devid = entry
|
||||
break
|
||||
return self.getDeviceController(deviceClass).destroyDevice(devid)
|
||||
|
||||
|
||||
|
||||