From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3WTE-00011g-RV for qemu-devel@nongnu.org; Mon, 11 May 2009 10:27:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3WTA-0000zB-RM for qemu-devel@nongnu.org; Mon, 11 May 2009 10:27:08 -0400 Received: from [199.232.76.173] (port=59244 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3WTA-0000z2-Mm for qemu-devel@nongnu.org; Mon, 11 May 2009 10:27:04 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:33562) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M3WTA-00055L-9R for qemu-devel@nongnu.org; Mon, 11 May 2009 10:27:04 -0400 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e31.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4BENJ4R003830 for ; Mon, 11 May 2009 08:23:19 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4BEQsSW068642 for ; Mon, 11 May 2009 08:26:55 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4BEQoaj008222 for ; Mon, 11 May 2009 08:26:50 -0600 From: Anthony Liguori Date: Mon, 11 May 2009 09:26:45 -0500 Message-Id: <1242052009-27339-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [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: qemu-devel@nongnu.org Cc: Anthony Liguori , Paul Brook This is the current state of a patch set to introduce a module infrastructure to QEMU. It depends on GCC constructors and GNU ld's --whole-archive. The dependency on GNU ld's --whole-archive is a problem, but it can be addressed in a number of ways: 1) Avoid creating a shared archive and just use object files. I see no real downside to this except that we're just ignoring this problem. 2) Switch to using dynamic shared libraries. This has the benefit of reducing the QEMU install size. This is attractive except for the fact that creating dynamic shared libraries across multiple host architectures is a pain. 3) For platforms that don't use GNU ld (Solaris, AIX, ???), add platform specific equivalents. For instance, -z allextract should work for Solaris. I'm leaning toward #3 as I think it's a reasonable compromise. This patch series introduces a number of other concepts though beyond constructors. It decentralizes the block driver code and moves it to a separate subdirectory. It also introduces also decentralizes the Makefile for the block drivers. Finally, it allows for a config file to be used during build time to selectively choose what block drivers are compiled in. This is done in a fashion similar to how the Linux kernel's build system works. There are a number of reasons to allow this level of build customization. One reason is that it makes per-platform support more understandable. Instead of having #ifdefs all through the code, you have a central place to disable features for particular platforms. It also has the advantage of allowing an individual to build a minimal version of QEMU to support a particular type of machine with a particular set of functionality. This is useful for embedded environments and for security sensitive environments. I have additional patches that split up qemu-char.c and introduce a similar structure there but they are not quite ready yet.