← Back to team overview

checkbox-dev team mailing list archive

Re: Using libpci to resolve device names

 

On Thu, Apr 23, 2015 at 3:17 PM, Zygmunt Krynicki
<zygmunt.krynicki@xxxxxxxxxxxxx> wrote:
> Hey
>
> A while ago I talked to Pierre about a bug where we would not see
> product name for a certain PCI graphics card. We looked, read, and
> searched and realized how the PCI database works. We thought about
> adding a local database or about doing something better than just not
> working at all.

Just to confirm, the recent hack so that if there's no product name we
show the PCI ID, was that helpful at all?

The bug number would be useful to see more detail about this :)

>
> The canonical way to look up those names is through libpci. Since
> libpci is written in C and has a simple API I thought about making
> some bindings so that we can use that in checkbox.
>
> And so I did, this is an example program that does vendor or device
> name lookup [1, 2, 3]. Note that currently it only works on Python 3.4
> as I used the enum module (it doesn't work on Ubuntu 12.04).
>
> One interesting observation is the ability to query the central server
> when a given identifier cannot be found in a local database. You can
> use that by setting pci.flag_network = True (or call the pci-lookup
> script with --network argument at the end).

Without more data on the bug I can only speculate, but if this
happened on a SUT, the solution that looks up stuff on the central
server may not work (tm) if the network is down for some reason. In
this case you'll still get no product name, which can be an issue if
you're running tests locally. If this is about something else, then
perhaps I'm wrong :)

>
> Please tell me what you think.

I think this is awesome! and should be quite useful.

>
> Thanks
> ZK
>
> [1] https://github.com/zyga/libpci/blob/master/pci-lookup
> [2] https://github.com/zyga/libpci
> [3] http://libpci.readthedocs.org/en/latest/usage.html#module-libpci
>
> --
> pes-tools-cert mailing list
> pes-tools-cert@xxxxxxxxxxxxxxxxxxx
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/pes-tools-cert


Follow ups

References