From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpny2-0005h4-1s for qemu-devel@nongnu.org; Tue, 24 Jan 2012 16:31:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rpny0-0005ia-8N for qemu-devel@nongnu.org; Tue, 24 Jan 2012 16:31:50 -0500 Message-ID: <4F1F233B.8040804@web.de> Date: Tue, 24 Jan 2012 22:31:39 +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> In-Reply-To: <4F1F1E91.50609@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6A890F28C9926D83392AC545" 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: Anthony Liguori Cc: Peter Maydell , Anthony Liguori , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Alexander Graf , 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) --------------enig6A890F28C9926D83392AC545 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2012-01-24 22:11, Anthony Liguori wrote: > On 01/24/2012 03:01 PM, Jan Kiszka wrote: >> On 2012-01-24 21:21, Anthony Liguori wrote: >>>> Also, I see a lot of programmatic initialization and a lot of repeat= ing >>>> patterns (specifically regarding trivial class initialization) - the= re >>>> is no better alternative? >>> >>> Not really, no. It looks bad now because you have DeviceInfo still. >>> Once DeviceInfo goes away, all of the initialization will happen in t= he >>> class_init function. >>> >>> The design of QOM is such that a lot of what was previously done via >>> declarative structures is now done imperatively. But the code bloat >>> that came in this patch series will decrease significantly with the n= ext >>> series as we eliminate DeviceInfo. >> >> Are there examples of fully converted devices to get an impression? >=20 > https://github.com/aliguori/qemu/tree/qom-rebase.8 >=20 > Has everything fully converted (including BusState). >=20 > If you look at qdev.[ch], you'll notice the remaining qdev > infrastructure becomes greatly simplified. But I don't get yet why all these repeating initialization tasks need to be open-coded instead of remaining declarative. Why can't a generic class init handler of TYPE_DEVICE not copy over all relevant fields from a, say, DeviceTypeInfo super-struct? And a sysbus class init handler could do the same from SysBusTypeInfo. That way you could define your device class again in a single struct instead of multiple ones + the init handler. If there are special needs, that handler would still be there. Jan --------------enig6A890F28C9926D83392AC545 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/ iEYEARECAAYFAk8fIz4ACgkQitSsb3rl5xQPSwCfQtWALM+XilOzTXZudt0WgMER nswAnRUAcCQIk54GIce7uVhr3Zfg6epO =tOJk -----END PGP SIGNATURE----- --------------enig6A890F28C9926D83392AC545--