From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?windows-1252?Q?J=FCrgen_Gro=DF?= Subject: Re: [PATCH V4 3/7] libxl: add pvusb API Date: Wed, 17 Jun 2015 06:03:03 +0200 Message-ID: <5580F177.20702@suse.com> References: <1433906441-3280-1-git-send-email-cyliu@suse.com> <1433906441-3280-4-git-send-email-cyliu@suse.com> <21887.64856.265751.921367@mariner.uk.xensource.com> <21888.1191.40486.530231@mariner.uk.xensource.com> <21888.20366.133089.128189@mariner.uk.xensource.com> <55805127.1010105@eu.citrix.com> <55805414.5010004@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55805414.5010004@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ross Philipson , George Dunlap , Ian Jackson Cc: Wei Liu , Ian Campbell , Chunyan Liu , "xen-devel@lists.xen.org" , Jim Fehlig , Simon Cao List-Id: xen-devel@lists.xenproject.org On 06/16/2015 06:51 PM, Ross Philipson wrote: > On 06/16/2015 12:39 PM, George Dunlap wrote: >> On 06/16/2015 05:32 PM, Ian Jackson wrote: >>> I have just discovered that the value used in /dev/disk/by-path is not >>> from sysfs, or at least, not directly. >>> >>> udev cobbles it together with a bunch of string mangling, from >>> information mostly from sysfs. There is no corresponding thing for >>> usb devices. >>> >>> So Linux, the kernel, does not actually provide a stable device name >>> string. This is obviously absurd, but I think fixing it is out of >>> scope. >>> >>> I suggest we provide a facility to allow a user to specify a fnmatch >>> glob pattern to be applied to the sysfs path. That way when they see >>> their device is >>> /devices/pci0000:00/0000:00:1d.7/usb1/1-1 >>> they can write >>> /devices/pci0000:00/0000:00:1d.7/usb*/*-1 >>> which will match exactly and only the right thing. >> >> What about Juergen's system that has two usbN directories in a single >> pci node? >> >> Quoting: >> --- >> Hmm, perhaps. On my system I've got: >> >> /sys/devices/pci0000:00/0000:00:14.0/usb3/ >> /sys/devices/pci0000:00/0000:00:14.0/usb4/ >> >> So two busses on one pci bus address. Are usb3 and usb4 always in this >> order or are they sometimes just numbered the other way round? >> --- >> >> Assuming that usb3 and usb4 are actually distinct busses, and they might >> both have something plugged into port; in which case a glob like this: >> >> devices/pci0000:00/0000:00:14.0/usb*/*-1 >> >> Might match both of the following: >> >> /sys/devices/pci0000:00/0000:00:14.0/usb3/3-1 >> /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1 > > Is that an xHCI host controller? If so that might be how the system > represents the 2 logical (USB2/USB3) root hubs - each as its own > separate bus. See my other reply: this is the case. So Ian's suggestion would still work. Juergen