diff mbox series

[V1,21/26] migration: migrate_add_blocker_mode

Message ID 1714406135-451286-22-git-send-email-steven.sistare@oracle.com (mailing list archive)
State New, archived
Headers show
Series Live update: cpr-exec | expand

Commit Message

Steven Sistare April 29, 2024, 3:55 p.m. UTC
Define a convenience function to add a migration blocker for a single mode.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
 include/migration/blocker.h | 7 +++++++
 migration/migration.c       | 5 +++++
 stubs/migr-blocker.c        | 5 +++++
 3 files changed, 17 insertions(+)

Comments

Fabiano Rosas May 9, 2024, 5:47 p.m. UTC | #1
Steve Sistare <steven.sistare@oracle.com> writes:

> Define a convenience function to add a migration blocker for a single mode.
>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>

Reviewed-by: Fabiano Rosas <farosas@suse.de>
diff mbox series

Patch

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)
 {
 }