[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 33/41] migration: Commands are only used inside migr
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 33/41] migration: Commands are only used inside migration.c |
Date: |
Wed, 26 Apr 2017 00:04:43 +0200 |
So, move them there. Notice that we export functions that send
commands, not the command themselves.
Signed-off-by: Juan Quintela <address@hidden>
---
include/migration/migration.h | 15 --------------
migration/migration.c | 46 +++++++++++++++++++++++++++----------------
2 files changed, 29 insertions(+), 32 deletions(-)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index ac6e545..9884be6 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -25,18 +25,6 @@
/* for vl.c */
extern int only_migratable;
-/* Messages sent on the return path from destination to source */
-enum mig_rp_message_type {
- MIG_RP_MSG_INVALID = 0, /* Must be 0 */
- MIG_RP_MSG_SHUT, /* sibling will not send any more RP messages */
- MIG_RP_MSG_PONG, /* Response to a PING; data (seq: be32 ) */
-
- MIG_RP_MSG_REQ_PAGES_ID, /* data (start: be64, len: be32, id: string) */
- MIG_RP_MSG_REQ_PAGES, /* data (start: be64, len: be32) */
-
- MIG_RP_MSG_MAX
-};
-
typedef QLIST_HEAD(, LoadStateEntry) LoadStateEntry_Head;
/* State for the incoming migration */
@@ -181,9 +169,6 @@ int migrate_decompress_threads(void);
bool migrate_use_events(void);
/* Sending on the return path - generic and then for each message type */
-void migrate_send_rp_message(MigrationIncomingState *mis,
- enum mig_rp_message_type message_type,
- uint16_t len, void *data);
void migrate_send_rp_shut(MigrationIncomingState *mis,
uint32_t value);
void migrate_send_rp_pong(MigrationIncomingState *mis,
diff --git a/migration/migration.c b/migration/migration.c
index d2f3c5e..6e43ae3 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -85,6 +85,18 @@ static NotifierList migration_state_notifiers =
static bool deferred_incoming;
+/* Messages sent on the return path from destination to source */
+enum mig_rp_message_type {
+ MIG_RP_MSG_INVALID = 0, /* Must be 0 */
+ MIG_RP_MSG_SHUT, /* sibling will not send any more RP messages */
+ MIG_RP_MSG_PONG, /* Response to a PING; data (seq: be32 ) */
+
+ MIG_RP_MSG_REQ_PAGES_ID, /* data (start: be64, len: be32, id: string) */
+ MIG_RP_MSG_REQ_PAGES, /* data (start: be64, len: be32) */
+
+ MIG_RP_MSG_MAX
+};
+
/* When we add fault tolerance, we could have several
migrations at once. For now we don't need to add
dynamic creation of migration */
@@ -281,6 +293,23 @@ static void deferred_incoming_migration(Error **errp)
deferred_incoming = true;
}
+/*
+ * Send a message on the return channel back to the source
+ * of the migration.
+ */
+static void migrate_send_rp_message(MigrationIncomingState *mis,
+ enum mig_rp_message_type message_type,
+ uint16_t len, void *data)
+{
+ trace_migrate_send_rp_message((int)message_type, len);
+ qemu_mutex_lock(&mis->rp_mutex);
+ qemu_put_be16(mis->to_src_file, (unsigned int)message_type);
+ qemu_put_be16(mis->to_src_file, len);
+ qemu_put_buffer(mis->to_src_file, data, len);
+ qemu_fflush(mis->to_src_file);
+ qemu_mutex_unlock(&mis->rp_mutex);
+}
+
/* Request a range of pages from the source VM at the given
* start address.
* rbname: Name of the RAMBlock to request the page in, if NULL it's the same
@@ -461,23 +490,6 @@ void migration_fd_process_incoming(QEMUFile *f)
}
/*
- * Send a message on the return channel back to the source
- * of the migration.
- */
-void migrate_send_rp_message(MigrationIncomingState *mis,
- enum mig_rp_message_type message_type,
- uint16_t len, void *data)
-{
- trace_migrate_send_rp_message((int)message_type, len);
- qemu_mutex_lock(&mis->rp_mutex);
- qemu_put_be16(mis->to_src_file, (unsigned int)message_type);
- qemu_put_be16(mis->to_src_file, len);
- qemu_put_buffer(mis->to_src_file, data, len);
- qemu_fflush(mis->to_src_file);
- qemu_mutex_unlock(&mis->rp_mutex);
-}
-
-/*
* Send a 'SHUT' message on the return channel with the given value
* to indicate that we've finished with the RP. Non-0 value indicates
* error.
--
2.9.3
- [Qemu-devel] [PATCH 25/41] migration: Export rdma.c functions in its own file, (continued)
- [Qemu-devel] [PATCH 25/41] migration: Export rdma.c functions in its own file, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 27/41] migration: Move self_announce_delay() to misc.h, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 28/41] migration: Split registration functions from vmstate.h, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 26/41] migration: Move include/migration/block.h into migration/, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 29/41] migration: loadvm_free_handlers is only used in migration/, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 30/41] migration: Move dump_vmsate_json_to_file() to misc.h, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 32/41] migration: Move constants to savevm.h, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 31/41] migration: Move postcopy stuff to postcopy-ram.c, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 33/41] migration: Commands are only used inside migration.c,
Juan Quintela <=
- [Qemu-devel] [PATCH 34/41] migration: ram_control_* are implemented in qemu_file, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 35/41] migration: create global_state.c, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 37/41] migration: Move last funtions to misc.h, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 36/41] migration: Move more exported functions to migration/misc.h, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 38/41] migration: Move migration.h to migration/, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 39/41] exec: Create include for target_page_size(), Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 40/41] migration: Make savevm.c target independent, Juan Quintela, 2017/04/25
- [Qemu-devel] [PATCH 41/41] migration: Remove unneeded includes, Juan Quintela, 2017/04/25
- Re: [Qemu-devel] [PATCH 00/41] Migration cleanup, Dr. David Alan Gilbert, 2017/04/27