'Returns a dict of PCI device.'

def _get_pcidev_info(self, devname):

    def _get_device_type(cfgdev, pci_address):
        "Get    a    PCI    device's    device    type.\n\n                                                An    assignable    PCI    device    can    be    a    normal    PCI    device,\n                                                a    SR-IOV    Physical    Function    (PF),    or    a    SR-IOV    Virtual\n                                                Function    (VF).    Only    normal    PCI    devices    or    SR-IOV    VFs\n                                                are    assignable,    while    SR-IOV    PFs    are    always    owned    by\n                                                hypervisor.\n                                                "
        for fun_cap in cfgdev.pci_capability.fun_capability:
            if (fun_cap.type == 'virt_functions'):
                return {'dev_type': fields.PciDeviceType.SRIOV_PF}
            if ((fun_cap.type == 'phys_function') and (len(fun_cap.device_addrs) != 0)):
                phys_address = ('%04x:%02x:%02x.%01x' % (fun_cap.device_addrs[0][0], fun_cap.device_addrs[0][1], fun_cap.device_addrs[0][2], fun_cap.device_addrs[0][3]))
                return {'dev_type': fields.PciDeviceType.SRIOV_VF, 'parent_addr': phys_address}
        if (not self._host.has_min_version(MIN_LIBVIRT_PF_WITH_NO_VFS_CAP_VERSION)):
            is_physical_function = pci_utils.is_physical_function(*pci_utils.get_pci_address_fields(pci_address))
            if is_physical_function:
                return {'dev_type': fields.PciDeviceType.SRIOV_PF}
        return {'dev_type': fields.PciDeviceType.STANDARD}
    def _get_device_capabilities(device, address):
        "Get    PCI    VF    device's    additional    capabilities.\n\n                                                If    a    PCI    device    is    a    virtual    function,    this    function    reads    the    PCI\n                                                parent's    network    capabilities    (must    be    always    a    NIC    device)    and\n                                                appends    this    information    to    the    device's    dictionary.\n                                                "
        if (device.get('dev_type') == fields.PciDeviceType.SRIOV_VF):
            pcinet_info = self._get_pcinet_info(address)
            if pcinet_info:
                return {'capabilities': {'network': pcinet_info.get('capabilities')}}
        return {}
    virtdev = self._host.device_lookup_by_name(devname)
    xmlstr = virtdev.XMLDesc(0)
    cfgdev = vconfig.LibvirtConfigNodeDevice()
    cfgdev.parse_str(xmlstr)
    address = ('%04x:%02x:%02x.%1x' % (cfgdev.pci_capability.domain, cfgdev.pci_capability.bus, cfgdev.pci_capability.slot, cfgdev.pci_capability.function))
    device = {'dev_id': cfgdev.name, 'address': address, 'product_id': ('%04x' % cfgdev.pci_capability.product_id), 'vendor_id': ('%04x' % cfgdev.pci_capability.vendor_id)}
    device['numa_node'] = cfgdev.pci_capability.numa_node
    device['label'] = ('label_%(vendor_id)s_%(product_id)s' % device)
    device.update(_get_device_type(cfgdev, address))
    device.update(_get_device_capabilities(device, address))
    return device
