[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 073/108] rdma: bug fixes
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 073/108] rdma: bug fixes |
Date: |
Wed, 6 Aug 2014 15:39:23 -0500 |
From: "Michael R. Hines" <address@hidden>
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: address@hidden
Reported-by: address@hidden
Signed-off-by: Michael R. Hines <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
(cherry picked from commit e325b49a320b493cc5d69e263751ff716dc458fe)
Signed-off-by: Michael Roth <address@hidden>
---
migration-rdma.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/migration-rdma.c b/migration-rdma.c
index eeb4302..5cd90bd 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;
--
1.9.1
- [Qemu-stable] [PATCH 061/108] qemu-io: Plug memory leak in open command, (continued)
- [Qemu-stable] [PATCH 061/108] qemu-io: Plug memory leak in open command, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 065/108] tcg-i386: Fix win64 qemu store, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 064/108] linux-user: Don't overrun guest buffer in sched_getaffinity, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 066/108] target-arm: Fix errors in writes to generic timer control registers, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 067/108] s390x/css: handle emw correctly for tsch, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 034/108] qdev: Fix crash by validating the object type, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 070/108] migration: remove duplicate code, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 068/108] aio: fix qemu_bh_schedule() bh->ctx race condition, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 069/108] qga: Fix handle fd leak in acquire_privilege(), Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 071/108] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load(), Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 073/108] rdma: bug fixes,
Michael Roth <=
- [Qemu-stable] [PATCH 072/108] migration: catch unknown flags in ram_load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 075/108] qdev: reorganize error reporting in bus_set_realized, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 076/108] qdev: recursively unrealize devices when unrealizing bus, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 077/108] scsi-disk: fix bug in scsi_block_new_request() introduced by commit 137745c, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 078/108] vhost: fix resource leak in error handling, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 080/108] usb: Fix usb-bt-dongle initialization., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 079/108] virtio-scsi: define dummy handle_output for vhost-scsi vqs, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 083/108] coroutine-win32.c: Add noinline attribute to work around gcc bug, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 086/108] target-i386: Filter FEAT_7_0_EBX TCG features too, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 082/108] q35: Use PC_Q35_COMPAT_1_4 on pc-q35-1.4 compat_props, Michael Roth, 2014/08/06