'Remove one device from the first pool that it matches.'

def remove_device(self, dev):

    dev_pool = self._create_pool_keys_from_dev(dev)
    if dev_pool:
        pool = self._find_pool(dev_pool)
        if (not pool):
            raise exception.PciDevicePoolEmpty(compute_node_id=dev.compute_node_id, address=dev.address)
        pool['devices'].remove(dev)
        self._decrease_pool_count(self.pools, pool)
