'Populate pci devices
:param dev_type: (string) Indicates the type of the device (PF, VF)
:param vf_ratio: (int) Ratio of Virtual Functions on Physical
:param group: (int) iommu group id
:param dev: (int) function number of the device
:param product_id: (int) Device product ID
:param numa_node: (int) NUMA node of the device'

def __init__(self, dev_type, vf_ratio, group, dev, product_id, numa_node):

    addr_templ = "        <address    domain='0x0000'    bus='0x81'    slot='0x%(slot)s'    function='0x%(dev)d'/>"
    self.pci_dev = None
    if (dev_type == 'PF'):
        pf_caps = [(addr_templ % {'dev': x, 'slot': VF_SLOT}) for x in range((dev * vf_ratio), ((dev + 1) * vf_ratio))]
        slot = int(str(PF_SLOT), 16)
        self.pci_dev = (self.pci_dev_template % {'dev': dev, 'prod': product_id, 'group_id': group, 'functions': '\n'.join(pf_caps), 'slot': slot, 'cap_type': PF_CAP_TYPE, 'prod_name': PF_PROD_NAME, 'driver': PF_DRIVER_NAME, 'numa_node': numa_node})
    elif (dev_type == 'VF'):
        vf_caps = [(addr_templ % {'dev': int((dev / vf_ratio)), 'slot': PF_SLOT})]
        slot = int(str(VF_SLOT), 16)
        self.pci_dev = (self.pci_dev_template % {'dev': dev, 'prod': product_id, 'group_id': group, 'functions': '\n'.join(vf_caps), 'slot': slot, 'cap_type': VF_CAP_TYPE, 'prod_name': VF_PROD_NAME, 'driver': VF_DRIVER_NAME, 'numa_node': numa_node})
