qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 2/2] rbd: link and load librbd dynamically


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 2/2] rbd: link and load librbd dynamically
Date: Wed, 10 Apr 2013 23:19:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

Il 10/04/2013 17:08, Anthony Liguori ha scritto:
> /* This should not be used directly.  Use block_init etc. instead.  */
> #ifdef CONFIG_MODULE
> #define module_init(function, type)              \
> const gchar *g_module_check_init(GModule *module)  \
> {                                                \
>     register_module_init(function, type);        \
>     return NULL;                                 \
> }
> #else
> #define module_init(function, type)                                         \
> static void __attribute__((constructor)) do_qemu_init_ ## function(void) {  \
>     register_module_init(function, type);                                   \
> }
> #endif

Not even that is needed.  Modules can have constructor functions that
use symbols in the main executable.

Basically, modules would be opened with G_MODULE_BIND_LOCAL and
communicate with QEMU via constructor functions only (registering driver
modules or QOM types).

It is really more of a build-system hacking project than anything else.

Paolo

> We then also need a way to load modules prior to calling init using the
> GModule interfaces.  Easiest thing to do is just load all .so's in a
> single directory (/usr/lib/qemu/modules/*.so?) prior to calling any
> module init functions.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]