To prepare the soup and toast:.
Place a heavy based large pot over a moderate heat. Drizzle the olive oil into the hot pot and add the onions.
Cook the onions for 1 hour or until they are golden, stirring often. Once the onions become very soft they will begin to stick to the bottom of the pot and turn a caramel brown color. As this occurs, scrape the browned onions from the bottom of the pot and stir them into the remaining onion mixture.
Add the garlic, thyme and bay leaf to the onions and cook for 5 minutes or until the garlic softens. Add the red wine and sherry and stir to scrape up any browned bits on the bottom of the pan. Simmer for 5 minutes or until the liquids reduce by half.
Add the stock and bring the soup to a gentle simmer, skimming any foam that rises to the top, if necessary. Season the soup lightly with salt and pepper. Add just a bit of salt and pepper here, but not too much since the soup will reduce as it simmers and the flavors will become more concentrated.
Allow the soup to simmer uncovered for 25 minutes. Season the soup to taste with salt and pepper. Meanwhile, preheat the broiler on high. Arrange the sourdough bread slices on a baking sheet and broil for 2 minutes or until golden brown on top.
Divide the soup among 6 high sided ovenproof serving bowls. Place the bowls of soup on a heavy baking sheet. Place one bread slice, toasted side down, on top of each bowl of soup.
Divide the cheese among the soup bowls and sprinkle with parsley. Place the soup bowls under the broiler for about 3 minutes or until the cheese melts and is golden brown. Remove from the broiler and serve.