qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Question about module load


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] Question about module load
Date: Mon, 16 Dec 2013 16:50:25 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Dec 16, 2013 at 02:44:19PM +0900, Choonho Son wrote:
> I cannot understand QEMU iniitialization.
> Before starting main function(address@hidden), how modules are loaded?
> 
> Since module are already loaded in module_call_init(MODULE_INIT_QOM);

Look at the source:

/* This should not be used directly.  Use block_init etc. instead.  */
#define module_init(function, type)                                         \
static void __attribute__((constructor)) do_qemu_init_ ## function(void) {  \
    register_module_init(function, type);                                   \
}

The __attribute__((constructor)) means the function gets invoked by the
runtime during startup (before main() is executed).

Check the gcc documentation for a detailed explanation:
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Stefan



reply via email to

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