On 29 October 2013 07:57, Markus Armbruster <arm...@redhat.com> wrote: > sun4m.c and sun4u.c both define a qdev named TYPE_OPENPROM. As far as I > can tell, they differ only in the name of their memory region. > > If they ever get linked into the same executable, > type_register_internal() will reject the second one. But they aren't, > so this isn't a bug. Is it bad style?
Yes, in several ways. Board models shouldn't include qdev devices in their source files -- the devices should have their own source files in the appropriate section of hw/. We shouldn't have multiple devices of the same TYPE like that. And the device should probably be built once rather than per-target. I also suspect this device is jumping through hoops to deal with the fact that our image-loading API doesn't have any "load this image into this memory region" function (compare discussion recently on how the sbus graphics card patches handle loading their prom image). Fixing that might also simplify these devices. -- PMM