qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 12/52] migration/rdma: Drop qemu_rdma_search_ram_block() erro


From: Fabiano Rosas
Subject: Re: [PATCH 12/52] migration/rdma: Drop qemu_rdma_search_ram_block() error handling
Date: Mon, 18 Sep 2023 14:35:26 -0300

Markus Armbruster <armbru@redhat.com> writes:

> qemu_rdma_search_ram_block() can't fail.  Return void, and drop the
> unreachable error handling.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  migration/rdma.c | 22 ++++++++--------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 2b0f9d52d8..98520a42b4 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -1234,12 +1234,12 @@ static int qemu_rdma_reg_whole_ram_blocks(RDMAContext 
> *rdma)
>   *
>   * This search cannot fail or the migration will fail.
>   */

This comment can be removed as well.

> -static int qemu_rdma_search_ram_block(RDMAContext *rdma,
> -                                      uintptr_t block_offset,
> -                                      uint64_t offset,
> -                                      uint64_t length,
> -                                      uint64_t *block_index,
> -                                      uint64_t *chunk_index)
> +static void qemu_rdma_search_ram_block(RDMAContext *rdma,
> +                                       uintptr_t block_offset,
> +                                       uint64_t offset,
> +                                       uint64_t length,
> +                                       uint64_t *block_index,
> +                                       uint64_t *chunk_index)
>  {
>      uint64_t current_addr = block_offset + offset;
>      RDMALocalBlock *block = g_hash_table_lookup(rdma->blockmap,
> @@ -1251,8 +1251,6 @@ static int qemu_rdma_search_ram_block(RDMAContext *rdma,
>      *block_index = block->index;
>      *chunk_index = ram_chunk_index(block->local_host_addr,
>                  block->local_host_addr + (current_addr - block->offset));
> -
> -    return 0;
>  }
>  
>  /*
> @@ -2321,12 +2319,8 @@ static int qemu_rdma_write(QEMUFile *f, RDMAContext 
> *rdma,
>          rdma->current_length = 0;
>          rdma->current_addr = current_addr;
>  
> -        ret = qemu_rdma_search_ram_block(rdma, block_offset,
> -                                         offset, len, &index, &chunk);
> -        if (ret) {
> -            error_report("ram block search failed");
> -            return ret;
> -        }
> +        qemu_rdma_search_ram_block(rdma, block_offset,
> +                                   offset, len, &index, &chunk);
>          rdma->current_index = index;
>          rdma->current_chunk = chunk;
>      }



reply via email to

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