Am 24.06.2015 um 11:51 schrieb Paolo Bonzini: > On 24/06/2015 11:29, Liviu Ionescu wrote: >> ok, I managed to restructure my code to get rid of the explicit >> constructor. :-) >> >> I also avoided properties aliases, and did prop setting in two steps, >> in machine init I set props in MCU, and from here I manually set them >> in specific peripherals, after they are created. less efficient then >> aliases, but functional. >> >> however, there is one aspect that I'm not compliant with your >> requirements: I'm still creating objects in realize(), since many of >> my objects have dynamic content. for example MCUs have different >> number of GPIOs, it is possible to create all of them in init and >> then map only the used ones, but to me this looks sub-optimal. > > I think this is okay.
It's acceptable (Error **errp available for reporting) but not ideal (no way to inspect and set properties on the created child devices). Therefore my pointer to dynamic properties, which we made Alexey use for ppc's XICS for a similar problem of N child devices. Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB 21284 (AG Nürnberg)