[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/22] rdma: bug fixes
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 01/22] rdma: bug fixes |
Date: |
Tue, 24 Jun 2014 15:09:51 +0200 |
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>
---
migration-rdma.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/migration-rdma.c b/migration-rdma.c
index f60749b..d99812c 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -1590,13 +1590,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);
@@ -2238,10 +2236,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;
@@ -2259,6 +2253,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;
}
@@ -2513,8 +2511,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.3
- [Qemu-devel] [PULL 00/22] Migration queue, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 01/22] rdma: bug fixes,
Juan Quintela <=
- [Qemu-devel] [PULL 03/22] vmstate-static-checker: script to validate vmstate changes, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 02/22] migration: dump vmstate info as a json file for static analysis, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 04/22] tests: vmstate static checker: add dump1 and dump2 files, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 05/22] tests: vmstate static checker: incompat machine types, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 06/22] tests: vmstate static checker: add version error in main section, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 07/22] tests: vmstate static checker: version mismatch inside a Description, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 08/22] tests: vmstate static checker: minimum_version_id check, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 09/22] tests: vmstate static checker: remove a section, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 10/22] tests: vmstate static checker: remove a field, Juan Quintela, 2014/06/24
- [Qemu-devel] [PULL 11/22] tests: vmstate static checker: remove last field in a struct, Juan Quintela, 2014/06/24