Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-12 Thread Daniel P. Berrange
On Thu, Sep 12, 2013 at 05:59:30AM -0600, Eric Blake wrote: > On 09/11/2013 11:36 PM, Michael Tokarev wrote: > > > > A solution which I proposed at the very beginning -- to export > > a "hashed" init function from modules, and call it from the > > main executable. Like, instead of, say, qemu_modu

Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-12 Thread Eric Blake
On 09/11/2013 11:36 PM, Michael Tokarev wrote: > > A solution which I proposed at the very beginning -- to export > a "hashed" init function from modules, and call it from the > main executable. Like, instead of, say, qemu_module_init(), > call qemu_module_init_0xdeadbeaf(), where 0xdeadbeaf is a

Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-12 Thread Daniel P. Berrange
On Thu, Sep 12, 2013 at 09:36:43AM +0400, Michael Tokarev wrote: > 12.09.2013 07:02, Fam Zheng wrote. > >On Wed, 09/11 11:46, Richard Henderson wrote: > >>On 09/11/2013 08:48 AM, Daniel P. Berrange wrote: > >>>We know the precise list of valid modules when building QEMU, > >>>so IMHO, this should j

Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-11 Thread Michael Tokarev
12.09.2013 07:02, Fam Zheng wrote. On Wed, 09/11 11:46, Richard Henderson wrote: On 09/11/2013 08:48 AM, Daniel P. Berrange wrote: We know the precise list of valid modules when building QEMU, so IMHO, this should just explicitly load each known module name, and *not* readdir. Also it should do

Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-11 Thread Fam Zheng
On Wed, 09/11 11:46, Richard Henderson wrote: > On 09/11/2013 08:48 AM, Daniel P. Berrange wrote: > > We know the precise list of valid modules when building QEMU, > > so IMHO, this should just explicitly load each known module > > name, and *not* readdir. Also it should do something along the > >

Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-11 Thread Richard Henderson
On 09/11/2013 08:48 AM, Daniel P. Berrange wrote: > We know the precise list of valid modules when building QEMU, > so IMHO, this should just explicitly load each known module > name, and *not* readdir. Also it should do something along the > lines suggested their of poisoning exported symbols with

Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-11 Thread Alex Bligh
--On 11 September 2013 16:48:41 +0100 "Daniel P. Berrange" wrote: We know the precise list of valid modules when building QEMU, so IMHO, this should just explicitly load each known module name, and *not* readdir. Also it should do something along the lines suggested their of poisoning expor

Re: [Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-11 Thread Daniel P. Berrange
On Wed, Sep 11, 2013 at 09:34:04PM +0800, Fam Zheng wrote: > Added three types of modules: > > typedef enum { > MODULE_LOAD_BLOCK = 0, > MODULE_LOAD_UI, > MODULE_LOAD_NET, > MODULE_LOAD_MAX, > } module_load_type; > > and their loading function: > > voi

[Qemu-devel] [PATCH v6 4/8] module: implement module loading function

2013-09-11 Thread Fam Zheng
Added three types of modules: typedef enum { MODULE_LOAD_BLOCK = 0, MODULE_LOAD_UI, MODULE_LOAD_NET, MODULE_LOAD_MAX, } module_load_type; and their loading function: void module_load(module_load_type). which loads all ".so" files in a subdir under "${