qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 11/52] migration/rdma: Drop rdma_add_block() error handling


From: Zhijian Li (Fujitsu)
Subject: Re: [PATCH 11/52] migration/rdma: Drop rdma_add_block() error handling
Date: Thu, 21 Sep 2023 09:39:51 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0


On 18/09/2023 22:41, Markus Armbruster wrote:
> rdma_add_block() can't fail.  Return void, and drop the unreachable
> error handling.
> 
> Signed-off-by: Markus Armbruster<armbru@redhat.com>
> ---
>   migration/rdma.c | 30 +++++++++---------------------
>   1 file changed, 9 insertions(+), 21 deletions(-)
> 

[...]

>    * during dynamic page registration.
>    */
> -static int qemu_rdma_init_ram_blocks(RDMAContext *rdma)
> +static void qemu_rdma_init_ram_blocks(RDMAContext *rdma)
>   {
>       RDMALocalBlocks *local = &rdma->local_ram_blocks;
>       int ret;
> @@ -646,14 +645,11 @@ static int qemu_rdma_init_ram_blocks(RDMAContext *rdma)
>       assert(rdma->blockmap == NULL);
>       memset(local, 0, sizeof *local);
>       ret = foreach_not_ignored_block(qemu_rdma_init_one_block, rdma);
> -    if (ret) {
> -        return ret;
> -    }
> +    assert(!ret);

Why we still need a new assert(), can we remove the ret together.

     foreach_not_ignored_block(qemu_rdma_init_one_block, rdma);
     trace_qemu_rdma_init_ram_blocks(local->nb_blocks);


Thanks
Zhijian

>       trace_qemu_rdma_init_ram_blocks(local->nb_blocks);

reply via email to

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