We investigate unresolved X‐ray emission from M31 based on an extensive set of archival XMM–Newton and Chandra data. We show that extended emission, found previously in the bulge and thought to be associated with a large number of faint compact sources, extends to the disc of the galaxy with similar X‐ray to K‐band luminosity ratio. We also detect excess X‐ray emission associated with the 10‐kpc star‐forming ring. The LX/SFR (star formation rate) ratio in the 0.5–2 keV band ranges from zero to ≈1.8 × 1038 (erg s−1)/(M⊙ yr−1), excluding the regions near the minor axis of the galaxy where it is ∼1.5–2 times higher. The latter is likely associated with warm ionized gas of the galactic wind rather than with the star‐forming ring itself. Based on this data, we constrain the nature of classical nova (CN) progenitors. We use the fact that hydrogen‐rich material, required to trigger the explosion, accumulates on the white dwarf surface via accretion. Depending on the type of the system, the energy of accretion may be radiated at X‐ray energies, thus contributing to the unresolved X‐ray emission. Based on the CN rate in the bulge of M31 and its X‐ray surface brightness, we show that no more than ∼10 per cent of CNe can be produced in magnetic cataclysmic variables, the upper limit being ∼3 per cent for parameters typical of CN progenitors. In dwarf novae, ≳90–95 per cent of the material must be accreted during outbursts, when the emission spectrum is soft, and only a small fraction in quiescent periods, characterized by rather hard spectra.