From: Ian Campbell Subject: Re: [PATCH] xl: Special case tap/aio for disk validation Date: Thu, 27 Jan 2011 17:53:39 +0000 Message-ID: <1296150819.20804.2.camel@localhost.localdomain> References: <4D407A06.1050902@gmail.com> <19777.36262.691401.791181@mariner.uk.xensource.com> <1296142527.14780.6892.camel@zakaz.uk.xensource.com> <19777.39923.755279.143976@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19777.39923.755279.143976@mariner.uk.xensource.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: Ian Jackson Cc: "xen-devel@lists.xensource.com" , "Kamala Narasimhan (3P)" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2011-01-27 at 16:23 +0000, Ian Jackson wrote: > Ian Campbell writes ("Re: [Xen-devel] [PATCH] xl: Special case tap/aio for disk validation"): > > FWIW xend notices a relative path and wacks a "/dev/" on the front. > > Oh dear. So is the syntax > some:pile:of:useless:prefixes:sponge > allowed to mean /dev/sponge ? What if you want to refer to > /dev/sponge:1 ? I guess that probably doesn't work right now. > > So the right algorithm is: > - rhs starts with '/': it's a pathname > - rhs has a colon: it's a prefix > - rhs has neither: hope it's a pathname in /dev > ? Sounds about right. FWIW from xend: def _parse_uname(uname): fn = taptype = None if uname.find(":") != -1: (typ, fn) = uname.split(":", 1) if typ in ("phy", "drbd") and not fn.startswith("/"): fn = "/dev/%s" %(fn,) if typ in ("tap", "tap2"): (taptype, fn) = fn.split(":", 1) return (fn, taptype) /me cries.