In the second case, the filters are hard coded, and not limit is used. I think it's safe not to handle that.
In the first case, ironically, the only place that seems to use that _get_ports_query method is the function in the second case, and the method in ML2plugin is also calling its parent in db_base, handled in the first patch. So we are handling limit in many places even if the usage of that method seems so ... limited.
In the second case, the filters are hard coded, and not limit is used. I think it's safe not to handle that.
In the first case, ironically, the only place that seems to use that _get_ports_query method is the function in the second case, and the method in ML2plugin is also calling its parent in db_base, handled in the first patch. So we are handling limit in many places even if the usage of that method seems so ... limited.