Patchwork [05/15] qapi: add QAPI module type

login
register
mail settings
Submitter Anthony Liguori
Date March 11, 2011, 11:05 p.m.
Message ID <1299884745-521-6-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/86465/
State New
Headers show

Comments

Anthony Liguori - March 11, 2011, 11:05 p.m.
This lets us register marshaling handlers using a module init function.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Patch

diff --git a/module.h b/module.h
index 9263f1c..ef66730 100644
--- a/module.h
+++ b/module.h
@@ -24,12 +24,14 @@  typedef enum {
     MODULE_INIT_BLOCK,
     MODULE_INIT_DEVICE,
     MODULE_INIT_MACHINE,
+    MODULE_INIT_QAPI,
     MODULE_INIT_MAX
 } module_init_type;
 
 #define block_init(function) module_init(function, MODULE_INIT_BLOCK)
 #define device_init(function) module_init(function, MODULE_INIT_DEVICE)
 #define machine_init(function) module_init(function, MODULE_INIT_MACHINE)
+#define qapi_init(function) module_init(function, MODULE_INIT_QAPI)
 
 void register_module_init(void (*fn)(void), module_init_type type);
 
diff --git a/vl.c b/vl.c
index 5e007a7..d27e750 100644
--- a/vl.c
+++ b/vl.c
@@ -1962,6 +1962,8 @@  int main(int argc, char **argv, char **envp)
     cyls = heads = secs = 0;
     translation = BIOS_ATA_TRANSLATION_AUTO;
 
+    module_call_init(MODULE_INIT_QAPI);
+
     for (i = 0; i < MAX_NODES; i++) {
         node_mem[i] = 0;
         node_cpumask[i] = 0;