[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/65] migration/rdma: Plug a memory leak and improve a message
From: |
Juan Quintela |
Subject: |
[PULL 37/65] migration/rdma: Plug a memory leak and improve a message |
Date: |
Wed, 11 Oct 2023 11:21:35 +0200 |
From: Markus Armbruster <armbru@redhat.com>
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>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230928132019.2544702-31-armbru@redhat.com>
---
migration/rdma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index b0125b01cf..00e3c430f4 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2637,8 +2637,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;
}
--
2.41.0
- [PULL 31/65] migration/rdma: Fix rdma_getaddrinfo() error checking, (continued)
- [PULL 31/65] migration/rdma: Fix rdma_getaddrinfo() error checking, Juan Quintela, 2023/10/11
- [PULL 34/65] migration/rdma: Replace int error_state by bool errored, Juan Quintela, 2023/10/11
- [PULL 33/65] migration/rdma: Dumb down remaining int error values to -1, Juan Quintela, 2023/10/11
- [PULL 22/65] migration/rdma: Use bool for two RDMAContext flags, Juan Quintela, 2023/10/11
- [PULL 25/65] migration/rdma: Fix io_writev(), io_readv() methods to obey contract, Juan Quintela, 2023/10/11
- [PULL 29/65] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port, Juan Quintela, 2023/10/11
- [PULL 30/65] migration/rdma: Fix QEMUFileHooks method return values, Juan Quintela, 2023/10/11
- [PULL 26/65] migration/rdma: Replace dangerous macro CHECK_ERROR_STATE(), Juan Quintela, 2023/10/11
- [PULL 32/65] migration/rdma: Return -1 instead of negative errno code, Juan Quintela, 2023/10/11
- [PULL 27/65] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error, Juan Quintela, 2023/10/11
- [PULL 37/65] migration/rdma: Plug a memory leak and improve a message,
Juan Quintela <=
- [PULL 36/65] migration/rdma: Check negative error values the same way everywhere, Juan Quintela, 2023/10/11
- [PULL 35/65] migration/rdma: Drop superfluous assignments to @ret, Juan Quintela, 2023/10/11
- [PULL 38/65] migration/rdma: Delete inappropriate error_report() in macro ERROR(), Juan Quintela, 2023/10/11
- [PULL 41/65] migration/rdma: Drop "@errp is clear" guards around error_setg(), Juan Quintela, 2023/10/11
- [PULL 43/65] migration/rdma: Convert qemu_rdma_exchange_send() to Error, Juan Quintela, 2023/10/11
- [PULL 39/65] migration/rdma: Retire macro ERROR(), Juan Quintela, 2023/10/11
- [PULL 44/65] migration/rdma: Convert qemu_rdma_exchange_get_response() to Error, Juan Quintela, 2023/10/11
- [PULL 40/65] migration/rdma: Fix error handling around rdma_getaddrinfo(), Juan Quintela, 2023/10/11
- [PULL 42/65] migration/rdma: Convert qemu_rdma_exchange_recv() to Error, Juan Quintela, 2023/10/11
- [PULL 46/65] migration/rdma: Convert qemu_rdma_write_flush() to Error, Juan Quintela, 2023/10/11