Peel the onions, top and tail them. Cut them in half, then cut each half into very thin slices or just chop them.
Put the oil and the onions into a pot, and cook the onions over a low heat until they are transparent.
When the onions are transparent and tender, add the wine, still over low heat. Add some salt to bring out the flavor, and a little pepper.
Add the sugar, stirring to blend it.
Cook this down until the wine is totally cooked away, always over low heat. The consistency should be like a jam, because you will spread this on toasts for the foie gras, and you don't want it to be drippy.
This shouldn't be too sweet, because it is for meat, but you can up the dose of sugar a little if you want.
You can add some sultanas and a few cloves while you cook the liquid down to vary the recipe.