From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3YBJ-0005Ra-1O for qemu-devel@nongnu.org; Mon, 11 May 2009 12:16:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3YBD-0005Oa-EV for qemu-devel@nongnu.org; Mon, 11 May 2009 12:16:43 -0400 Received: from [199.232.76.173] (port=47805 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3YBD-0005OD-3M for qemu-devel@nongnu.org; Mon, 11 May 2009 12:16:39 -0400 Received: from mx20.gnu.org ([199.232.41.8]:59314) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M3YBC-0006Iy-TH for qemu-devel@nongnu.org; Mon, 11 May 2009 12:16:39 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3YBB-0001Mv-PG for qemu-devel@nongnu.org; Mon, 11 May 2009 12:16:38 -0400 From: Paul Brook Date: Mon, 11 May 2009 17:16:35 +0100 References: <1242052009-27339-1-git-send-email-aliguori@us.ibm.com> <200905111548.48216.paul@codesourcery.com> <4A084CD2.7070108@us.ibm.com> In-Reply-To: <4A084CD2.7070108@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905111716.35553.paul@codesourcery.com> Subject: [Qemu-devel] Re: [PATCH 0/4][RFC] Add module infrastructure to QEMU List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org On Monday 11 May 2009, Anthony Liguori wrote: > Paul Brook wrote: > > On Monday 11 May 2009, Anthony Liguori wrote: > >> This is the current state of a patch set to introduce a module > >> infrastructure to QEMU. > > > > I don't think numeric priorities are a good idea. If we have dependencies > > then we should be dealing with them properly, not hacking round the > > problem. > > The numeric priorities are an implementation detail. No one should ever > consume module_init() directly and I should add appropriately scary > comments to that affect. Having looked a bit deeper, you're not actually implementing priorities. You're implementing different categories of init function. So this should be an enum, and be renames to something less confusing. > We do have dependencies. I'd like virtio to be a module, and I'd like > virtio-net, virtio-blk, etc. to be modules. This gets exposed as > virtio.c being a bus_init() and virtio-*.c being virtio_init(). We use > the integer priorities in module.h to express this. I'm not convinced virtio is as much of a separate entity as you think it is. It's certainly not a bus. It's an implementation detail that happens to be shared by several devices. Paul