summaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-06-26 19:26:41 +0200
committerJuan Quintela <quintela@redhat.com>2012-07-20 08:19:27 +0200
commit9b5bfab05f7c2a56d5908117e8cc62015e6b2c63 (patch)
tree352b26118880668cb949c218a79e7a45a2078521 /block-migration.c
parent226aa6a9b19e5465418fa62c5188acac280f1c13 (diff)
savevm: Refactor cancel operation in its own operation
Intead of abusing stage with value -1. Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r--block-migration.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/block-migration.c b/block-migration.c
index 00151a07d9..cd8a8dd6cb 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -536,6 +536,11 @@ static void blk_mig_cleanup(void)
}
}
+static void block_migration_cancel(void *opaque)
+{
+ blk_mig_cleanup();
+}
+
static int block_save_live(QEMUFile *f, int stage, void *opaque)
{
int ret;
@@ -543,10 +548,6 @@ static int block_save_live(QEMUFile *f, int stage, void *opaque)
DPRINTF("Enter save live stage %d submitted %d transferred %d\n",
stage, block_mig_state.submitted, block_mig_state.transferred);
- if (stage < 0) {
- blk_mig_cleanup();
- return 0;
- }
if (block_mig_state.blk_enable != 1) {
/* no need to migrate storage */
@@ -713,6 +714,7 @@ SaveVMHandlers savevm_block_handlers = {
.set_params = block_set_params,
.save_live_state = block_save_live,
.load_state = block_load,
+ .cancel = block_migration_cancel,
};
void blk_mig_init(void)