<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _register_callback(cnx, tag_prefix, obj, event, real_id):
    '''
    Helper function registering a callback

    :param cnx: libvirt connection
    :param tag_prefix: salt event tag prefix to use
    :param obj: the libvirt object name for the event. Needs to
                be one of the REGISTER_FUNCTIONS keys.
    :param event: the event type name.
    :param real_id: the libvirt name of an alternative event id to use or None

    :rtype integer value needed to deregister the callback
    '''
    libvirt_name = real_id
    if real_id is None:
        libvirt_name = 'VIR_{0}_EVENT_ID_{1}'.format(obj, event).upper()

    if not hasattr(libvirt, libvirt_name):
        log.warning('Skipping "%s/%s" events: libvirt too old', obj, event)
        return None

    libvirt_id = getattr(libvirt, libvirt_name)
    callback_name = "_{0}_event_{1}_cb".format(obj, event)
    callback = globals().get(callback_name, None)
    if callback is None:
        log.error('Missing function %s in engine', callback_name)
        return None

    register = getattr(cnx, REGISTER_FUNCTIONS[obj])
    return register(None, libvirt_id, callback,
                    {'prefix': tag_prefix,
                     'object': obj,
                     'event': event})