'Free device from pci resource tracker
:param dev: cloned pci device object that needs to be free
:param instance: the instance that this pci device
is allocated to'

def free_device(self, dev, instance):

    for pci_dev in self.pci_devs:
        if ((dev.id == pci_dev.id) and (dev.instance_uuid == instance['uuid'])):
            self._remove_device_from_pci_mapping(instance['uuid'], pci_dev, self.allocations)
            self._remove_device_from_pci_mapping(instance['uuid'], pci_dev, self.claims)
            self._free_device(pci_dev)
            break
