Il 17/04/2013 13:20, Orit Wasserman ha scritto: >> +/* >> + * Virtual address of the above structures used for transmitting >> + * the RAMBlock descriptions at connection-time. >> + */ >> +typedef struct RDMALocalBlocks { >> + int num_blocks; >> + RDMALocalBlock *block; >> +} RDMALocalBlocks; >> + > > Why not use some glib container? > If you need to find a block by offset it will be more simple and efficient.
I think it's okay, the num_blocks is small and static. >> +static int qemu_rdma_connect(RDMAContext *rdma, Error **errp) >> +{ >> + RDMAControlHeader head; >> + RDMACapabilities cap = { >> + .version = RDMA_CONTROL_VERSION_CURRENT, >> + .flags = 0, >> + }; >> + struct rdma_conn_param conn_param = { .initiator_depth = 2, >> + .retry_count = 5, >> + .private_data = &cap, >> + .private_data_len = sizeof(cap), >> + }; >> + struct rdma_cm_event *cm_event; >> + int ret; >> + int idx = 0; >> + int x; >> + >> + if (rdma->chunk_register_destination) { >> + printf("Server dynamic registration requested.\n"); > > Debug ? Right, please remove. >> + cap.flags |= RDMA_CAPABILITY_CHUNK_REGISTER; >> + } >> + >> + caps_to_network(&cap); >> + >> + ret = rdma_connect(rdma->cm_id, &conn_param); >> + if (ret) { >> + perror("rdma_connect"); > > Please use errp and set it ... All good catches with errp, I completely missed it in my review! Thanks, Paolo