mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
migration: introduce self_announce_delay()
This patch introduces self_announce_delay() to calculate the delay for the next announce round. This could be used by other device e.g virtio-net who wants to do announcing by itself. Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
110f463062
commit
508e1180d3
2 changed files with 9 additions and 1 deletions
|
@ -780,4 +780,12 @@ 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;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue