From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpYT7-0003t8-7V for qemu-devel@nongnu.org; Thu, 29 Sep 2016 06:21:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpYT2-0003AU-BJ for qemu-devel@nongnu.org; Thu, 29 Sep 2016 06:21:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpYT2-0003AO-4r for qemu-devel@nongnu.org; Thu, 29 Sep 2016 06:21:28 -0400 Date: Thu, 29 Sep 2016 11:21:22 +0100 From: "Daniel P. Berrange" Message-ID: <20160929102122.GL5312@redhat.com> Reply-To: "Daniel P. Berrange" References: <1475108205-6043-1-git-send-email-david@gibson.dropbear.id.au> <20160929081416.GD5312@redhat.com> <8b3cbb6a-1e95-20e8-e34e-d25f790855ff@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8b3cbb6a-1e95-20e8-e34e-d25f790855ff@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC 0/4] QOM class properties - do we need them? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: David Gibson , peter.maydell@linaro.org, qemu-devel@nongnu.org, pbonzini@redhat.com, armbru@redhat.com, lcapitulino@redhat.com On Thu, Sep 29, 2016 at 12:12:32PM +0200, Andreas F=C3=A4rber wrote: > Am 29.09.2016 um 10:14 schrieb Daniel P. Berrange: > > On Thu, Sep 29, 2016 at 10:16:41AM +1000, David Gibson wrote: > >> QOM has the concept of both "object class" properties and "object > >> instance" properties. > >> > >> The accessor functions installed for the rarely-used class propertie= s > >> still take an Object *, so the *value* of such properties is still > >> per-instance; it's just the *existence* (and type) of the property > >> that is per-class. > >=20 > > Yes, of course. This is the whole point of class properties. It avoid= s > > allocating the same ObjectProperty struct against every object instan= ce > > which wastes massive amounts of memory in scenarios where there are l= ots > > of instances created. >=20 > +1 >=20 > >> Of course, that's also true in practice for the great majority of > >> "instance" properties, because they're created identically and > >> unconditionally for every instance from the per-class instance_init > >> hook. > >> > >> This also means that the (unused) object_class_property_add_*_ptr() > >> functions don't make a lot of sense, since they require a fixed > >> pointer which means the value of such a property would only be > >> per-class. > >> > >> Given that, is there really any value to supporting the "class" > >> properties in addition to the "instance" properties? This series is > >> an RFC which removes all support for class properties, changing the > >> few existing users to instance properties instead. > >> > >> Alternatively, if we *don't* want to remove class properties, should > >> we instead be trying to convert the many, many "instance" properties > >> whose existence is actually per-class to be class properties? > >=20 > > Practically all instances properties should become class properties > > as its going to save wasting memory once most are converted. >=20 > Not all, but most. child<> properties were the reason to have propertie= s > on the instance. That's why I said "Practically all", instead of just "all" :-) Regards, Daniel --=20 |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| |: http://libvirt.org -o- http://virt-manager.or= g :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr= / :|