From: Steve Sistare <steven.sistare@oracle.com>
Define the cpr_is_incoming helper, to be used in several cpr fix patches.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <1741380954-341079-2-git-send-email-steven.sistare@oracle.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
include/migration/cpr.h | 1 +
migration/cpr.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/include/migration/cpr.h b/include/migration/cpr.h
index 3a6deb7933..7561fc75ad 100644
--- a/include/migration/cpr.h
+++ b/include/migration/cpr.h
@@ -21,6 +21,7 @@ int cpr_find_fd(const char *name, int id);
MigMode cpr_get_incoming_mode(void);
void cpr_set_incoming_mode(MigMode mode);
+bool cpr_is_incoming(void);
int cpr_state_save(MigrationChannel *channel, Error **errp);
int cpr_state_load(MigrationChannel *channel, Error **errp);
diff --git a/migration/cpr.c b/migration/cpr.c
index 180faab247..42c46563e5 100644
--- a/migration/cpr.c
+++ b/migration/cpr.c
@@ -128,6 +128,11 @@ void cpr_set_incoming_mode(MigMode mode)
incoming_mode = mode;
}
+bool cpr_is_incoming(void)
+{
+ return incoming_mode != MIG_MODE_NONE;
+}
+
int cpr_state_save(MigrationChannel *channel, Error **errp)
{
int ret;
--
2.35.3