|
|
9ae3a8 |
From 86303381279f7c0e9d98693496d888801a503148 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 8 May 2014 10:58:40 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 05/31] Provide init function for ram migration
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1399546722-6350-3-git-send-email-dgilbert@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 58742
|
|
|
9ae3a8 |
O-Subject: [RHEL7.1/RHEL7.0.z qemu-kvm PATCH 2/4] Provide init function for ram migration
|
|
|
9ae3a8 |
Bugzilla: 1066338
|
|
|
9ae3a8 |
RH-Acked-by: Juan Quintela <quintela@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Provide ram_mig_init (like blk_mig_init) for vl.c to initialise stuff
|
|
|
9ae3a8 |
to do with ram migration (currently in arch_init.c).
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
|
|
|
9ae3a8 |
Reviewed-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 0d6ab3ab9149767eba192ec5ad659fd34e55a291)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
arch_init.c | 7 ++++++-
|
|
|
9ae3a8 |
include/migration/migration.h | 2 --
|
|
|
9ae3a8 |
include/sysemu/arch_init.h | 1 +
|
|
|
9ae3a8 |
vl.c | 3 +--
|
|
|
9ae3a8 |
4 files changed, 8 insertions(+), 5 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
arch_init.c | 7 ++++++-
|
|
|
9ae3a8 |
include/migration/migration.h | 2 --
|
|
|
9ae3a8 |
include/sysemu/arch_init.h | 1 +
|
|
|
9ae3a8 |
vl.c | 3 +--
|
|
|
9ae3a8 |
4 files changed, 8 insertions(+), 5 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/arch_init.c b/arch_init.c
|
|
|
9ae3a8 |
index 8641afa..37c9f6d 100644
|
|
|
9ae3a8 |
--- a/arch_init.c
|
|
|
9ae3a8 |
+++ b/arch_init.c
|
|
|
9ae3a8 |
@@ -1099,7 +1099,7 @@ done:
|
|
|
9ae3a8 |
return ret;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-SaveVMHandlers savevm_ram_handlers = {
|
|
|
9ae3a8 |
+static SaveVMHandlers savevm_ram_handlers = {
|
|
|
9ae3a8 |
.save_live_setup = ram_save_setup,
|
|
|
9ae3a8 |
.save_live_iterate = ram_save_iterate,
|
|
|
9ae3a8 |
.save_live_complete = ram_save_complete,
|
|
|
9ae3a8 |
@@ -1108,6 +1108,11 @@ SaveVMHandlers savevm_ram_handlers = {
|
|
|
9ae3a8 |
.cancel = ram_migration_cancel,
|
|
|
9ae3a8 |
};
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+void ram_mig_init(void)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL);
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
struct soundhw {
|
|
|
9ae3a8 |
const char *name;
|
|
|
9ae3a8 |
const char *descr;
|
|
|
9ae3a8 |
diff --git a/include/migration/migration.h b/include/migration/migration.h
|
|
|
9ae3a8 |
index 9314511..c99a67c 100644
|
|
|
9ae3a8 |
--- a/include/migration/migration.h
|
|
|
9ae3a8 |
+++ b/include/migration/migration.h
|
|
|
9ae3a8 |
@@ -102,8 +102,6 @@ void free_xbzrle_decoded_buf(void);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
void acct_update_position(QEMUFile *f, size_t size, bool zero);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-extern SaveVMHandlers savevm_ram_handlers;
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
uint64_t dup_mig_bytes_transferred(void);
|
|
|
9ae3a8 |
uint64_t dup_mig_pages_transferred(void);
|
|
|
9ae3a8 |
uint64_t skipped_mig_bytes_transferred(void);
|
|
|
9ae3a8 |
diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h
|
|
|
9ae3a8 |
index be71bca..182d48d 100644
|
|
|
9ae3a8 |
--- a/include/sysemu/arch_init.h
|
|
|
9ae3a8 |
+++ b/include/sysemu/arch_init.h
|
|
|
9ae3a8 |
@@ -29,6 +29,7 @@ extern const uint32_t arch_type;
|
|
|
9ae3a8 |
void select_soundhw(const char *optarg);
|
|
|
9ae3a8 |
void do_acpitable_option(const QemuOpts *opts);
|
|
|
9ae3a8 |
void do_smbios_option(QemuOpts *opts);
|
|
|
9ae3a8 |
+void ram_mig_init(void);
|
|
|
9ae3a8 |
void cpudef_init(void);
|
|
|
9ae3a8 |
void audio_init(void);
|
|
|
9ae3a8 |
int tcg_available(void);
|
|
|
9ae3a8 |
diff --git a/vl.c b/vl.c
|
|
|
9ae3a8 |
index 51300e7..6ff06cc 100644
|
|
|
9ae3a8 |
--- a/vl.c
|
|
|
9ae3a8 |
+++ b/vl.c
|
|
|
9ae3a8 |
@@ -4133,6 +4133,7 @@ int main(int argc, char **argv, char **envp)
|
|
|
9ae3a8 |
cpu_exec_init_all();
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
blk_mig_init();
|
|
|
9ae3a8 |
+ ram_mig_init();
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* open the virtual block devices */
|
|
|
9ae3a8 |
if (snapshot)
|
|
|
9ae3a8 |
@@ -4147,8 +4148,6 @@ int main(int argc, char **argv, char **envp)
|
|
|
9ae3a8 |
default_drive(default_floppy, snapshot, IF_FLOPPY, 0, FD_OPTS);
|
|
|
9ae3a8 |
default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL);
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
if (nb_numa_nodes > 0) {
|
|
|
9ae3a8 |
int i;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|