From a2d07731e7e2f1462e90f9d0a7eaf9e39da29eb0 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 22 Jan 2020 18:55:02 +0100 Subject: [PATCH] migration: Add support for modules So we don't have to compile everything in, or have ifdefs Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- include/qemu/module.h | 2 ++ softmmu/vl.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/qemu/module.h b/include/qemu/module.h index 684753d808..011ae1ae76 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -40,6 +40,7 @@ static void __attribute__((constructor)) do_qemu_init_ ## function(void) \ #endif typedef enum { + MODULE_INIT_MIGRATION, MODULE_INIT_BLOCK, MODULE_INIT_OPTS, MODULE_INIT_QOM, @@ -59,6 +60,7 @@ typedef enum { #define libqos_init(function) module_init(function, MODULE_INIT_LIBQOS) #define fuzz_target_init(function) module_init(function, \ MODULE_INIT_FUZZ_TARGET) +#define migration_init(function) module_init(function, MODULE_INIT_MIGRATION) #define block_module_load_one(lib) module_load_one("block-", lib) #define ui_module_load_one(lib) module_load_one("ui-", lib) #define audio_module_load_one(lib) module_load_one("audio-", lib) diff --git a/softmmu/vl.c b/softmmu/vl.c index 16ff5a16a3..705ee6f841 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2858,6 +2858,7 @@ void qemu_init(int argc, char **argv, char **envp) qemu_init_exec_dir(argv[0]); module_call_init(MODULE_INIT_QOM); + module_call_init(MODULE_INIT_MIGRATION); qemu_add_opts(&qemu_drive_opts); qemu_add_drive_opts(&qemu_legacy_drive_opts);