From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq054-0004ti-CT for qemu-devel@nongnu.org; Wed, 25 Jan 2012 05:28:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rq052-0000Pu-A6 for qemu-devel@nongnu.org; Wed, 25 Jan 2012 05:27:54 -0500 Message-ID: <4F1FD920.2070700@web.de> Date: Wed, 25 Jan 2012 11:27:44 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1327433600-7403-1-git-send-email-aliguori@us.ibm.com> <1327433600-7403-28-git-send-email-aliguori@us.ibm.com> <4F1F0E2D.2020706@web.de> <4F1F12E7.2020309@us.ibm.com> <4F1F1C28.4040600@web.de> <4F1F1E91.50609@codemonkey.ws> <4F1F233B.8040804@web.de> <4F1F2875.3050509@codemonkey.ws> <4F1F2B77.2020703@web.de> <4F1F38B6.7000506@codemonkey.ws> <4F1FBF31.2020002@web.de> <4F1FD632.2000409@redhat.com> In-Reply-To: <4F1FD632.2000409@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigFB6B4D272E59EF908C23AD98" Subject: Re: [Qemu-devel] [PATCH 27/28] sysbus: apic: ioapic: convert to QEMU Object Model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , "Michael S. Tsirkin" , Alexander Graf , qemu-devel@nongnu.org, Blue Swirl , =?ISO-8859-15?Q?Andreas_F=E4rber?= , qemu-ppc@nongnu.org, Paul Brook , Aurelien Jarno , Gerd Hoffmann This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFB6B4D272E59EF908C23AD98 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2012-01-25 11:15, Paolo Bonzini wrote: > On 01/25/2012 09:37 AM, Jan Kiszka wrote: >>> > They're exactly the same size (16 lines). If you embed TypeInfo i= nto >>> > DeviceTypeInfo, and introduce a Device specific type registration >>> > function, then you could do: >>> > >>> > static DeviceTypeInfo my_device_type_info =3D { >>> > .type.name =3D TYPE_MY_DEVICE, >>> > .type.parent =3D TYPE_PARENT_DEVICE, >>> > .reset =3D my_device_reset, >> And if you introduce some >> >> #define TYPE_UNIMPLEMENTED (void *)&dummy_variable >> >> you can easily express >> >> [.field =3D NULL] =3D> use parent >> .field =3D UNIMPLEMENTED =3D> don't run any handler >> >=20 > I agree with Anthony, this would get really ugly where you are calling > the functions and doing the class initialization. I think we need to try it first. There is a lot of repetition, and that gets boring at beat and ugly at worst when doing it for hundreds of devices - compared to the number of base classes we will have. > It's a different > style from what we're used to, granted, but the difference in code size= > is not relevant (not enough to introduce a level of macro magic, at > least) and the diffstat in this series is misleading because qdev is > left with temporary duplication for now. I was looking at the final version Anthony pointed at. Jan --------------enigFB6B4D272E59EF908C23AD98 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.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk8f2SIACgkQitSsb3rl5xTlFgCgmdK+iy0nrUhCJl+nj6QgOJlu kS0AnjlAt/g03QoXjjwADTxto50pcPy1 =MlMb -----END PGP SIGNATURE----- --------------enigFB6B4D272E59EF908C23AD98--