'Remove all usages for instances not passed in the parameter.
The caller should hold the COMPUTE_RESOURCE_SEMAPHORE lock'

def clean_usage(self, instances, migrations, orphans):

    existed = set((inst['uuid'] for inst in instances))
    existed |= set((mig['instance_uuid'] for mig in migrations))
    existed |= set((inst['uuid'] for inst in orphans))
    for uuid in list(self.claims):
        if (uuid not in existed):
            devs = self.claims.pop(uuid, [])
            for dev in devs:
                self._free_device(dev)
    for uuid in list(self.allocations):
        if (uuid not in existed):
            devs = self.allocations.pop(uuid, [])
            for dev in devs:
                self._free_device(dev)
