yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
ddf19c
From ab07e0b41c50a85940d798a9a65a58698fd2edfb Mon Sep 17 00:00:00 2001
ddf19c
From: Juan Quintela <quintela@redhat.com>
ddf19c
Date: Tue, 3 Mar 2020 14:51:40 +0000
ddf19c
Subject: [PATCH 08/18] migration: Don't send data if we have stopped
ddf19c
ddf19c
RH-Author: Juan Quintela <quintela@redhat.com>
ddf19c
Message-id: <20200303145143.149290-8-quintela@redhat.com>
ddf19c
Patchwork-id: 94114
ddf19c
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 07/10] migration: Don't send data if we have stopped
ddf19c
Bugzilla: 1738451
ddf19c
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
ddf19c
RH-Acked-by: Peter Xu <peterx@redhat.com>
ddf19c
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
ddf19c
If we do a cancel, we got out without one error, but we can't do the
ddf19c
rest of the output as in a normal situation.
ddf19c
ddf19c
Signed-off-by: Juan Quintela <quintela@redhat.com>
ddf19c
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
(cherry picked from commit b69a0227a803256ad270283872d40ff768f4d56d)
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 migration/ram.c | 3 ++-
ddf19c
 1 file changed, 2 insertions(+), 1 deletion(-)
ddf19c
ddf19c
diff --git a/migration/ram.c b/migration/ram.c
ddf19c
index a0257ee..902c56c 100644
ddf19c
--- a/migration/ram.c
ddf19c
+++ b/migration/ram.c
ddf19c
@@ -3511,7 +3511,8 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
ddf19c
     ram_control_after_iterate(f, RAM_CONTROL_ROUND);
ddf19c
 
ddf19c
 out:
ddf19c
-    if (ret >= 0) {
ddf19c
+    if (ret >= 0
ddf19c
+        && migration_is_setup_or_active(migrate_get_current()->state)) {
ddf19c
         multifd_send_sync_main(rs);
ddf19c
         qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
ddf19c
         qemu_fflush(f);
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c