Rival governments find common ground in warning EU on migrant plans