diff options
author | Ashijeet Acharya <ashijeetacharya@gmail.com> | 2017-01-16 17:01:53 +0530 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2017-01-24 18:00:30 +0000 |
commit | fe44dc91807eca59d0230fe828c1e2ee0c305a1e (patch) | |
tree | ecbc1e1fd3a3052910eff44f0f6e8a84b626b199 /include | |
parent | a3a3d8c73889282eb696535f1b5345d88b4dc58c (diff) |
migration: disallow migrate_add_blocker during migration
If a migration is already in progress and somebody attempts
to add a migration blocker, this should rightly fail.
Add an errp parameter and a retcode return value to migrate_add_blocker.
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Ashijeet Acharya <ashijeetacharya@gmail.com>
Message-Id: <1484566314-3987-5-git-send-email-ashijeetacharya@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Merged with recent 'Allow invtsc migration' change
Diffstat (limited to 'include')
-rw-r--r-- | include/migration/migration.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/migration/migration.h b/include/migration/migration.h index 40b369794e..bcbdb0389c 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -243,6 +243,7 @@ void remove_migration_state_change_notifier(Notifier *notify); MigrationState *migrate_init(const MigrationParams *params); bool migration_is_blocked(Error **errp); bool migration_in_setup(MigrationState *); +bool migration_is_idle(MigrationState *s); bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); /* True if outgoing migration has entered postcopy phase */ @@ -287,8 +288,12 @@ int ram_postcopy_incoming_init(MigrationIncomingState *mis); * @migrate_add_blocker - prevent migration from proceeding * * @reason - an error to be returned whenever migration is attempted + * + * @errp - [out] The reason (if any) we cannot block migration right now. + * + * @returns - 0 on success, -EBUSY on failure, with errp set. */ -void migrate_add_blocker(Error *reason); +int migrate_add_blocker(Error *reason, Error **errp); /** * @migrate_del_blocker - remove a blocking error from migration |