aboutsummaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-06-26 18:46:10 +0200
committerJuan Quintela <quintela@redhat.com>2012-07-20 08:19:27 +0200
commit7908c78d3e1a117ae6b9545e601409eee3d33863 (patch)
tree6b58bdcf72b13c958459ae6df46427c1a14c66d1 /block-migration.c
parent22ea40f4ff072a113fdf96bff10bc81ee063da32 (diff)
downloadqemu-arm-7908c78d3e1a117ae6b9545e601409eee3d33863.tar.gz
savevm: Live migration handlers register the struct directly
Notice that the live migration users never unregister, so no problem about freeing the ops structure. Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r--block-migration.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/block-migration.c b/block-migration.c
index b95b4e1389..00151a07d9 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -709,11 +709,17 @@ static void block_set_params(const MigrationParams *params, void *opaque)
block_mig_state.blk_enable |= params->shared;
}
+SaveVMHandlers savevm_block_handlers = {
+ .set_params = block_set_params,
+ .save_live_state = block_save_live,
+ .load_state = block_load,
+};
+
void blk_mig_init(void)
{
QSIMPLEQ_INIT(&block_mig_state.bmds_list);
QSIMPLEQ_INIT(&block_mig_state.blk_list);
- register_savevm_live(NULL, "block", 0, 1, block_set_params,
- block_save_live, NULL, block_load, &block_mig_state);
+ register_savevm_live(NULL, "block", 0, 1, &savevm_block_handlers,
+ &block_mig_state);
}