Received: from eggs.gnu.org ([2001:4830:134:3::10]:55633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3lEb-0007gF-Gk for qemu-devel@nongnu.org; Mon, 07 Nov 2016 09:49:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3lEW-0007yU-Hb for qemu-devel@nongnu.org; Mon, 07 Nov 2016 09:49:17 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58386) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3lEW-0007xc-8r for qemu-devel@nongnu.org; Mon, 07 Nov 2016 09:49:12 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA7EmsgP097129 for ; Mon, 7 Nov 2016 09:49:11 -0500 Received: from e06smtp06.uk.ibm.com (e06smtp06.uk.ibm.com [195.75.94.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 26jpfk9ngu-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 07 Nov 2016 09:49:10 -0500 Received: from localhost by e06smtp06.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Nov 2016 14:49:08 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9FAA01B08074 for ; Mon, 7 Nov 2016 14:51:16 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA7En4EE43385060 for ; Mon, 7 Nov 2016 14:49:04 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA7En4tj021072 for ; Mon, 7 Nov 2016 07:49:04 -0700 References: <1477705687-31175-1-git-send-email-ehabkost@redhat.com> <1477705687-31175-8-git-send-email-ehabkost@redhat.com> <14edf10a-a961-3216-2cbb-c839ce913725@linux.vnet.ibm.com> <20161107130556.GQ5057@thinpad.lan.raisama.net> From: Halil Pasic Date: Mon, 7 Nov 2016 15:48:49 +0100 MIME-Version: 1.0 In-Reply-To: <20161107130556.GQ5057@thinpad.lan.raisama.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vUamHj7KFm58UvgFrUtXRVOj3C8mA0RAq" Message-Id: <9ad4d662-df82-06d0-52a2-ec92b34b9733@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, Igor Mammedov , Markus Armbruster , =?UTF-8?Q?Andreas_F=c3=a4rber?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vUamHj7KFm58UvgFrUtXRVOj3C8mA0RAq From: Halil Pasic To: Eduardo Habkost Cc: qemu-devel@nongnu.org, Igor Mammedov , Markus Armbruster , =?UTF-8?Q?Andreas_F=c3=a4rber?= Message-ID: <9ad4d662-df82-06d0-52a2-ec92b34b9733@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties References: <1477705687-31175-1-git-send-email-ehabkost@redhat.com> <1477705687-31175-8-git-send-email-ehabkost@redhat.com> <14edf10a-a961-3216-2cbb-c839ce913725@linux.vnet.ibm.com> <20161107130556.GQ5057@thinpad.lan.raisama.net> In-Reply-To: <20161107130556.GQ5057@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 11/07/2016 02:05 PM, Eduardo Habkost wrote: > If you want some subclasses to not have the property, then I > recommend not registering it as a class property on the base > class in the first place. I don't expect to see a mechanism to > allow subclasses to remove or override class properties from > parent classes. >=20 Thank you very much for your reply. I understand, yet I see potential problems. The example with ioeventfd and vhost in virtio-pci is a good one also because the first there was the ioeventfd property with commit 653ced07 and then the vhost case came along with commit 50787628ee3 (ok ioeventfd is not there for some non vhost virtio-pci devices for reasons I do not understand). To rephrase this in generic context a specialization for which a property does not make sense might come along after the property at the base class was established. Now AFAIU properties are external API, so having to make a compatibility breaking change there might not be fun. Does this mean one should be very careful to put only use class level properties on abstract classes where its certain that the property always makes sense including it's access control? If yes, how does this relate to patch 5 "Register static properties as class properties" where the object level properties are converted to class level properties? > You have many alternatives in this case: you could use instance > properties What are inheritance properties? Sorry I'm not quite that deep yet to know myself. > , or register it as class property only on some > subclasses (class_base_init could you help you do it on a single > place, instead of duplicating the property registration code on > subclasses). Thanks again, and sorry if I'm a bother. Cheers, Halil --vUamHj7KFm58UvgFrUtXRVOj3C8mA0RAq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iQIcBAEBAgAGBQJYIJRfAAoJEA0vhuyXGx0A6pQQALwyk7PpN6gA1eP9L2dxwKNg 4dRA2JDGHjjP5ZYVw7YAr08jl+PKmry/T2ttWOLEnbx085TUYk8HxfdvaAkHPQUu mVR55T3g0oIan1VW+IY9aBeqtjsVP25msOAdmD3JX4s3fSKtKLFrozhYq4HGM3DT falfzCyacJt6nqhNLDd5a8dPJ5X+OLJ4Ybu9oQL7rqplsRPdBXlkKnbep/l6O/Ll rrQAwYoDrtvWgv+7GhXwyH2u4jpguK0DYSEB9KN09N44SmJo5k5tCZt4Sgz+gwlW rLCnyTvVsFFyIa6+VQfIf52prcHE3AMW2VsN6S6plOoshKQgf3t6f4DdTFCA8FOQ yM1DLouLtJbneSRQXfjddUUXWedH8UYS1I5KqI60hKoLQena48LAVnGh7OxFczfl zipTVlRivJyiaNOOloVwT4bWmqUrK3oyUSUL2BK4NoAOjpn0Sw/LZBDNcKciF+fA OEGh04k9QmEwTtrieDrQPRlAiAl80z4LTl89lQ5PUsPjOodlqISEgtIMIdixomWy Uq3krjZBKDVwpPhCpBrvL6MDVjMNhqSKsi0Kck6W7vO50uYMMQ4nFZqZLlSHDiXS SALXkx3NrTk/JBosbVgwdlalia5T7IjHjSVv8IzLihn1+aW1MzFjAtyM6SHjHR27 0ERvZYqSDet2ej+RPVR9 =W8Mu -----END PGP SIGNATURE----- --vUamHj7KFm58UvgFrUtXRVOj3C8mA0RAq--