aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch_init.c7
-rw-r--r--include/migration/migration.h2
-rw-r--r--include/sysemu/arch_init.h1
-rw-r--r--vl.c3
4 files changed, 8 insertions, 5 deletions
diff --git a/arch_init.c b/arch_init.c
index 0c8c07d6ba..aeebb8ecb2 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -1108,7 +1108,7 @@ done:
return ret;
}
-SaveVMHandlers savevm_ram_handlers = {
+static SaveVMHandlers savevm_ram_handlers = {
.save_live_setup = ram_save_setup,
.save_live_iterate = ram_save_iterate,
.save_live_complete = ram_save_complete,
@@ -1117,6 +1117,11 @@ SaveVMHandlers savevm_ram_handlers = {
.cancel = ram_migration_cancel,
};
+void ram_mig_init(void)
+{
+ register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL);
+}
+
struct soundhw {
const char *name;
const char *descr;
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 3e1e6c72bf..31fbf174d2 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -113,8 +113,6 @@ void free_xbzrle_decoded_buf(void);
void acct_update_position(QEMUFile *f, size_t size, bool zero);
-extern SaveVMHandlers savevm_ram_handlers;
-
uint64_t dup_mig_bytes_transferred(void);
uint64_t dup_mig_pages_transferred(void);
uint64_t skipped_mig_bytes_transferred(void);
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
index be71bcac2d..182d48d8c3 100644
--- a/include/sysemu/arch_init.h
+++ b/include/sysemu/arch_init.h
@@ -29,6 +29,7 @@ extern const uint32_t arch_type;
void select_soundhw(const char *optarg);
void do_acpitable_option(const QemuOpts *opts);
void do_smbios_option(QemuOpts *opts);
+void ram_mig_init(void);
void cpudef_init(void);
void audio_init(void);
int tcg_available(void);
diff --git a/vl.c b/vl.c
index 236f95efd7..8411a4a08a 100644
--- a/vl.c
+++ b/vl.c
@@ -4306,6 +4306,7 @@ int main(int argc, char **argv, char **envp)
cpu_exec_init_all();
blk_mig_init();
+ ram_mig_init();
/* open the virtual block devices */
if (snapshot)
@@ -4320,8 +4321,6 @@ int main(int argc, char **argv, char **envp)
default_drive(default_floppy, snapshot, IF_FLOPPY, 0, FD_OPTS);
default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS);
- register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL);
-
if (nb_numa_nodes > 0) {
int i;