From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZToH-0004JW-MK for qemu-devel@nongnu.org; Tue, 17 Feb 2009 12:32:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZToF-0004Ii-Li for qemu-devel@nongnu.org; Tue, 17 Feb 2009 12:32:40 -0500 Received: from [199.232.76.173] (port=35880 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZToF-0004If-FC for qemu-devel@nongnu.org; Tue, 17 Feb 2009 12:32:39 -0500 Received: from mx20.gnu.org ([199.232.41.8]:4643) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LZToF-0008Ss-5c for qemu-devel@nongnu.org; Tue, 17 Feb 2009 12:32:39 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LZToC-0004Eo-Vw for qemu-devel@nongnu.org; Tue, 17 Feb 2009 12:32:37 -0500 From: Paul Brook Subject: Re: [Qemu-devel] Machine description as data prototype, take 2 (was: [RFC] Machine description as data) Date: Tue, 17 Feb 2009 17:32:29 +0000 References: <87iqnh6kyv.fsf@pike.pond.sub.org> <87zlgmwdut.fsf@pike.pond.sub.org> In-Reply-To: <87zlgmwdut.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200902171732.29531.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Markus Armbruster On Monday 16 February 2009, Markus Armbruster wrote: > + =A0 =A0{ "vga", sizeof(struct dt_device_vga), dt_vga_props, > + =A0 =A0 =A0dt_vga_config, dt_vga_init, NULL }, > + =A0 =A0{ "nic", sizeof(struct dt_device_nic), dt_nic_props, > + =A0 =A0 =A0dt_nic_config, dt_nic_init, NULL }, I think this is doing things the wrong way. We shouldn't have a "nic" devic= e=20 that mutates into one of several devices based on magic options. Instead ea= ch=20 nic/display adapter/HBA should be registered, and we instantiate those=20 directly. For devices that have a common set of properties (e.g. nics) it=20 probably makes sense to have common helper functions. It should be possible= =20 to have a single device that is (say) both a SCSI HBA and a NIC. Paul