[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 52/53] migration/rdma: Use error_report() & friends instea
From: |
Fabiano Rosas |
Subject: |
Re: [PATCH v2 52/53] migration/rdma: Use error_report() & friends instead of stderr |
Date: |
Fri, 29 Sep 2023 12:36:20 -0300 |
Markus Armbruster <armbru@redhat.com> writes:
> error_report() obeys -msg, reports the current error location if any,
> and reports to the current monitor if any. Reporting to stderr
> directly with fprintf() or perror() is wrong, because it loses all
> this.
>
> Fix the offenders. Bonus: resolves a FIXME about problematic use of
> errno.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> migration/rdma.c | 44 +++++++++++++++++++++-----------------------
> 1 file changed, 21 insertions(+), 23 deletions(-)
>
> diff --git a/migration/rdma.c b/migration/rdma.c
> index 54b59d12b1..dba0802fca 100644
> --- a/migration/rdma.c
> +++ b/migration/rdma.c
> @@ -877,12 +877,12 @@ static int qemu_rdma_broken_ipv6_kernel(struct
> ibv_context *verbs, Error **errp)
>
> if (roce_found) {
> if (ib_found) {
> - fprintf(stderr, "WARN: migrations may fail:"
> - " IPv6 over RoCE / iWARP in linux"
> - " is broken. But since you appear to have a"
> - " mixed RoCE / IB environment, be sure to
> only"
> - " migrate over the IB fabric until the
> kernel "
> - " fixes the bug.\n");
> + warn_report("WARN: migrations may fail:"
> + " IPv6 over RoCE / iWARP in linux"
> + " is broken. But since you appear to have a"
> + " mixed RoCE / IB environment, be sure to only"
> + " migrate over the IB fabric until the kernel "
> + " fixes the bug.");
Won't this become "warning: WARN:"?
> } else {
> error_setg(errp, "RDMA ERROR: "
> "You only have RoCE / iWARP devices in your
> systems"
> @@ -1418,12 +1418,8 @@ static int qemu_rdma_unregister_waiting(RDMAContext
> *rdma)
> block->remote_keys[chunk] = 0;
>
> if (ret != 0) {
> - /*
> - * FIXME perror() is problematic, bcause ibv_dereg_mr() is
> - * not documented to set errno. Will go away later in
> - * this series.
> - */
> - perror("unregistration chunk failed");
> + error_report("unregistration chunk failed: %s",
> + strerror(ret));
Doesn't seem to fix the issue, ret might still not be an errno. Am I
missing something?
> return -1;
> }
- [PATCH v2 41/53] migration/rdma: Convert qemu_rdma_write() to Error, (continued)
- [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, 2023/09/28
- [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
- Re: [PATCH v2 52/53] migration/rdma: Use error_report() & friends instead of stderr,
Fabiano Rosas <=
- [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
- [PATCH v2 27/53] migration/rdma: Replace int error_state by bool errored, Markus Armbruster, 2023/09/28
- [PATCH v2 16/53] migration/rdma: Fix or document problematic uses of errno, Markus Armbruster, 2023/09/28
- [PATCH v2 14/53] migration/rdma: Make qemu_rdma_buffer_mergeable() return bool, Markus Armbruster, 2023/09/28
- [PATCH v2 44/53] migration/rdma: Convert qemu_rdma_alloc_pd_cq() to Error, Markus Armbruster, 2023/09/28