Hi, >> @@ -1312,29 +1320,24 @@ static TypeInfo piix3_uhci_info = { >> .name = "piix3-usb-uhci", >> .parent = TYPE_PCI_DEVICE, >> .instance_size = sizeof(UHCIState), >> - .class_init = piix3_uhci_class_init, >> + .class_init = uhci_class_init, > > Therese three elements (parent, instance_size, class_init) are > repeated from one definition to the next. This will get tedious when > we eventually come to make the same fix for some of the other devices > that have large numbers of variants (pflash_cfi0x and m25p80 being > some of the angrier ones).
I think we can also create TypeInfo at runtime (uhci_register_types in the uhci case). We'll just have to stick the name into UHCIInfo, build a static uhciinfo array, then generate & register TypeInfo from that. cheers, Gerd