Received: from eggs.gnu.org ([2001:4830:134:3::10]:60297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLoxy-0002mg-BF for qemu-devel@nongnu.org; Tue, 17 Sep 2013 02:41:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLoxr-0007OU-RD for qemu-devel@nongnu.org; Tue, 17 Sep 2013 02:40:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLoxr-0007OO-JI for qemu-devel@nongnu.org; Tue, 17 Sep 2013 02:40:47 -0400 Date: Tue, 17 Sep 2013 14:40:36 +0800 From: Fam Zheng Message-ID: <20130917064036.GA26593@T430s.nay.redhat.com> References: <1379314227-8855-1-git-send-email-famz@redhat.com> <1379314227-8855-6-git-send-email-famz@redhat.com> <20130916110536.GL6005@redhat.com> <1379334978.28744.8.camel@nilsson.home.kraxel.org> <20130917055515.GA15955@T430s.nay.redhat.com> <86A5701C-082D-4EB8-ACBC-407716EBC374@alex.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86A5701C-082D-4EB8-ACBC-407716EBC374@alex.org.uk> Subject: Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: peter.maydell@linaro.org, mjt@tls.msk.ru, qemu-devel@nongnu.org, Gerd Hoffmann , pbonzini@redhat.com, vilanova@ac.upc.edu, rth@twiddle.net On Tue, 09/17 07:33, Alex Bligh wrote: > > On 17 Sep 2013, at 06:55, Fam Zheng wrote: > > >>> > >>> I think I'd just have one flat list > >>> of modules to load and ditch these MODULE_LOAD_XXXX enums. > >> > >> Question is how to deal with qemu vs. qemu-img then. qemu needs > >> everything and qemu-img needs the block drivers only (and loading > >> something else probably doesn't work due to unresolved symbols). > >> > > > > With lazy symbol binding (G_MODULE_BIND_LAZY), we can just load all the > > modules, and wait for subsystem to call module_call_init(MODULE_INIT_*), where > > the symbols are resolved. As qemu-img.c doesn't init ui, net, it's not a > > problem to load them ahead. > > Why not have one list per executable you build? You know at compile > time what modules each executable could load. This seems better > than putting the logic in and run time and having different types > of modules etc. > > One reason to avoid qemu-img (for instance) loading everything (if > it's present) is init time. I agree dlopen()'ing something that > never gets called should not eat too much RAM but it seems pointless. > OK, good point. Fam