'Scan os directories to get VF devices
@param dev_name: pf network device name
@return: list of virtual functions'

@classmethod
def scan_vf_devices(cls, dev_name):

    vf_list = []
    dev_path = (cls.DEVICE_PATH % dev_name)
    if (not os.path.isdir(dev_path)):
        LOG.error(_LE('Failed    to    get    devices    for    %s'), dev_name)
        raise exc.InvalidDeviceError(dev_name=dev_name, reason=_('Device    not    found'))
    file_list = os.listdir(dev_path)
    for file_name in file_list:
        pattern_match = cls.VIRTFN_REG_EX.match(file_name)
        if pattern_match:
            vf_index = int(pattern_match.group('vf_index'))
            file_path = os.path.join(dev_path, file_name)
            if os.path.islink(file_path):
                file_link = os.readlink(file_path)
                pci_slot = os.path.basename(file_link)
                vf_list.append((pci_slot, vf_index))
    return vf_list
