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] [xen-unstable] xend: Fix xm block-detach regression intr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Fix xm block-detach regression introduced by c/s 15157.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Jun 2007 12:50:07 -0700
Delivery-date: Thu, 14 Jun 2007 15:23:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1181553294 -3600
# Node ID a43a03d53781e159da41f79d8cc615905b95ab80
# Parent  93f77a5a8437df0b34919a6987f48e84342b4a43
xend: Fix xm block-detach regression introduced by c/s 15157.

Prior to this c/s, user was able to specify device name or id, e.g.
 xm block-detach dom xvdb
 xm block-detach dom 15728

Now, 'xm block-detach dom xvdb' silently fails.  xend.log does contain
the following

[2007-06-07 11:39:18 xend.XendDomainInfo 3775] DEBUG
(XendDomainInfo:519) devName=vbd/51712
[2007-06-07 11:39:18 xend.XendDomainInfo 3775] DEBUG
(XendDomainInfo:527) Could not find the device xvdb

This patch restores the previous behavior but retains the bugfix
introduced by c/s 15571.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   33 +++++++++-----------------------
 1 files changed, 10 insertions(+), 23 deletions(-)

diff -r 93f77a5a8437 -r a43a03d53781 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Sun Jun 10 19:58:22 2007 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Jun 11 10:14:54 2007 +0100
@@ -546,31 +546,18 @@ class XendDomainInfo:
             self.getDeviceController(devclass).waitForDevices()
 
     def destroyDevice(self, deviceClass, devid, force = False):
-        found = True                    # Assume devid is an integer.
         try:
-            devid = int(devid)
+            dev = int(devid)
         except ValueError:
-            # devid is not a number, let's search for it in xenstore.
-            devicePath = '%s/device/%s' % (self.dompath, deviceClass)
-            found = False
-            for entry in xstransact.List(devicePath):
-                log.debug("Attempting to find devid at %s/%s", devicePath, 
entry)
-                backend = xstransact.Read('%s/%s' % (devicePath, entry),
-                                          "backend")
-                if backend != None:
-                    devName = '%s/%s' % (deviceClass, entry)
-                    log.debug("devName=%s", devName)
-                    if devName == devid:
-                        # We found the integer matching our devid, use it 
instead
-                        devid = int(entry)
-                        found = True
-                        break
-
-        if not found:
-            log.debug("Could not find the device %s", devid)
-            return None
-        log.debug("devid = %s", devid)
-        return self.getDeviceController(deviceClass).destroyDevice(devid, 
force)
+            # devid is not a number but a string containing either device
+            # name (e.g. xvda) or device_type/device_id (e.g. vbd/51728)
+            dev = type(devid) is str and devid.split('/')[-1] or None
+            if dev == None:
+                log.debug("Could not find the device %s", devid)
+                return None
+
+        log.debug("dev = %s", dev)
+        return self.getDeviceController(deviceClass).destroyDevice(dev, force)
 
     def getDeviceSxprs(self, deviceClass):
         if self._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Fix xm block-detach regression introduced by c/s 15157., Xen patchbot-unstable <=