qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migration: Introduce migration_in_completion()
@ 2015-10-27 11:01 Pavel Fedin
  2015-10-27 13:41 ` Juan Quintela
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Fedin @ 2015-10-27 11:01 UTC (permalink / raw)
  To: qemu-devel
  Cc: 'Amit Shah', 'Luiz Capitulino',
	'Juan Quintela'

This allows to signal migration notifiers that the migration has entered
final phase. The condition is set after vm_stop_force_state().

This will be necessary for ITS live migration on ARM, which will have to
dump its state into guest RAM at this point.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
---
 include/migration/migration.h | 2 ++
 migration/migration.c         | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/include/migration/migration.h b/include/migration/migration.h
index 8334621..51b0ea2 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -69,6 +69,7 @@ struct MigrationState
     int parameters[MIGRATION_PARAMETER_MAX];
 
     int state;
+    bool in_completion;
     MigrationParams params;
     double mbps;
     int64_t total_time;
@@ -117,6 +118,7 @@ int migrate_fd_close(MigrationState *s);
 void add_migration_state_change_notifier(Notifier *notify);
 void remove_migration_state_change_notifier(Notifier *notify);
 bool migration_in_setup(MigrationState *);
+bool migration_in_completion(MigrationState *);
 bool migration_has_finished(MigrationState *);
 bool migration_has_failed(MigrationState *);
 MigrationState *migrate_get_current(void);
diff --git a/migration/migration.c b/migration/migration.c
index b092f38..f4a2421 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -674,6 +674,11 @@ bool migration_in_setup(MigrationState *s)
     return s->state == MIGRATION_STATUS_SETUP;
 }
 
+bool migration_in_completion(MigrationState *s)
+{
+    return s->in_completion;
+}
+
 bool migration_has_finished(MigrationState *s)
 {
     return s->state == MIGRATION_STATUS_COMPLETED;
@@ -996,6 +1001,8 @@ static void migration_completion(MigrationState *s, bool *old_vm_running,
     if (!ret) {
         ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
         if (ret >= 0) {
+            s->in_completion = true;
+            notifier_list_notify(&migration_state_notifiers, s);
             qemu_file_set_rate_limit(s->file, INT64_MAX);
             qemu_savevm_state_complete(s->file);
         }
-- 
1.9.5.msysgit.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-29 14:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 11:01 [Qemu-devel] [PATCH] migration: Introduce migration_in_completion() Pavel Fedin
2015-10-27 13:41 ` Juan Quintela
2015-10-27 14:03   ` Pavel Fedin
2015-10-28  9:58     ` Juan Quintela
2015-10-28 10:27       ` Pavel Fedin
2015-10-28 11:36       ` Pavel Fedin
2015-10-29 12:20         ` Juan Quintela
2015-10-29 13:36           ` Pavel Fedin
2015-10-29 14:37             ` Juan Quintela

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).