Structural stability of cooling flows