From 6bd68781331590c4f2fbd1fdf98e80d7f6588b31 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 27 Jun 2012 10:59:15 +0200 Subject: savevm: introduce is_active method Enable the creation of a method to tell migration if that section is active and should be migrate. We use it for blk-migration, that is normally not active. We don't create the method for RAM, as setups without RAM are very strange O:-) Signed-off-by: Juan Quintela --- block-migration.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'block-migration.c') diff --git a/block-migration.c b/block-migration.c index cd8a8dd6cb..6d37dc157c 100644 --- a/block-migration.c +++ b/block-migration.c @@ -548,13 +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 (block_mig_state.blk_enable != 1) { - /* no need to migrate storage */ - qemu_put_be64(f, BLK_MIG_FLAG_EOS); - return 1; - } - if (stage == 1) { init_blk_migration(f); @@ -710,11 +703,17 @@ static void block_set_params(const MigrationParams *params, void *opaque) block_mig_state.blk_enable |= params->shared; } +static bool block_is_active(void *opaque) +{ + return block_mig_state.blk_enable == 1; +} + SaveVMHandlers savevm_block_handlers = { .set_params = block_set_params, .save_live_state = block_save_live, .load_state = block_load, .cancel = block_migration_cancel, + .is_active = block_is_active, }; void blk_mig_init(void) -- cgit v1.2.1