Set the migration state to "failed" instead of "setup" when failing
to send packet via some channel.

Cc: Peter Xu <pet...@redhat.com>
Signed-off-by: Fei Li <f...@suse.com>
---
 migration/ram.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/migration/ram.c b/migration/ram.c
index 4db3b3e8f4..c84d164fc8 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1072,6 +1072,7 @@ out:
 static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque)
 {
     MultiFDSendParams *p = opaque;
+    MigrationState *s = migrate_get_current();
     QIOChannel *sioc = QIO_CHANNEL(qio_task_get_source(task));
     Error *local_err = NULL;
 
@@ -1083,6 +1084,7 @@ static void multifd_new_send_channel_async(QIOTask *task, 
gpointer opaque)
         if (multifd_save_cleanup(&local_err) != 0) {
             migrate_set_error(migrate_get_current(), local_err);
         }
+        migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED);
     } else {
         p->c = QIO_CHANNEL(sioc);
         qio_channel_set_delay(p->c, false);
-- 
2.13.7


Reply via email to