ret = qemu_rdma_exchange_send(rdma, &head, (uint8_t *) ®,
&resp, NULL, NULL);
if (ret < 0) {
- return ret;
+ return -1;
}
trace_qemu_rdma_unregister_waiting_complete(chunk);
if (ret < 0) {
error_report("ibv_poll_cq failed");
- return ret;
+ return -1;
}
wr_id = wc.wr_id & RDMA_WRID_TYPE_MASK;
if (rdma->received_error) {
return -1;
}
- return rdma->error_state;
+ return -!!rdma->error_state;
}
static struct ibv_comp_channel *to_channel(RDMAContext *rdma, uint64_t wrid)
while (wr_id != wrid_requested) {
ret = qemu_rdma_poll(rdma, poll_cq, &wr_id_in, byte_len);
if (ret < 0) {
- return ret;
+ return -1;
}
wr_id = wr_id_in & RDMA_WRID_TYPE_MASK;
}
rdma->error_state = ret;
- return ret;
+ return -1;
}
/*
ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_SEND_CONTROL, NULL);
if (ret < 0) {
error_report("rdma migration: send polling control error");
+ return -1;
}
- return ret;
+ return 0;
}
/*
if (ret < 0) {
error_report("rdma migration: recv polling control error!");
- return ret;
+ return -1;
}
network_to_control((void *) rdma->wr_data[idx].control);
RDMA_CONTROL_READY,
RDMA_WRID_READY);
if (ret < 0) {
- return ret;
+ return -1;
}
}
if (ret) {
error_report("rdma migration: error posting"
" extra control recv for anticipated result!");
- return ret;
+ return -1;
}
}
ret = qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY);
if (ret) {
error_report("rdma migration: error posting first control recv!");
- return ret;
+ return -1;
}
/*
if (ret < 0) {
error_report("Failed to send control buffer!");
- return ret;
+ return -1;
}
/*
trace_qemu_rdma_exchange_send_issue_callback();
ret = callback(rdma);
if (ret < 0) {
- return ret;
+ return -1;
}
}
resp->type, RDMA_WRID_DATA);
if (ret < 0) {
- return ret;
+ return -1;
}
qemu_rdma_move_header(rdma, RDMA_WRID_DATA, resp);
if (ret < 0) {
error_report("Failed to send control buffer!");
- return ret;
+ return -1;
}
/*
expecting, RDMA_WRID_READY);
if (ret < 0) {
- return ret;
+ return -1;
}
qemu_rdma_move_header(rdma, RDMA_WRID_READY, head);
ret = qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY);
if (ret) {
error_report("rdma migration: error posting second control recv!");
- return ret;
+ return -1;
}
return 0;
"block %d chunk %" PRIu64
" current %" PRIu64 " len %" PRIu64 " %d",
current_index, chunk, sge.addr, length, rdma->nb_sent);
- return ret;
+ return -1;
}
}
ret = qemu_rdma_exchange_send(rdma, &head, (uint8_t *) ®,
&resp, ®_result_idx, NULL);
if (ret < 0) {
- return ret;
+ return -1;
}
/* try to overlap this single registration with the one we sent. */
if (ret < 0) {
error_report("rdma migration: failed to make "
"room in full send queue!");
- return ret;
+ return -1;
}
goto retry;
rdma->current_index, rdma->current_addr, rdma->current_length);
if (ret < 0) {
- return ret;
+ return -1;
}
if (ret == 0) {
if (!qemu_rdma_buffer_mergeable(rdma, current_addr, len)) {
ret = qemu_rdma_write_flush(rdma);
if (ret) {
- return ret;
+ return -1;
}
rdma->current_length = 0;
rdma->current_addr = current_addr;
rdma->error_state = ret;
qemu_rdma_cleanup(rdma);
g_free(rdma_return_path);
- return ret;
+ return -1;
}
static int dest_ram_sort_func(const void *a, const void *b)