Il 18/04/2013 01:07, mrhi...@linux.vnet.ibm.com ha scritto: > +/* > + * Virtual address of the above structures used for transmitting > + * the RAMBlock descriptions at connection-time. > + * This structure is *not* transmitted. > + */ > +typedef struct RDMALocalBlocks { > + int num_blocks; > + RDMALocalBlock *block; > +} RDMALocalBlocks; > + > +/* > + * Same as above > + */ > +typedef struct RDMARemoteBlocks { > + RDMARemoteBlock *block; > + void *remote_area; > +} RDMARemoteBlocks;
block and remote_area can be reduced to a single pointer. > + if (rdma == NULL) { > + goto err; > + } > + > + ret = qemu_rdma_source_init(rdma, NULL, > + > s->enabled_capabilities[MIGRATION_CAPABILITY_X_CHUNK_REGISTER_DESTINATION]); > + > + if (ret) { > + goto err; > + } > + > + DPRINTF("qemu_rdma_source_init success\n"); > + ret = qemu_rdma_connect(rdma, NULL); The usage of error_setg is correct, but here you must pass your errp down to qemu_rdma_source_init and qemu_rdma_connect. You can then remove this: + error_setg(errp, "Error connecting using rdma! %d\n", ret); because the error was already set in the callees. Also, you should use the Error API also on the destination side, where rdma_start_incoming_migration can pass errp to qemu_rdma_dest_prepare or set it itself instead of printing to stderr. The reason is that when using a management layer stderr will be logged but not printed to the operator's console. Instead, Errors are sent on the monitor connection. The management layer(s) then pick up the error and propagate it through the various APIs until they appear in the terminal/browser/whatever. Nothing else from me. Paolo