[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 30/53] migration/rdma: Plug a memory leak and improve a messag
From: |
Markus Armbruster |
Subject: |
[PATCH v2 30/53] migration/rdma: Plug a memory leak and improve a message |
Date: |
Thu, 28 Sep 2023 15:19:56 +0200 |
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 c57692e5a3..54f4a917be 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2617,8 +2617,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
- [PATCH v2 13/53] migration/rdma: Drop qemu_rdma_search_ram_block() error handling, (continued)
- [PATCH v2 13/53] migration/rdma: Drop qemu_rdma_search_ram_block() error handling, Markus Armbruster, 2023/09/28
- [PATCH v2 06/53] migration/rdma: Fix unwanted integer truncation, Markus Armbruster, 2023/09/28
- [PATCH v2 29/53] migration/rdma: Check negative error values the same way everywhere, Markus Armbruster, 2023/09/28
- [PATCH v2 41/53] migration/rdma: Convert qemu_rdma_write() to Error, Markus Armbruster, 2023/09/28
- [PATCH v2 34/53] migration/rdma: Drop "@errp is clear" guards around error_setg(), Markus Armbruster, 2023/09/28
- [PATCH v2 21/53] migration/rdma: Fix qemu_get_cm_event_timeout() to always set error, Markus Armbruster, 2023/09/28
- [PATCH v2 20/53] migration/rdma: Fix qemu_rdma_broken_ipv6_kernel() to set error, Markus Armbruster, 2023/09/28
- [PATCH v2 33/53] migration/rdma: Fix error handling around rdma_getaddrinfo(), Markus Armbruster, 2023/09/28
- [PATCH v2 30/53] migration/rdma: Plug a memory leak and improve a message,
Markus Armbruster <=
- [PATCH v2 25/53] migration/rdma: Return -1 instead of negative errno code, Markus Armbruster, 2023/09/28
- [PATCH v2 35/53] migration/rdma: Convert qemu_rdma_exchange_recv() to Error, Markus Armbruster, 2023/09/28
- [PATCH v2 11/53] migration/rdma: Eliminate error_propagate(), Markus Armbruster, 2023/09/28
- [PATCH v2 52/53] migration/rdma: Use error_report() & friends instead of stderr, Markus Armbruster, 2023/09/28
- [PATCH v2 22/53] migration/rdma: Drop dead qemu_rdma_data_init() code for !@host_port, Markus Armbruster, 2023/09/28
- [PATCH v2 45/53] migration/rdma: Silence qemu_rdma_resolve_host(), Markus Armbruster, 2023/09/28
- [PATCH v2 40/53] migration/rdma: Convert qemu_rdma_write_one() to Error, Markus Armbruster, 2023/09/28
- [PATCH v2 50/53] migration/rdma: Silence qemu_rdma_register_and_get_keys(), Markus Armbruster, 2023/09/28