qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: mrhines@linux.vnet.ibm.com
To: qemu-devel@nongnu.org
Cc: hinesmr@cn.ibm.com, "Michael R. Hines" <mrhines@us.ibm.com>,
	quintela@redhat.com
Subject: [Qemu-devel] [RFC PATCH v1 3/3] provenance: expose the serialization save/load functions for migration
Date: Tue, 18 Feb 2014 13:53:22 +0800	[thread overview]
Message-ID: <1392702802-11592-4-git-send-email-mrhines@linux.vnet.ibm.com> (raw)
In-Reply-To: <1392702802-11592-1-git-send-email-mrhines@linux.vnet.ibm.com>

From: "Michael R. Hines" <mrhines@us.ibm.com>

Expose the prototypes of the serialization code and register the
save/load functions during QEMU startup so that they can take effect.

Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
---
 include/migration/migration.h | 8 ++++++++
 vl.c                          | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/include/migration/migration.h b/include/migration/migration.h
index 3e1e6c7..b5d4e6f 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -53,6 +53,7 @@ struct MigrationState
     int state;
     MigrationParams params;
     double mbps;
+    int64_t start_time;
     int64_t total_time;
     int64_t downtime;
     int64_t expected_downtime;
@@ -61,6 +62,8 @@ struct MigrationState
     bool enabled_capabilities[MIGRATION_CAPABILITY_MAX];
     int64_t xbzrle_cache_size;
     int64_t setup_time;
+    MigrationInfo *last_info;
+    bool migrated_before;
 };
 
 void process_incoming_migration(QEMUFile *f);
@@ -174,4 +177,9 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset,
                              ram_addr_t offset, size_t size,
                              int *bytes_sent);
 
+#define STATS_VERSION 1
+
+int migrate_info_load(QEMUFile *f, void *opaque, int version_id);
+void migrate_info_save(QEMUFile *f, void *opaque);
+
 #endif
diff --git a/vl.c b/vl.c
index 316de54..b9f3661 100644
--- a/vl.c
+++ b/vl.c
@@ -4138,6 +4138,8 @@ int main(int argc, char **argv, char **envp)
     default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS);
 
     register_savevm_live(NULL, "ram", 0, 4, &savevm_ram_handlers, NULL);
+    register_savevm(NULL, "info", -1, STATS_VERSION, migrate_info_save,
+                        migrate_info_load, NULL);
 
     if (nb_numa_nodes > 0) {
         int i;
-- 
1.8.1.2

  parent reply	other threads:[~2014-02-18  5:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18  5:53 [Qemu-devel] [RFC PATCH v1 0/3] provenance: save migration stats after completion to destination mrhines
2014-02-18  5:53 ` [Qemu-devel] [RFC PATCH v1 1/3] provenance: QMP command to store MigrationInfo from JSON mrhines
2014-02-18  5:53 ` [Qemu-devel] [RFC PATCH v1 2/3] provenance: serialize MigrationInfo across the wire mrhines
2014-02-18  5:53 ` mrhines [this message]
2014-02-18 13:40 ` [Qemu-devel] [RFC PATCH v1 0/3] provenance: save migration stats after completion to destination Eric Blake
2014-02-19  2:30   ` Michael R. Hines
2014-02-19  2:40     ` Eric Blake
2014-02-19  4:22       ` Michael R. Hines

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=1392702802-11592-4-git-send-email-mrhines@linux.vnet.ibm.com \
    --to=mrhines@linux.vnet.ibm.com \
    --cc=hinesmr@cn.ibm.com \
    --cc=mrhines@us.ibm.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).