Domain graphics events handler

def _domain_event_graphics_cb(conn, domain, phase, local, remote, auth, subject, opaque):
    '''
    Domain graphics events handler
    '''
    prefix = 'VIR_DOMAIN_EVENT_GRAPHICS_'

    def get_address(addr):
        '''
        transform address structure into event data piece
        '''
        return {'family': _get_libvirt_enum_string('{0}_ADDRESS_'.format(prefix), addr['family']),
                'node': addr['node'],
                'service': addr['service']}

    _salt_send_domain_event(opaque, conn, domain, opaque['event'], {
        'phase': _get_libvirt_enum_string(prefix, phase),
        'local': get_address(local),
        'remote': get_address(remote),
        'authScheme': auth,
        'subject': [{'type': item[0], 'name': item[1]} for item in subject]
    })