WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix handling of devid_end when devid is an integer, but

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix handling of devid_end when devid is an integer, but not present as a device.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 26 Nov 2005 02:36:06 +0000
Delivery-date: Sat, 26 Nov 2005 02:37:00 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 84cf3d018bea75812fe152ce58166aa34ebe505b
# Parent  28a117c5ea94ef73c01cd46c6f87c576f1580c83
Fix handling of devid_end when devid is an integer, but not present as a device.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 28a117c5ea94 -r 84cf3d018bea tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py     Fri Nov 25 11:19:09 2005
+++ b/tools/python/xen/xend/server/blkif.py     Fri Nov 25 17:05:45 2005
@@ -93,10 +93,11 @@
         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)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix handling of devid_end when devid is an integer, but not present as a device., Xen patchbot -unstable <=