'Remove device dependents or a parent from pools.
In case the device is a PF, all of it\'s dependent VFs should
be removed from pools count, if these are present.
When the device is a VF, it\'s parent PF pool count should be
decreased, unless it is no longer in a pool.'

def _handle_device_dependents(self, pci_dev):

    if (pci_dev.dev_type == fields.PciDeviceType.SRIOV_PF):
        vfs_list = pci_dev.child_devices
        if vfs_list:
            for vf in vfs_list:
                self.remove_device(vf)
    elif (pci_dev.dev_type == fields.PciDeviceType.SRIOV_VF):
        try:
            parent = pci_dev.parent_device
            if (parent in self.get_free_devs()):
                self.remove_device(parent)
        except exception.PciDeviceNotFound:
            return
