From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7gOv-0002z5-NE for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 04:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7gOq-0005Eh-Rg for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 04:51:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7gOq-0005Eb-My for Qemu-devel@nongnu.org; Wed, 24 Jun 2015 04:51:16 -0400 Message-ID: <558A6F80.2060609@redhat.com> Date: Wed, 24 Jun 2015 10:51:12 +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> In-Reply-To: <5B7FDD61-18AF-4024-9254-7B96582540E9@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 23/06/2015 22:10, Liviu Ionescu wrote: > I suggest your review should start from use cases like this: > > DeviceState *dev = my_dev_alloc(NULL, TYPE_MYTYPE); > my_dev_prop_set_bool(dev, "param", true); > my_dev_construct(OBJECT(dev), NULL); > my_dev_prop_set_uint32(dev, "xyz", 123); > my_dev_realize(dev); > > please ignore the fictional function names, and just assume that constructing the object requires a parameter that is given on the command line, so it does not exist statically at .instance_init time. > > the point here is that "xyz" is an alias, created during construction time. Can you explain this with real function names and parameters? Paolo