[openstack-dev] [zun][unit test] Any python utils can collect pci info?

Hongbin Lu hongbin.lu at huawei.com
Mon Sep 18 02:41:05 UTC 2017


Hi Shunli,

I am not aware of any prevailing python utils for this. An alternative is to shell out Linux commands to collect the information. After a quick search, it looks xenapi [1] uses “lspci -vmmnk” to collect PCI device detail info and “ls /sys/bus/pci/devices/<pci_device>/” to detect the PCI device type (PF or VF). FWIW, you might find it helpful to refer the implementation of Nova’s xenapi driver for gettiing PCI resources [2]. Hope it helps.

[1] https://github.com/openstack/os-xenapi/blob/master/os_xenapi/dom0/etc/xapi.d/plugins/xenhost.py#L593
[2] https://github.com/openstack/nova/blob/master/nova/virt/xenapi/host.py#L154

Best regards,
Hongbin

From: Shunli Zhou [mailto:shunli6658 at gmail.com]
Sent: September-17-17 9:35 PM
To: openstack-dev at lists.openstack.org
Subject: [openstack-dev] [zun][unit test] Any python utils can collect pci info?

Hi all,

For https://blueprints.launchpad.net/zun/+spec/support-pcipassthroughfilter this BP, Nova use the libvirt to collect the PCI device info. But for zun, libvirt seems is a heavy dependecies. Is there a python utils that can be used to collect the PCI device detail info? Such as the whether it's a PF of network pci device of VF, the device capabilities, etc.

Note: For 'lspci -D -nnmm' , there are some info can not get.


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170918/d6f299fb/attachment.html>


More information about the OpenStack-dev mailing list