From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kvV-0005Ck-03 for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:41:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7kvP-0001e1-1W for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:41:16 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34067 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kvO-0001dY-Rp for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 09:41:10 -0400 Message-ID: <558AB375.8090309@suse.de> Date: Wed, 24 Jun 2015 15:41:09 +0200 From: =?windows-1252?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <803004FB-2F23-439C-AF59-E71FA7DDC2C4@livius.net> <55893750.3020502@suse.de> <55896C57.6060904@suse.de> <5B7FDD61-18AF-4024-9254-7B96582540E9@livius.net> <5EDCF9DC-453A-435C-9379-DE250716BA0F@livius.net> <04BD2F65-DACC-4865-9C16-2936F84220FD@livius.net> <558A7D9B.8050306@redhat.com> In-Reply-To: <558A7D9B.8050306@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Liviu Ionescu , Peter Crosthwaite Cc: QEMU Developers 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. >=20 > 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 --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)