aboutsummaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2012-06-27 10:59:15 +0200
committerJuan Quintela <quintela@redhat.com>2012-07-20 08:19:27 +0200
commit6bd68781331590c4f2fbd1fdf98e80d7f6588b31 (patch)
treeae53eee26d30deae6d3ed0ca84b559d0b2819265 /block-migration.c
parent9b5bfab05f7c2a56d5908117e8cc62015e6b2c63 (diff)
downloadqemu-arm-6bd68781331590c4f2fbd1fdf98e80d7f6588b31.tar.gz
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 <quintela@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r--block-migration.c13
1 files changed, 6 insertions, 7 deletions
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)