[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v4 08/11] rdma: core logic
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PULL v4 08/11] rdma: core logic |
Date: |
Thu, 18 Apr 2013 09:55:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
Il 18/04/2013 01:07, address@hidden 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
- [Qemu-devel] [PULL v4 04/11] rdma: export ram_handle_compressed(), (continued)
- [Qemu-devel] [PULL v4 04/11] rdma: export ram_handle_compressed(), mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 10/11] rdma: print out throughput while debugging, mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 06/11] rdma: new QEMUFileOps hooks, mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 01/11] rdma: export yield_until_fd_readable(), mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 05/11] rdma: export qemu_fflush(), mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 07/11] rdma: introduce capability for chunk registration, mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 09/11] rdma: send pc.ram, mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 11/11] rdma: add documentation, mrhines, 2013/04/17
- [Qemu-devel] [PULL v4 08/11] rdma: core logic, mrhines, 2013/04/17
- Re: [Qemu-devel] [PULL v4 08/11] rdma: core logic, Michael S. Tsirkin, 2013/04/18