qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]