From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UST3P-0005FJ-VA for qemu-devel@nongnu.org; Wed, 17 Apr 2013 10:09:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UST3N-00077D-An for qemu-devel@nongnu.org; Wed, 17 Apr 2013 10:09:43 -0400 Received: from mail-qa0-f42.google.com ([209.85.216.42]:33677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UST3N-000775-5h for qemu-devel@nongnu.org; Wed, 17 Apr 2013 10:09:41 -0400 Received: by mail-qa0-f42.google.com with SMTP id dx4so1464317qab.15 for ; Wed, 17 Apr 2013 07:09:40 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <516EAD17.3080202@redhat.com> Date: Wed, 17 Apr 2013 16:09:27 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1366172418-8729-1-git-send-email-mrhines@linux.vnet.ibm.com> <1366172418-8729-5-git-send-email-mrhines@linux.vnet.ibm.com> <516E856B.7040003@redhat.com> In-Reply-To: <516E856B.7040003@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL v3 4/7] rdma: core logic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: aliguori@us.ibm.com, quintela@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com 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