summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-05-14 17:57:31 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-14 18:06:49 -0500
commitf7897430950ee94fb2dc4d6a5ca658d4909d9d85 (patch)
tree9d94be3c723a473f529074becb19cad654664ca7 /module.h
parentSyborg (Symbian Virtual Platform) board (diff)
downloadqemu-kvm-f7897430950ee94fb2dc4d6a5ca658d4909d9d85.tar.gz
qemu-kvm-f7897430950ee94fb2dc4d6a5ca658d4909d9d85.tar.bz2
qemu-kvm-f7897430950ee94fb2dc4d6a5ca658d4909d9d85.zip
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>
Diffstat (limited to 'module.h')
-rw-r--r--module.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/module.h b/module.h
index cd368b1a9..903c95b5d 100644
--- a/module.h
+++ b/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)