mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 06:21:52 -06:00
migration/rdma: Drop qemu_rdma_search_ram_block() error handling
qemu_rdma_search_ram_block() can't fail. Return void, and drop the unreachable error handling. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Li Zhijian <lizhijian@fujitsu.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <20230928132019.2544702-14-armbru@redhat.com>
This commit is contained in:
parent
0610d7a1d8
commit
87e6bdabf0
1 changed files with 8 additions and 16 deletions
|
@ -1231,15 +1231,13 @@ static int qemu_rdma_reg_whole_ram_blocks(RDMAContext *rdma)
|
||||||
*
|
*
|
||||||
* Once the block is found, also identify which 'chunk' within that
|
* Once the block is found, also identify which 'chunk' within that
|
||||||
* block that the page belongs to.
|
* block that the page belongs to.
|
||||||
*
|
|
||||||
* This search cannot fail or the migration will fail.
|
|
||||||
*/
|
*/
|
||||||
static int qemu_rdma_search_ram_block(RDMAContext *rdma,
|
static void qemu_rdma_search_ram_block(RDMAContext *rdma,
|
||||||
uintptr_t block_offset,
|
uintptr_t block_offset,
|
||||||
uint64_t offset,
|
uint64_t offset,
|
||||||
uint64_t length,
|
uint64_t length,
|
||||||
uint64_t *block_index,
|
uint64_t *block_index,
|
||||||
uint64_t *chunk_index)
|
uint64_t *chunk_index)
|
||||||
{
|
{
|
||||||
uint64_t current_addr = block_offset + offset;
|
uint64_t current_addr = block_offset + offset;
|
||||||
RDMALocalBlock *block = g_hash_table_lookup(rdma->blockmap,
|
RDMALocalBlock *block = g_hash_table_lookup(rdma->blockmap,
|
||||||
|
@ -1251,8 +1249,6 @@ static int qemu_rdma_search_ram_block(RDMAContext *rdma,
|
||||||
*block_index = block->index;
|
*block_index = block->index;
|
||||||
*chunk_index = ram_chunk_index(block->local_host_addr,
|
*chunk_index = ram_chunk_index(block->local_host_addr,
|
||||||
block->local_host_addr + (current_addr - block->offset));
|
block->local_host_addr + (current_addr - block->offset));
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2341,12 +2337,8 @@ static int qemu_rdma_write(RDMAContext *rdma,
|
||||||
rdma->current_length = 0;
|
rdma->current_length = 0;
|
||||||
rdma->current_addr = current_addr;
|
rdma->current_addr = current_addr;
|
||||||
|
|
||||||
ret = qemu_rdma_search_ram_block(rdma, block_offset,
|
qemu_rdma_search_ram_block(rdma, block_offset,
|
||||||
offset, len, &index, &chunk);
|
offset, len, &index, &chunk);
|
||||||
if (ret) {
|
|
||||||
error_report("ram block search failed");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
rdma->current_index = index;
|
rdma->current_index = index;
|
||||||
rdma->current_chunk = chunk;
|
rdma->current_chunk = chunk;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue