Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Paolo Bonzini
Il 11/09/2013 07:38, Fam Zheng ha scritto: Added three types of modules: typedef enum { MODULE_LOAD_BLOCK = 0, MODULE_LOAD_UI, MODULE_LOAD_NET, MODULE_LOAD_MAX, } module_load_type; If you want to make spice into a module, you probably need also

Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Peter Maydell
On 11 September 2013 06:38, Fam Zheng f...@redhat.com wrote: --- a/linux-user/main.c +++ b/linux-user/main.c @@ -34,6 +34,7 @@ #include qemu/timer.h #include qemu/envlist.h #include elf.h +#include qemu/module.h char *exec_path; @@ -3551,6 +3552,8 @@ int main(int argc, char **argv,

Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Paolo Bonzini
Il 11/09/2013 16:10, Alex Bligh ha scritto: --On 11 September 2013 13:38:27 +0800 Fam Zheng f...@redhat.com wrote: +switch (type) { +case MODULE_LOAD_BLOCK: +path = CONFIG_PREFIX /qemu/block/; +break; +case MODULE_LOAD_UI: +path = CONFIG_PREFIX

Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Alex Bligh
--On 11 September 2013 13:38:27 +0800 Fam Zheng f...@redhat.com wrote: +switch (type) { +case MODULE_LOAD_BLOCK: +path = CONFIG_PREFIX /qemu/block/; +break; +case MODULE_LOAD_UI: +path = CONFIG_PREFIX /qemu/ui/; +break; +case MODULE_LOAD_NET: +

Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Richard Henderson
On 09/11/2013 07:10 AM, Alex Bligh wrote: --On 11 September 2013 13:38:27 +0800 Fam Zheng f...@redhat.com wrote: +switch (type) { +case MODULE_LOAD_BLOCK: +path = CONFIG_PREFIX /qemu/block/; +break; +case MODULE_LOAD_UI: +path = CONFIG_PREFIX

Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Alex Bligh
--On 11 September 2013 08:06:20 -0700 Richard Henderson r...@twiddle.net wrote: If we want dependencies between modules, we may well need to get the dynamic linker involved with the search directory. This would rule out any command-line, or monitor-line altering of the path. But it does

Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Richard Henderson
On 09/11/2013 08:23 AM, Alex Bligh wrote: But it does suggest the default being DT_RUNPATH, overridable near the command-line via LD_RUN_PATH. Not quite sure what you are suggesting here. DT_RUNPATH is an elf tag IIRC. Not sure what LD_RUN_PATH does. LD_LIBRARY_PATH affects more than just

Re: [Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-11 Thread Fam Zheng
On Wed, 09/11 15:24, Peter Maydell wrote: On 11 September 2013 06:38, Fam Zheng f...@redhat.com wrote: --- a/linux-user/main.c +++ b/linux-user/main.c @@ -34,6 +34,7 @@ #include qemu/timer.h #include qemu/envlist.h #include elf.h +#include qemu/module.h char *exec_path;

[Qemu-devel] [RFC PATCH v5 4/6] module: implement module loading function

2013-09-10 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