for (x = 0; x < num_devices; x++) {
verbs = ibv_open_device(dev_list[x]);
+ /*
+ * ibv_open_device() is not documented to set errno. If
+ * it does, it's somebody else's doc bug. If it doesn't,
+ * the use of errno below is wrong.
+ * TODO Find out whether ibv_open_device() sets errno.
+ */
if (!verbs) {
if (errno == EPERM) {
continue;
ret = ibv_advise_mr(pd, advice,
IBV_ADVISE_MR_FLAG_FLUSH, &sg_list, 1);
/* ignore the error */
- if (ret) {
- trace_qemu_rdma_advise_mr(name, len, addr, strerror(errno));
- } else {
- trace_qemu_rdma_advise_mr(name, len, addr, "successed");
- }
+ trace_qemu_rdma_advise_mr(name, len, addr, strerror(ret));
#endif
}
local->block[i].local_host_addr,
local->block[i].length, access
);
-
+ /*
+ * ibv_reg_mr() is not documented to set errno. If it does,
+ * it's somebody else's doc bug. If it doesn't, the use of
+ * errno below is wrong.
+ * TODO Find out whether ibv_reg_mr() sets errno.
+ */
if (!local->block[i].mr &&
errno == ENOTSUP && rdma_support_odp(rdma->verbs)) {
access |= IBV_ACCESS_ON_DEMAND;
trace_qemu_rdma_register_and_get_keys(len, chunk_start);
block->pmr[chunk] = ibv_reg_mr(rdma->pd, chunk_start, len, access);
+ /*
+ * ibv_reg_mr() is not documented to set errno. If it does,
+ * it's somebody else's doc bug. If it doesn't, the use of
+ * errno below is wrong.
+ * TODO Find out whether ibv_reg_mr() sets errno.
+ */
if (!block->pmr[chunk] &&
errno == ENOTSUP && rdma_support_odp(rdma->verbs)) {
access |= IBV_ACCESS_ON_DEMAND;
block->remote_keys[chunk] = 0;
if (ret != 0) {
+ /*
+ * FIXME perror() is problematic, bcause ibv_dereg_mr() is
+ * not documented to set errno. Will go away later in
+ * this series.
+ */
perror("unregistration chunk failed");
return -ret;
}
ret = ibv_get_cq_event(ch, &cq, &cq_ctx);
if (ret) {
+ /*
+ * FIXME perror() is problematic, because ibv_reg_mr() is
+ * not documented to set errno. Will go away later in
+ * this series.
+ */
perror("ibv_get_cq_event");
goto err_block_for_wrid;
}
goto retry;
} else if (ret > 0) {
+ /*
+ * FIXME perror() is problematic, because whether
+ * ibv_post_send() sets errno is unclear. Will go away later
+ * in this series.
+ */
perror("rdma migration: post rdma write failed");
return -ret;
}
ret = rdma_get_cm_event(rdma->channel, &cm_event);
}
if (ret) {
+ /*
+ * FIXME perror() is wrong, because
+ * qemu_get_cm_event_timeout() can fail without setting errno.
+ * Will go away later in this series.
+ */
perror("rdma_get_cm_event after rdma_connect");
ERROR(errp, "connecting to destination!");
goto err_rdma_source_connect;