qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors


From: Andreas Färber
Subject: Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors
Date: Wed, 24 Jun 2015 15:41:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]