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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] Fix xm block/network-detach command

To: Jim Fehlig <jfehlig@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Fix xm block/network-detach command
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: Tue, 07 Aug 2007 19:38:13 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, mats@xxxxxxxxxxxxxxxxx
Delivery-date: Tue, 07 Aug 2007 03:36:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <46B7C26B.4080903@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <46B7C26B.4080903@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Jim,

Tue Aug. 07 2007, Jim Fehlig wrote:
>A comment about the patch:
>+    def convertToDeviceNumber(self, devid):
>+        try:
>+            dev = int(devid)
>+        except ValueError:
>+            # devid is not a number but a string containing either
>+            # device name (e.g. xvda or xvda:disk) or
>+            # device_type/device_id (e.g. vbd/51728)
>+            dev = type(devid) is str and devid.split('/')[-1] or None
>+            if dev == None:
>+                return None
>+            try:
>+                dev = int(dev)
>+            except ValueError:
>+                dev = dev.split(':')[0]
>+                dev = blkdev_name_to_number(dev)
>+        return dev
>Can this be pushed into the DevController?  Seems like the individual
>device controllers would be best equipped to determine validity of a
>deviceid.  That's what I was trying to do with this patch

I believe that I can do it. 

>which I see is now in the staging tree as c/s 15689.  BTW, there a two
>xml files included in that c/s that were not part of the patch I
>submitted :-).

Maybe they are patches for CS:15688. 

Best regards,

Xen-devel mailing list