mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Fix module initialization when more than 1 class is in use
Now that we're using enums for module types, it makes no sense to bother keeping a list of module types when we know exactly how many they are. Switching to an array simplifies the code and eliminates the aforementioned bug. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
4af396115a
commit
f789743095
2 changed files with 31 additions and 41 deletions
5
module.h
5
module.h
|
@ -17,12 +17,13 @@
|
|||
/* 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); \
|
||||
register_module_init(function, type); \
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
MODULE_INIT_BLOCK,
|
||||
MODULE_INIT_DEVICE
|
||||
MODULE_INIT_DEVICE,
|
||||
MODULE_INIT_MAX
|
||||
} module_init_type;
|
||||
|
||||
#define block_init(function) module_init(function, MODULE_INIT_BLOCK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue