How to Make It
Melt butter in a large Dutch oven over medium-high. Add onions; toss to coat. Cook, tossing occasionally, until onions have softened, 8 to 10 minutes. Reduce heat to medium-low; add ham. Cook, stirring onions and turning ham occasionally, until onions are lightly browned, 35 to 40 minutes. Transfer ham to a plate, and shred into large pieces; set aside.
Increase heat to medium. Cook onions, stirring often, until deeply caramelized, 10 to 15 minutes. Whisk together flour and 1/2 cup of the stock in a small bowl until smooth; set aside. Add remaining 9 1/2 cups stock to onions; increase heat to high, and bring to a boil. Stir in shredded ham, flour mixture, sherry, and salt. Simmer 3 minutes.
Preheat broiler with oven rack 6 inches from heat. Place baguette slices on a baking sheet, and broil until toasted, 2 to 3 minutes. Turn baguette slices, top each evenly with cheese, and broil until bubbly, 2 to 3 minutes.
Ladle soup into bowls; top with baguette slices, and sprinkle with chives.