From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv4Pe-0007In-VH for qemu-devel@nongnu.org; Fri, 14 Oct 2016 11:28:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bv4PZ-0008Gl-QO for qemu-devel@nongnu.org; Fri, 14 Oct 2016 11:28:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bv4PZ-0008GW-JS for qemu-devel@nongnu.org; Fri, 14 Oct 2016 11:28:41 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 218BF6AF4 for ; Fri, 14 Oct 2016 15:28:41 +0000 (UTC) From: Juan Quintela Date: Fri, 14 Oct 2016 17:28:13 +0200 Message-Id: <1476458903-7888-6-git-send-email-quintela@redhat.com> In-Reply-To: <1476458903-7888-1-git-send-email-quintela@redhat.com> References: <1476458903-7888-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PULL 05/15] migration/rdma: Don't flag an error when we've been told about one List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, dgilbert@redhat.com From: "Dr. David Alan Gilbert" If the other side tells us there's been an error and we fail the migration, we don't need to signal that failure to the other side because it already knew. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Michael R. Hines Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/rdma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/migration/rdma.c b/migration/rdma.c index 7271292..674ccab 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -350,6 +350,7 @@ typedef struct RDMAContext { */ int error_state; int error_reported; + int received_error; /* * Description of ram blocks used throughout the code. @@ -1676,6 +1677,9 @@ static int qemu_rdma_exchange_get_response(RDMAContext *rdma, ", but got: %s (%d), length: %d", control_desc[expecting], expecting, control_desc[head->type], head->type, head->len); + if (head->type == RDMA_CONTROL_ERROR) { + rdma->received_error = true; + } return -EIO; } if (head->len > RDMA_CONTROL_MAX_BUFFER - sizeof(*head)) { @@ -2202,7 +2206,7 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) int ret, idx; if (rdma->cm_id && rdma->connected) { - if (rdma->error_state) { + if (rdma->error_state && !rdma->received_error) { RDMAControlHeader head = { .len = 0, .type = RDMA_CONTROL_ERROR, .repeat = 1, -- 2.7.4