mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Fix handling of devid_end when devid is an integer, but not present as a device.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
837853a460
commit
b7a3863d9a
1 file changed
+3
-2
@@ -93,10 +93,11 @@ class BlkifController(DevController):
|
||||
try:
|
||||
DevController.destroyDevice(self, int(devid))
|
||||
except ValueError:
|
||||
devid_end = devid.split('/')[-1]
|
||||
devid_end = type(devid) is str and devid.split('/')[-1] or None
|
||||
|
||||
for i in self.deviceIDs():
|
||||
d = self.readBackend(i, 'dev')
|
||||
if d == devid or d == devid_end:
|
||||
if d == devid or (devid_end and d == devid_end):
|
||||
DevController.destroyDevice(self, i)
|
||||
return
|
||||
raise VmError("Device %s not connected" % devid)
|
||||