From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv15E-000576-0M for qemu-devel@nongnu.org; Thu, 12 Jun 2014 05:14:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv154-0001BI-VU for qemu-devel@nongnu.org; Thu, 12 Jun 2014 05:14:07 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:59475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv154-00019J-Ni for qemu-devel@nongnu.org; Thu, 12 Jun 2014 05:13:58 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Jun 2014 03:13:56 -0600 Message-ID: <53996F09.8030200@linux.vnet.ibm.com> Date: Thu, 12 Jun 2014 17:12:41 +0800 From: "Michael R. Hines" MIME-Version: 1.0 References: <1392690846-30926-1-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1392690846-30926-1-git-send-email-mrhines@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] rdma: bug fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, quintela@redhat.com, hinesmr@cn.ibm.com, "Michael R. Hines" , qemu-stable@nongnu.org On 02/18/2014 10:34 AM, mrhines@linux.vnet.ibm.com wrote: > From: "Michael R. Hines" > > 1. Fix small memory leak in parsing inet address from command line in data_init() > 2. Fix ibv_post_send() return value check and pass error code back up correctly. > 3. Fix rdma_destroy_qp() segfault after failure to connect to destination. > > Reported-by: frank.yangjie@gmail.com > Reported-by: dgilbert@redhat.com > Signed-off-by: Michael R. Hines > --- > migration-rdma.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/migration-rdma.c b/migration-rdma.c > index f94f3b4..29351a6 100644 > --- a/migration-rdma.c > +++ b/migration-rdma.c > @@ -1589,13 +1589,11 @@ static int qemu_rdma_post_send_control(RDMAContext *rdma, uint8_t *buf, > } > > > - if (ibv_post_send(rdma->qp, &send_wr, &bad_wr)) { > - return -1; > - } > + ret = ibv_post_send(rdma->qp, &send_wr, &bad_wr); > > - if (ret < 0) { > + if (ret > 0) { > fprintf(stderr, "Failed to use post IB SEND for control!\n"); > - return ret; > + return -ret; > } > > ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_SEND_CONTROL, NULL); > @@ -2237,10 +2235,6 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) > } > } > > - if (rdma->qp) { > - rdma_destroy_qp(rdma->cm_id); > - rdma->qp = NULL; > - } > if (rdma->cq) { > ibv_destroy_cq(rdma->cq); > rdma->cq = NULL; > @@ -2258,6 +2252,10 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) > rdma->listen_id = NULL; > } > if (rdma->cm_id) { > + if (rdma->qp) { > + rdma_destroy_qp(rdma->cm_id); > + rdma->qp = NULL; > + } > rdma_destroy_id(rdma->cm_id); > rdma->cm_id = NULL; > } > @@ -2512,8 +2510,10 @@ static void *qemu_rdma_data_init(const char *host_port, Error **errp) > } else { > ERROR(errp, "bad RDMA migration address '%s'", host_port); > g_free(rdma); > - return NULL; > + rdma = NULL; > } > + > + qapi_free_InetSocketAddress(addr); > } > > return rdma; Juan? Ping again? - Michael