  Let $M$ be a closed oriented surface and let $\Omega$ be a non-exact 2-form.
Suppose that the magnetic flow $\phi$ of the pair $(g,\Omega)$ is Anosov. We
show that the longitudinal KAM-cocycle of $\phi$ is a coboundary if and only
the Gaussian curvature is constant and $\Omega$ is a constant multiple of the
area form thus extending the results in \cite{P2}. We also show infinitesimal
rigidity of the action spectrum of $\phi$ with respect to variations of
$\Omega$. Both results are obtained by showing that if $G:M\to\mathbb R$ is any
smooth function and $\omega$ is any smooth 1-form on $M$ such that
$G(x)+\omega_{x}(v)$ integrates to zero along any closed orbit of $\phi$, then
$G$ must be identically zero and $\omega$ must be exact.
