qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 07/22] migration: Add an ability to ignore shared


From: Peter Maydell
Subject: Re: [Qemu-devel] [PULL 07/22] migration: Add an ability to ignore shared RAM blocks
Date: Fri, 8 Mar 2019 17:12:41 +0000

On Wed, 6 Mar 2019 at 11:55, Dr. David Alan Gilbert (git)
<address@hidden> wrote:
>
> From: Yury Kotov <address@hidden>
>
> If ignore-shared capability is set then skip shared RAMBlocks during the
> RAM migration.
> Also, move qemu_ram_foreach_migratable_block (and rename) to the
> migration code, because it requires access to the migration capabilities.
>

> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -644,7 +644,7 @@ static int qemu_rdma_init_ram_blocks(RDMAContext *rdma)
>
>      assert(rdma->blockmap == NULL);
>      memset(local, 0, sizeof *local);
> -    qemu_ram_foreach_migratable_block(qemu_rdma_init_one_block, rdma);
> +    foreach_not_ignored_block(qemu_rdma_init_one_block, rdma);
>      trace_qemu_rdma_init_ram_blocks(local->nb_blocks);
>      rdma->dest_blocks = g_new0(RDMADestBlock,
>                                 rdma->local_ram_blocks.nb_blocks);

Hi. This change causes Coverity to gripe (CID 1399413) because
the return value from foreach_not_ignored_block() is ignored
here but it is checked on every other use of the function.

This is one of those Coverity errors where it's just using a
sometimes-wrong heuristic, so we could just mark it as a false
positive (AFAICT qemu_rdma_init_one_block() always returns 0),
but OTOH rdma_add_block() and qemu_rdma_init_one_block()
carefully pipe through a return value, so maybe it's worth assert()ing
in case somebody changes rdma_add_block() to maybe fail later?

I don't think there's much in it -- let me know if you just want
me to mark the issue as a false positive.

thanks
-- PMM



reply via email to

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