migration/rdma: Check qemu_rdma_init_one_block

Actually it can't fail at the moment, but Coverity moans that
it's the only place it's not checked, and it's an easy check.

Reported-by: Coverity (CID 1399413)
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Dr. David Alan Gilbert 2019-03-08 18:51:24 +00:00 committed by Juan Quintela
parent d2f1d29b95
commit 281496bb8a
1 changed files with 5 additions and 1 deletions

View File

@ -641,10 +641,14 @@ static int qemu_rdma_init_one_block(RAMBlock *rb, void *opaque)
static int qemu_rdma_init_ram_blocks(RDMAContext *rdma)
{
RDMALocalBlocks *local = &rdma->local_ram_blocks;
int ret;
assert(rdma->blockmap == NULL);
memset(local, 0, sizeof *local);
foreach_not_ignored_block(qemu_rdma_init_one_block, rdma);
ret = foreach_not_ignored_block(qemu_rdma_init_one_block, rdma);
if (ret) {
return ret;
}
trace_qemu_rdma_init_ram_blocks(local->nb_blocks);
rdma->dest_blocks = g_new0(RDMADestBlock,
rdma->local_ram_blocks.nb_blocks);