This is an oxidation-reduction (redox) reaction:
2 HI + 2 e- → 2 H0 (reduction)
Mg0 - 2 e- → MgII (oxidation)
H2SO4 is an oxidizing agent, Mg is a reducing agent.
Reactants:


, Sulfuric acid, concentrated (> 51% and < 100%)
, H2SO4
, Battery acid
, Hydrogen sulfate
, [SO2(OH)2] 
; Colorless to dark-brown, oily, odorless liquid. [Note: Pure compound is a solid below 51°F. Often used in an aqueous solution.] 
Products:

, Magnesium sulfate anhydrous 