This is a complicated patch to review. It feels like each of the=== sections could be submitted as a separate patch.regards,dan carpenter