migration: Move self_announce_delay() to misc.h
authorJuan Quintela <quintela@redhat.com>
Fri, 21 Apr 2017 15:39:30 +0000 (17:39 +0200)
committerJuan Quintela <quintela@redhat.com>
Tue, 13 Jun 2017 09:00:44 +0000 (11:00 +0200)
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>
hw/net/virtio-net.c
include/migration/misc.h
include/migration/vmstate.h
migration/savevm.c

index 9a3d769aa2ae5af8d1554816a7a5397f70e3524f..91eddaf93bcfa9ccbc642391c309671eb0db8803 100644 (file)
@@ -25,6 +25,7 @@
 #include "qapi/qmp/qjson.h"
 #include "qapi-event.h"
 #include "hw/virtio/virtio-access.h"
+#include "migration/misc.h"
 
 #define VIRTIO_NET_VM_VERSION    11
 
index d7892b7956b82f34d3c6d8b9760d698eda96f904..60486d4066ab7aac758bd10d8127267a6360ef7a 100644 (file)
@@ -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
index 8a3e9e6088e43fce0774d398f28935b04af3e7e0..ee91dff0a1124f3f8f477bffbb9003aa4db608df 100644 (file)
@@ -1010,8 +1010,6 @@ extern const VMStateInfo vmstate_info_qtailq;
 #define VMSTATE_END_OF_LIST()                                         \
     {}
 
-#define SELF_ANNOUNCE_ROUNDS 5
-
 int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
                        void *opaque, int version_id);
 void vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,
@@ -1043,14 +1041,6 @@ void vmstate_register_ram(struct MemoryRegion *memory, DeviceState *dev);
 void vmstate_unregister_ram(struct MemoryRegion *memory, DeviceState *dev);
 void vmstate_register_ram_global(struct MemoryRegion *memory);
 
-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;
-}
-
 void dump_vmstate_json_to_file(FILE *out_fp);
 
 bool vmstate_check_only_migratable(const VMStateDescription *vmsd);
index 745caaebefd116466e25dcec514391ddc77cbc1f..cc8e4e10fe92c99cc48ba8da9d81c970c713e31d 100644 (file)
@@ -36,6 +36,7 @@
 #include "qemu/timer.h"
 #include "migration/migration.h"
 #include "migration/snapshot.h"
+#include "migration/misc.h"
 #include "ram.h"
 #include "qemu-file-channel.h"
 #include "qemu-file.h"