summaryrefslogtreecommitdiff
path: root/include/migration
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2015-06-11 18:17:23 +0100
committerJuan Quintela <quintela@redhat.com>2015-07-07 14:54:48 +0200
commit632e3a5cd812d6bbd38fd2f3ffc189ff5ea51926 (patch)
tree2a6c855e5db41e88b4df8e20524c33be4a8adeff /include/migration
parentb12f7777981953b7d939496283014740bdd6de64 (diff)
downloadqemu-632e3a5cd812d6bbd38fd2f3ffc189ff5ea51926.tar.gz
qemu-632e3a5cd812d6bbd38fd2f3ffc189ff5ea51926.tar.bz2
qemu-632e3a5cd812d6bbd38fd2f3ffc189ff5ea51926.zip
Rework ram_control_load_hook to hook during block load
We need the names of RAMBlocks as they're loaded for RDMA, reuse a slightly modified ram_control_load_hook: a) Pass a 'data' parameter to use for the name in the block-reg case b) Only some hook types now require the presence of a hook function. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/migration')
-rw-r--r--include/migration/migration.h2
-rw-r--r--include/migration/qemu-file.h14
2 files changed, 10 insertions, 6 deletions
diff --git a/include/migration/migration.h b/include/migration/migration.h
index 9387c8c9d4..afba2335e3 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -179,7 +179,7 @@ int migrate_decompress_threads(void);
void ram_control_before_iterate(QEMUFile *f, uint64_t flags);
void ram_control_after_iterate(QEMUFile *f, uint64_t flags);
-void ram_control_load_hook(QEMUFile *f, uint64_t flags);
+void ram_control_load_hook(QEMUFile *f, uint64_t flags, void *data);
/* Whenever this is found in the data stream, the flags
* will be passed to ram_control_load_hook in the incoming-migration
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h
index 4f67d79227..ea49f33fac 100644
--- a/include/migration/qemu-file.h
+++ b/include/migration/qemu-file.h
@@ -63,16 +63,20 @@ typedef ssize_t (QEMUFileWritevBufferFunc)(void *opaque, struct iovec *iov,
/*
* This function provides hooks around different
* stages of RAM migration.
+ * 'opaque' is the backend specific data in QEMUFile
+ * 'data' is call specific data associated with the 'flags' value
*/
-typedef int (QEMURamHookFunc)(QEMUFile *f, void *opaque, uint64_t flags);
+typedef int (QEMURamHookFunc)(QEMUFile *f, void *opaque, uint64_t flags,
+ void *data);
/*
* Constants used by ram_control_* hooks
*/
-#define RAM_CONTROL_SETUP 0
-#define RAM_CONTROL_ROUND 1
-#define RAM_CONTROL_HOOK 2
-#define RAM_CONTROL_FINISH 3
+#define RAM_CONTROL_SETUP 0
+#define RAM_CONTROL_ROUND 1
+#define RAM_CONTROL_HOOK 2
+#define RAM_CONTROL_FINISH 3
+#define RAM_CONTROL_BLOCK_REG 4
/*
* This function allows override of where the RAM page