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

2017-09-20 Thread Hongbin Lu
Hi Eric,

Thanks for pointing this out. This BP 
(https://blueprints.launchpad.net/zun/+spec/use-privsep) was created to track 
the introduction of privsep.

Best regards,
Hongbin

> -Original Message-
> From: Eric Fried [mailto:openst...@fried.cc]
> Sent: September-18-17 10:51 AM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [zun][unit test] Any python utils can
> collect pci info?
> 
> You may get a little help from the methods in nova.pci.utils.
> 
> If you're calling out to lspci or accessing sysfs, be aware of this
> series [1] and do it via the new privsep mechanisms.
> 
> [1]
> https://review.openstack.org/#/q/status:open+project:openstack/nova+bra
> nch:master+topic:hurrah-for-privsep
> 
> On 09/17/2017 09:41 PM, Hongbin Lu wrote:
> > 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//” 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:shunli6...@gmail.com]
> > *Sent:* September-17-17 9:35 PM
> > *To:* openstack-dev@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-
> pcipassthroughfilte
> > r 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
> >
> >
> >
> >
> __
> >  OpenStack Development Mailing List (not for usage questions)
> > Unsubscribe:
> > openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> >
> 
> ___
> ___
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-
> requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2017-09-18 Thread Eric Fried
You may get a little help from the methods in nova.pci.utils.

If you're calling out to lspci or accessing sysfs, be aware of this
series [1] and do it via the new privsep mechanisms.

[1]
https://review.openstack.org/#/q/status:open+project:openstack/nova+branch:master+topic:hurrah-for-privsep

On 09/17/2017 09:41 PM, Hongbin Lu wrote:
> 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//” 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:shunli6...@gmail.com]
> *Sent:* September-17-17 9:35 PM
> *To:* openstack-dev@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
> 
> 
> 
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2017-09-17 Thread Hongbin Lu
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//” 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:shunli6...@gmail.com]
Sent: September-17-17 9:35 PM
To: openstack-dev@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
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


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

2017-09-17 Thread Shunli Zhou
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
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev