Get the stock on to simmer. Add the rosemary and mushroom stalks.
Gently fry the onions and garlic in a little oil until translucent. Add the mushrooms and cook for another couple of minutes to soften.
Turn the heat up and add the rice, stirring the whole time to toast the outer surface of the rice without burning. After a minute add the wine and deglaze the pan with it.
Add the stock a ladleful at a time, taking care not to add the stalks. Each time stir the rice well and don't add any more liquid until the previous ladleful has been absorbed.
After about 15 minutes of adding stock taste the rice for doneness. You want something squishy but not complete mush. At that point turn the heat off and beat the parmesan and butter into the rice vigorously. Taste, adjust the seasoning, pop a lid on top and let stand for a minute or two.