From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com
Subject: [Qemu-devel] [PATCH 02/11] migration: Move self_announce_delay() to misc.h
Date: Thu, 1 Jun 2017 23:29:12 +0200 [thread overview]
Message-ID: <20170601212921.30241-3-quintela@redhat.com> (raw)
In-Reply-To: <20170601212921.30241-1-quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
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 6689562..b95c9bb 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -1018,8 +1018,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,
@@ -1051,14 +1049,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 9c320f5..d683877 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
next prev parent reply other threads:[~2017-06-01 21:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 21:29 [Qemu-devel] [PATCH 00/11] Misc migration cleanups Juan Quintela
2017-06-01 21:29 ` [Qemu-devel] [PATCH 01/11] migration: Remove MigrationState from migration_channel_incomming() Juan Quintela
2017-06-12 9:19 ` Peter Xu
2017-06-12 10:03 ` Laurent Vivier
2017-06-01 21:29 ` Juan Quintela [this message]
2017-06-12 9:22 ` [Qemu-devel] [PATCH 02/11] migration: Move self_announce_delay() to misc.h Peter Xu
2017-06-12 10:31 ` Laurent Vivier
2017-06-12 10:35 ` Juan Quintela
2017-06-12 10:43 ` Laurent Vivier
2017-06-01 21:29 ` [Qemu-devel] [PATCH 03/11] migration: Split registration functions from vmstate.h Juan Quintela
2017-06-12 9:29 ` Peter Xu
2017-06-12 10:36 ` Juan Quintela
2017-06-01 21:29 ` [Qemu-devel] [PATCH 04/11] migration: Move dump_vmsate_json_to_file() to misc.h Juan Quintela
2017-06-12 9:33 ` Peter Xu
2017-06-12 10:42 ` Laurent Vivier
2017-06-01 21:29 ` [Qemu-devel] [PATCH 05/11] migration: Move constants to savevm.h Juan Quintela
2017-06-12 10:44 ` Laurent Vivier
2017-06-01 21:29 ` [Qemu-devel] [PATCH 06/11] migration: Commands are only used inside migration.c Juan Quintela
2017-06-12 11:34 ` Laurent Vivier
2017-06-01 21:29 ` [Qemu-devel] [PATCH 07/11] migration: ram_control_* are implemented in qemu_file Juan Quintela
2017-06-12 11:39 ` Laurent Vivier
2017-06-01 21:29 ` [Qemu-devel] [PATCH 08/11] migration: create global_state.c Juan Quintela
2017-06-12 11:45 ` Laurent Vivier
2017-06-01 21:29 ` [Qemu-devel] [PATCH 09/11] migration: Move remaining exported functions to migration/misc.h Juan Quintela
2017-06-12 9:51 ` Peter Xu
2017-06-01 21:29 ` [Qemu-devel] [PATCH 10/11] migration: Move migration.h to migration/ Juan Quintela
2017-06-12 9:51 ` Peter Xu
2017-06-12 11:51 ` Laurent Vivier
2017-06-01 21:29 ` [Qemu-devel] [PATCH 11/11] migration: Remove unneeded includes Juan Quintela
2017-06-02 5:00 ` [Qemu-devel] [PATCH 00/11] Misc migration cleanups Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170601212921.30241-3-quintela@redhat.com \
--to=quintela@redhat.com \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).