'Batch query the database for our instances\' faults.
:returns: A list of instance uuids for which faults were found.'

def fill_faults(self):

    uuids = [inst.uuid for inst in self]
    faults = objects.InstanceFaultList.get_latest_by_instance_uuids(self._context, uuids)
    faults_by_uuid = {}
    for fault in faults:
        faults_by_uuid[fault.instance_uuid] = fault
    for instance in self:
        if (instance.uuid in faults_by_uuid):
            instance.fault = faults_by_uuid[instance.uuid]
        else:
            instance.fault = None
        instance.obj_reset_changes(['fault'])
    return faults_by_uuid.keys()
