[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/14] migration: Move self_announce_delay() to misc.
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 06/14] migration: Move self_announce_delay() to misc.h |
Date: |
Tue, 13 Jun 2017 11:51:12 +0200 |
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
---
hw/net/virtio-net.c | 1 +
include/migration/misc.h | 10 ++++++++++
include/migration/vmstate.h | 10 ----------
migration/savevm.c | 1 +
4 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 9a3d769..91eddaf 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -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
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
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 8a3e9e6..ee91dff 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -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);
diff --git a/migration/savevm.c b/migration/savevm.c
index 745caae..cc8e4e1 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -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"
--
2.9.4
- [Qemu-devel] [PULL 00/14] Migration PULL request, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 01/14] migration: isolate return path on src, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 03/14] ram: Print block stats also in the complete case, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 04/14] ram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 05/14] migration: Remove MigrationState from migration_channel_incomming(), Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 02/14] migration: Don't try to set *errp directly, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 07/14] migration: Split registration functions from vmstate.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 08/14] migration: Move dump_vmsate_json_to_file() to misc.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 06/14] migration: Move self_announce_delay() to misc.h,
Juan Quintela <=
- [Qemu-devel] [PULL 09/14] migration: Move constants to savevm.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 10/14] migration: Commands are only used inside migration.c, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 11/14] migration: ram_control_* are implemented in qemu_file, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 12/14] migration: create global_state.c, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 13/14] migration: Move remaining exported functions to migration/misc.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 14/14] migration: Move migration.h to migration/, Juan Quintela, 2017/06/13
- Re: [Qemu-devel] [PULL 00/14] Migration PULL request, Peter Maydell, 2017/06/13