El día 29 de diciembre de 2010 17:16, Greg KH <greg@xxxxxxxxx> escribió: > On Wed, Dec 29, 2010 at 05:08:56PM +0100, José Félix Ontañón wrote: >> El día 29 de diciembre de 2010 01:18, Scott James Remnant >> <scott@xxxxxxxxxxxx> escribió: >> > 2010/12/28 Lennart Poettering <lennart@xxxxxxxxxxxxxx>: >> >> On Tue, 28.12.10 14:14, José Félix Ontañón (felixonta@xxxxxxxxx) wrote: >> >> >> >>> Hi, everybody! >> >>> >> >>> Maybe this is kinda silly question but, I wonder why isn't >> >>> "ID_VENDOR_FROM_DATABASE / ID_MODEL_FROM_DATABASE"-like properties >> >>> imported by default using the pretty /lib/udev/usb-db and >> >>> /lib/udev/pci-db commands for every founded pci/usb device? >> >>> >> >>> I mean, by adding this simple rules: >> >>> >> >>> SUBSYSTEMS=="usb", IMPORT{program}="usb-db %p" >> >>> SUBSYSTEMS=="pci", IMPORT{program}="pci-db %p" >> >>> >> >>> I think this properties are very useful for apps that discover >> >>> hardware through udev, so they will not have to reinvent the wheel by >> >>> finding vendor/product names by themselves. Don't you think? >> >> >> >> The database lookup is a linear search. As long as we invoke it only for >> >> a small subset of devices that doesn't really matter much. But if we >> >> start to look it up for every device we should probably spend the time >> >> to improve the db lookup first. >> >> >> >> It's simply a question of efficiency. >> >> >> > One thing that might be interesting is if we could do the lookup at >> > the point of query, then store the answer back in the db for others to >> > use later. >> > >> > That way we're efficient if nobody cares, and lose that efficiency >> > when they do (but only for the devices they query), and subsequently >> > efficient because the answer is cached. >> > >> > This veers a bit dangerously towards having apps that link with >> > libudev process rules though? >> > >> > Scott >> > >> >> First thing coming to my mind: there's not enough pci/usb devices >> present on the system for increasing the computational cost >> significantly. > > How can you say that? I see systems with thousands of PCI devices on it > as being very common in some areas. You're right, I was to fast thinking about personal_computers-like only. That's because I said it maybe was a silly question, sorry. >> I think it's quite comfortable, for me as desktop app coder, to >> delegate on udev the vendor/model name querying, more if we think udev >> provides the cool pci-db and usb-db commands. > > Again, what's wrong with using libpci directly for this? That's what it > is there for. Greg, i'm coding python, do you know about a python bindings for libpci? It would be really nice if you could tell me because I didn't found. Thanks for your answers. > thanks, > > greg k-h > -- http://fontanon.org -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html