  We study generalized matrix models corresponding to n-point Virasoro
conformal blocks on Riemann surfaces with arbitrary genus g. Upon AGT
correspondence, these describe four dimensional N=2 SU(2)^{n+3g-3} gauge
theories with generalized quiver diagrams. We obtain the generalized matrix
models from the perturbative evaluation of the Liouville correlation functions
and verify the consistency of the description with respect to degenerations of
the Riemann surface. Moreover, we derive the Seiberg-Witten curve for the N=2
gauge theory as the spectral curve of the generalized matrix model, thus
providing a check of AGT correspondence at all genera.
