diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2015-11-05 18:10:47 +0000 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2015-11-10 15:00:26 +0100 |
commit | 6decec931149ae50d84e2b264bf93f3676d5b3f9 (patch) | |
tree | e45444b2266f5d9addd5fbc92a092520ee405ade /include/migration/migration.h | |
parent | 2e37701efdba7bb89f7159eff055bb71dbb9f02f (diff) | |
download | qemu-6decec931149ae50d84e2b264bf93f3676d5b3f9.zip |
Return path: Send responses from destination to source
Add migrate_send_rp_message to send a message from destination to source along the return path.
(It uses a mutex to let it be called from multiple threads)
Add migrate_send_rp_shut to send a 'shut' message to indicate
the destination is finished with the RP.
Add migrate_send_rp_ack to send a 'PONG' message in response to a PING
Use it in the MSG_RP_PING handler
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/migration/migration.h')
-rw-r--r-- | include/migration/migration.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/migration/migration.h b/include/migration/migration.h index 98a6d079fd..3ce3fda6b7 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -43,12 +43,22 @@ struct MigrationParams { bool shared; }; +/* 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_MAX +}; + typedef QLIST_HEAD(, LoadStateEntry) LoadStateEntry_Head; /* State for the incoming migration */ struct MigrationIncomingState { QEMUFile *from_src_file; QEMUFile *to_src_file; + QemuMutex rp_mutex; /* We send replies from multiple threads */ /* See savevm.c */ LoadStateEntry_Head loadvm_handlers; @@ -181,6 +191,15 @@ int migrate_compress_threads(void); 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, + uint32_t value); + void ram_control_before_iterate(QEMUFile *f, uint64_t flags); void ram_control_after_iterate(QEMUFile *f, uint64_t flags); void ram_control_load_hook(QEMUFile *f, uint64_t flags, void *data); |