From: Masaki Kanno Subject: Re: [PATCH] Fix xm block/network-detach command Date: Tue, 07 Aug 2007 19:38:13 +0900 Message-ID: <13C7D8DF0E44F2kanno.masaki@jp.fujitsu.com> References: <46B7C26B.4080903@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <46B7C26B.4080903@novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jim Fehlig Cc: xen-devel@lists.xensource.com, mats@planetcatfish.com List-Id: xen-devel@lists.xenproject.org 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. >http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00038.html > >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, Kan