Skip to content

Commit

Permalink
migration: code clean up
Browse files Browse the repository at this point in the history
Just clean up code, no behavior change.

Signed-off-by: Liang Li <liang.z.li@intel.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>al3
Reviewed-by: Amit Shah <amit.shah@redhat.com>al3
Signed-off-by: Juan Quintela <quintela@redhat.com>al3
  • Loading branch information
Liang Li authored and Juan Quintela committed Nov 4, 2015
1 parent d1a8548 commit 6ad2a21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions migration/block.c
Expand Up @@ -591,7 +591,7 @@ static int64_t get_remaining_dirty(void)

/* Called with iothread lock taken. */

static void blk_mig_cleanup(void)
static void block_migration_cleanup(void *opaque)
{
BlkMigDevState *bmds;
BlkMigBlock *blk;
Expand All @@ -618,11 +618,6 @@ static void blk_mig_cleanup(void)
blk_mig_unlock();
}

static void block_migration_cancel(void *opaque)
{
blk_mig_cleanup();
}

static int block_save_setup(QEMUFile *f, void *opaque)
{
int ret;
Expand Down Expand Up @@ -884,7 +879,7 @@ static SaveVMHandlers savevm_block_handlers = {
.save_live_complete = block_save_complete,
.save_live_pending = block_save_pending,
.load_state = block_load,
.cleanup = block_migration_cancel,
.cleanup = block_migration_cleanup,
.is_active = block_is_active,
};

Expand Down
9 changes: 2 additions & 7 deletions migration/ram.c
Expand Up @@ -1100,7 +1100,7 @@ static void migration_bitmap_free(struct BitmapRcu *bmap)
g_free(bmap);
}

static void migration_end(void)
static void ram_migration_cleanup(void *opaque)
{
/* caller have hold iothread lock or is in a bh, so there is
* no writing race against this migration_bitmap
Expand All @@ -1124,11 +1124,6 @@ static void migration_end(void)
XBZRLE_cache_unlock();
}

static void ram_migration_cancel(void *opaque)
{
migration_end();
}

static void reset_ram_globals(void)
{
last_seen_block = NULL;
Expand Down Expand Up @@ -1685,7 +1680,7 @@ static SaveVMHandlers savevm_ram_handlers = {
.save_live_complete = ram_save_complete,
.save_live_pending = ram_save_pending,
.load_state = ram_load,
.cleanup = ram_migration_cancel,
.cleanup = ram_migration_cleanup,
};

void ram_mig_init(void)
Expand Down

0 comments on commit 6ad2a21

Please sign in to comment.