From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPbt6-0004kc-J3 for qemu-devel@nongnu.org; Tue, 09 Apr 2013 12:59:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPbt5-0007PZ-Er for qemu-devel@nongnu.org; Tue, 09 Apr 2013 12:59:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPbt5-0007PI-7K for qemu-devel@nongnu.org; Tue, 09 Apr 2013 12:59:15 -0400 Message-ID: <5164488E.6020507@redhat.com> Date: Tue, 09 Apr 2013 18:57:50 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1365476681-31593-1-git-send-email-mrhines@linux.vnet.ibm.com> <1365476681-31593-6-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1365476681-31593-6-git-send-email-mrhines@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH RDMA support v5: 05/12] core RDMA migration logic w/ new protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mrhines@linux.vnet.ibm.com Cc: aliguori@us.ibm.com, mst@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com Il 09/04/2013 05:04, mrhines@linux.vnet.ibm.com ha scritto: > +void qemu_rdma_disable(void *opaque); > +void qemu_rdma_cleanup(void *opaque); > +int qemu_rdma_client_init(void *opaque, Error **errp, > + bool chunk_register_destination); > +int qemu_rdma_connect(void *opaque, Error **errp); > +void *qemu_rdma_data_init(const char *host_port, Error **errp); > +int qemu_rdma_server_init(void *opaque, Error **errp); > +int qemu_rdma_server_prepare(void *opaque, Error **errp); > +int qemu_rdma_drain_cq(QEMUFile *f); > +int qemu_rdma_put_buffer(void *opaque, const uint8_t *buf, > + int64_t pos, int size); > +int qemu_rdma_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size); > +int qemu_rdma_close(void *opaque); > +size_t save_rdma_page(QEMUFile *f, ram_addr_t block_offset, > + ram_addr_t offset, int cont, size_t size, bool zero); > +void *qemu_fopen_rdma(void *opaque, const char * mode); > +int qemu_rdma_get_fd(void *opaque); > +int qemu_rdma_accept(void *opaque); > +void rdma_start_outgoing_migration(void *opaque, const char *host_port, Error **errp); > +void rdma_start_incoming_migration(const char * host_port, Error **errp); > +int qemu_rdma_handle_registrations(QEMUFile *f); > +int qemu_rdma_finish_registrations(QEMUFile *f); I think you have accumulated some dead code, for example qemu_rdma_disable. Also, most of these functions can be static now. > +#else /* !defined(CONFIG_RDMA) */ > +#define NOT_CONFIGURED() do { printf("WARN: RDMA is not configured\n"); } while(0) > +#define qemu_rdma_cleanup(...) NOT_CONFIGURED() > +#define qemu_rdma_data_init(...) NOT_CONFIGURED() > +#define rdma_start_outgoing_migration(...) NOT_CONFIGURED() > +#define rdma_start_incoming_migration(...) NOT_CONFIGURED() > +#define qemu_rdma_handle_registrations(...) 0 > +#define qemu_rdma_finish_registrations(...) 0 > +#define qemu_rdma_get_buffer NULL > +#define qemu_rdma_put_buffer NULL > +#define qemu_rdma_close NULL > +#define qemu_fopen_rdma(...) NULL > +#define qemu_rdma_client_init(...) -1 > +#define qemu_rdma_client_connect(...) -1 > +#define qemu_rdma_server_init(...) -1 > +#define qemu_rdma_server_prepare(...) -1 > +#define qemu_rdma_drain_cq(...) -1 > +#define save_rdma_page(...) -ENOTSUP > + > +#endif /* CONFIG_RDMA */ > + Please leave the prototypes even if CONFIG_RDMA is not defined. This is because these symbols should not have any references when CONFIG_RDMA is not defined. The prototypes do not hurt. You should almost be there. The only functions that have some references left in arch_init.c should be save_rdma_page, qemu_rdma_drain_cq, qemu_rdma_finish_registrations. Turn these into QEMUFileOps, and there will be no undefined references even with --disable-rdma. But actually, once you get there, it could even make sense to merge rdma.c and migration-rdma.c into a single file (migration-rdma.c; put the former migration-rdma.c last so that you do not need forward declarations, we tend to avoid them). You can then eliminate the header completely! Paolo