<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From b43c09dba32d17d1e4056f3ad3d712cabf9c9a86 Mon Sep 17 00:00:00 2001
From: "Dr. David Alan Gilbert" &lt;dgilbert@redhat.com&gt;
Date: Mon, 13 Jul 2015 13:42:04 +0200
Subject: [PATCH 24/58] Fail more cleanly in mismatched RAM cases

Message-id: &lt;1436794926-1598-16-git-send-email-dgilbert@redhat.com&gt;
Patchwork-id: 66986
O-Subject: [RHEL-7.2 qemu-kvm-rhev PATCH 15/17] Fail more cleanly in mismatched RAM cases
Bugzilla: 1210715
RH-Acked-by: Marcel Apfelbaum &lt;marcel@redhat.com&gt;
RH-Acked-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
RH-Acked-by: Juan Quintela &lt;quintela@redhat.com&gt;

From: "Dr. David Alan Gilbert" &lt;dgilbert@redhat.com&gt;

If the number of RAMBlocks was different on the source from the
destination, QEMU would hang waiting for a disconnect on the source
and wouldn't release from that hang until the destination was manually
killed.

Mark the stream as being in error, this causes the destination to die
and the source to carry on.

(It still gets a whole bunch of warnings on the destination, and I've
not managed to complete another migration after the 1st one, still
progress).

Signed-off-by: Dr. David Alan Gilbert &lt;dgilbert@redhat.com&gt;
Signed-off-by: Juan Quintela &lt;quintela@redhat.com&gt;
(cherry picked from commit ef4b722d19cab845eaa0d1f912018b09a9d8288b)
Signed-off-by: Miroslav Rezanina &lt;mrezanin@redhat.com&gt;
---
 migration/rdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/migration/rdma.c b/migration/rdma.c
index f3e0a82..9838a6d 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3327,6 +3327,7 @@ static int qemu_rdma_registration_stop(QEMUFile *f, void *opaque,
                         "Your QEMU command line parameters are probably "
                         "not identical on both the source and destination.",
                         local-&gt;nb_blocks, nb_dest_blocks);
+            rdma-&gt;error_state = -EINVAL;
             return -EINVAL;
         }
 
@@ -3342,6 +3343,7 @@ static int qemu_rdma_registration_stop(QEMUFile *f, void *opaque,
                             "vs %" PRIu64, local-&gt;block[i].block_name, i,
                             local-&gt;block[i].length,
                             rdma-&gt;dest_blocks[i].length);
+                rdma-&gt;error_state = -EINVAL;
                 return -EINVAL;
             }
             local-&gt;block[i].remote_host_addr =
-- 
1.8.3.1

</pre></body></html>