提交 f8d806c9 编写于 作者: J Juan Quintela

migration: Move self_announce_delay() to misc.h

Signed-off-by: NJuan Quintela <quintela@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: NPeter Xu <peterx@redhat.com>
Reviewed-by: NLaurent Vivier <lvivier@redhat.com>
上级 54314711
......@@ -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
......
......@@ -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
......@@ -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);
......
......@@ -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"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册