From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: arei.gonglei@huawei.com, armbru@redhat.com, quintela@redhat.com
Subject: [Qemu-devel] [PATCH v2 1/2] Provide init function for ram migration
Date: Wed, 19 Mar 2014 18:32:30 +0000 [thread overview]
Message-ID: <1395253951-14524-2-git-send-email-dgilbert@redhat.com> (raw)
In-Reply-To: <1395253951-14524-1-git-send-email-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Provide ram_mig_init (like blk_mig_init) for vl.c to initialise stuff
to do with ram migration (currently in arch_init.c).
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
arch_init.c | 7 ++++++-
include/migration/migration.h | 2 --
include/sysemu/arch_init.h | 1 +
vl.c | 3 +--
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 60c975d..0d2bf84 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -1095,7 +1095,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,
@@ -1104,6 +1104,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 3e1e6c7..31fbf17 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 be71bca..182d48d 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 f0fe48b..3358c98 100644
--- a/vl.c
+++ b/vl.c
@@ -4274,6 +4274,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)
@@ -4288,8 +4289,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;
--
1.8.5.3
next prev parent reply other threads:[~2014-03-19 18:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-19 18:32 [Qemu-devel] [PATCH v2 0/2] Stop reinit of XBZRLE.lock Dr. David Alan Gilbert (git)
2014-03-19 18:32 ` Dr. David Alan Gilbert (git) [this message]
2014-03-20 12:42 ` [Qemu-devel] [PATCH v2 1/2] Provide init function for ram migration Gonglei (Arei)
2014-03-19 18:32 ` [Qemu-devel] [PATCH v2 2/2] Init the XBZRLE.lock in ram_mig_init Dr. David Alan Gilbert (git)
2014-03-20 12:43 ` Gonglei (Arei)
2014-03-20 7:18 ` [Qemu-devel] [PATCH v2 0/2] Stop reinit of XBZRLE.lock Markus Armbruster
2014-03-20 12:56 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395253951-14524-2-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).