EU lawmakers pass migration reform