Define a convenience function to add a migration blocker for a single mode.
Signed-off-by: Steve Sistare <steven.sist...@oracle.com> --- include/migration/blocker.h | 7 +++++++ migration/migration.c | 5 +++++ stubs/migr-blocker.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/include/migration/blocker.h b/include/migration/blocker.h index a687ac0..5c2e5d4 100644 --- a/include/migration/blocker.h +++ b/include/migration/blocker.h @@ -94,4 +94,11 @@ int migrate_add_blocker_normal(Error **reasonp, Error **errp); */ int migrate_add_blocker_modes(Error **reasonp, Error **errp, MigMode mode, ...); +/** + * @migrate_add_blocker_mode - prevent a mode of migration from proceeding + * + * Like migrate_add_blocker_modes, but for a single mode. + */ +int migrate_add_blocker_mode(Error **reasonp, MigMode mode, Error **errp); + #endif diff --git a/migration/migration.c b/migration/migration.c index 0d91531..4984dee 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1769,6 +1769,11 @@ int migrate_add_blocker_normal(Error **reasonp, Error **errp) return migrate_add_blocker_modes(reasonp, errp, MIG_MODE_NORMAL, -1); } +int migrate_add_blocker_mode(Error **reasonp, MigMode mode, Error **errp) +{ + return migrate_add_blocker_modes(reasonp, errp, mode, -1); +} + int migrate_add_blocker_modes(Error **reasonp, Error **errp, MigMode mode, ...) { int modes; diff --git a/stubs/migr-blocker.c b/stubs/migr-blocker.c index 11cbff2..150eb62 100644 --- a/stubs/migr-blocker.c +++ b/stubs/migr-blocker.c @@ -16,6 +16,11 @@ int migrate_add_blocker_modes(Error **reasonp, Error **errp, MigMode mode, ...) return 0; } +int migrate_add_blocker_mode(Error **reasonp, MigMode mode, Error **errp) +{ + return 0; +} + void migrate_del_blocker(Error **reasonp) { } -- 1.8.3.1