aboutsummaryrefslogtreecommitdiff
path: root/include/migration/misc.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-04-21 17:39:30 +0200
committerJuan Quintela <quintela@redhat.com>2017-06-13 11:00:44 +0200
commitf8d806c992a89728a08b7bb005ffd9e75dac5653 (patch)
tree7c276b568cf1b16fa651c37025b8dde9cd96cb08 /include/migration/misc.h
parent543147116e40edcc6ccfc51e7b05a8a8934b48b5 (diff)
downloadqemu-f8d806c992a89728a08b7bb005ffd9e75dac5653.zip
qemu-f8d806c992a89728a08b7bb005ffd9e75dac5653.tar.gz
qemu-f8d806c992a89728a08b7bb005ffd9e75dac5653.tar.bz2
migration: Move self_announce_delay() to misc.h
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Diffstat (limited to 'include/migration/misc.h')
-rw-r--r--include/migration/misc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/migration/misc.h b/include/migration/misc.h
index d7892b7..60486d4 100644
--- a/include/migration/misc.h
+++ b/include/migration/misc.h
@@ -26,4 +26,14 @@ void blk_mig_init(void);
static inline void blk_mig_init(void) {}
#endif
+#define SELF_ANNOUNCE_ROUNDS 5
+
+static inline
+int64_t self_announce_delay(int round)
+{
+ assert(round < SELF_ANNOUNCE_ROUNDS && round > 0);
+ /* delay 50ms, 150ms, 250ms, ... */
+ return 50 + (SELF_ANNOUNCE_ROUNDS - round - 1) * 100;
+}
+
#endif