From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7hLA-0003g1-BQ for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 05:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7hL6-00020P-C1 for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 05:51:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7hL6-000204-75 for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 05:51:28 -0400 Message-ID: <558A7D9B.8050306@redhat.com> Date: Wed, 24 Jun 2015 11:51:23 +0200 From: Paolo Bonzini 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> In-Reply-To: <04BD2F65-DACC-4865-9C16-2936F84220FD@livius.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liviu Ionescu , Peter Crosthwaite Cc: =?windows-1252?Q?Andreas_F=E4rber?= , QEMU Developers 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. Paolo