[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 29/52] migration/rdma: Plug a memory leak and improve a messa
From: |
Zhijian Li (Fujitsu) |
Subject: |
Re: [PATCH 29/52] migration/rdma: Plug a memory leak and improve a message |
Date: |
Mon, 25 Sep 2023 06:31:24 +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:
> When migration capability @rdma-pin-all is true, but the server cannot
> honor it, qemu_rdma_connect() calls macro ERROR(), then returns
> success.
>
> ERROR() sets an error. Since qemu_rdma_connect() returns success, its
> caller rdma_start_outgoing_migration() duly assumes @errp is still
> clear. The Error object leaks.
>
> ERROR() additionally reports the situation to the user as an error:
>
> RDMA ERROR: Server cannot support pinning all memory. Will register
> memory dynamically.
>
> Is this an error or not? It actually isn't; we disable @rdma-pin-all
> and carry on. "Correcting" the user's configuration decisions that
> way feels problematic, but that's a topic for another day.
>
> Replace ERROR() by warn_report(). This plugs the memory leak, and
> emits a clearer message to the user.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> migration/rdma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 6c643a1b30..d52de857c5 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -2586,8 +2586,8 @@ static int qemu_rdma_connect(RDMAContext *rdma, bool
> return_path,
> * and disable them otherwise.
> */
> if (rdma->pin_all && !(cap.flags & RDMA_CAPABILITY_PIN_ALL)) {
> - ERROR(errp, "Server cannot support pinning all memory. "
> - "Will register memory dynamically.");
> + warn_report("RDMA: Server cannot support pinning all memory. "
> + "Will register memory dynamically.");
> rdma->pin_all = false;
> }
>
- Re: [PATCH 43/52] migration/rdma: Convert qemu_rdma_alloc_pd_cq() to Error, (continued)
[PATCH 18/52] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error, Markus Armbruster, 2023/09/18
[PATCH 31/52] migration/rdma: Retire macro ERROR(), Markus Armbruster, 2023/09/18
[PATCH 44/52] migration/rdma: Silence qemu_rdma_resolve_host(), Markus Armbruster, 2023/09/18
[PATCH 29/52] migration/rdma: Plug a memory leak and improve a message, Markus Armbruster, 2023/09/18
- Re: [PATCH 29/52] migration/rdma: Plug a memory leak and improve a message,
Zhijian Li (Fujitsu) <=
[PATCH 08/52] migration/rdma: Fix qemu_rdma_accept() to return failure on errors, Markus Armbruster, 2023/09/18
[PATCH 24/52] migration/rdma: Return -1 instead of negative errno code, Markus Armbruster, 2023/09/18
[PATCH 42/52] migration/rdma: Convert qemu_rdma_post_recv_control() to Error, Markus Armbruster, 2023/09/18
[PATCH 35/52] migration/rdma: Convert qemu_rdma_exchange_send() to Error, Markus Armbruster, 2023/09/18