From: Markus Armbruster <armbru@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, berrange@redhat.com,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] chardev: report the handshake error
Date: Wed, 10 May 2023 11:31:40 +0200 [thread overview]
Message-ID: <877ctg7csj.fsf@pond.sub.org> (raw)
In-Reply-To: <20230510072531.3937189-1-marcandre.lureau@redhat.com> (marcandre lureau's message of "Wed, 10 May 2023 11:25:31 +0400")
marcandre.lureau@redhat.com writes:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> This can help to debug connection issues.
>
> Related to:
> https://bugzilla.redhat.com/show_bug.cgi?id=2196182
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> chardev/char-socket.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
> index 8c58532171..e8e3a743d5 100644
> --- a/chardev/char-socket.c
> +++ b/chardev/char-socket.c
> @@ -742,8 +742,12 @@ static void tcp_chr_websock_handshake(QIOTask *task, gpointer user_data)
> {
> Chardev *chr = user_data;
> SocketChardev *s = user_data;
> + Error *err = NULL;
>
> - if (qio_task_propagate_error(task, NULL)) {
> + if (qio_task_propagate_error(task, &err)) {
> + error_reportf_err(err,
> + "websock handshake of character device %s failed: ",
> + chr->label);
Code smell: reports an error without failing the function.
Should it be a warning instead?
> tcp_chr_disconnect(chr);
> } else {
> if (s->do_telnetopt) {
> @@ -778,8 +782,12 @@ static void tcp_chr_tls_handshake(QIOTask *task,
> {
> Chardev *chr = user_data;
> SocketChardev *s = user_data;
> + Error *err = NULL;
>
> - if (qio_task_propagate_error(task, NULL)) {
> + if (qio_task_propagate_error(task, &err)) {
> + error_reportf_err(err,
> + "TLS handshake of character device %s failed: ",
> + chr->label);
> tcp_chr_disconnect(chr);
> } else {
> if (s->is_websock) {
Likewise.
next prev parent reply other threads:[~2023-05-10 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-10 7:25 [PATCH] chardev: report the handshake error marcandre.lureau
2023-05-10 9:21 ` Daniel P. Berrangé
2023-05-10 9:31 ` Markus Armbruster [this message]
2023-05-10 9:33 ` Marc-André Lureau
2023-05-10 9:38 ` Daniel P. Berrangé
2023-05-10 9:48 ` Marc-André Lureau
2023-05-10 10:34 ` Markus Armbruster
2023-05-10 10:43 ` Daniel P. Berrangé
2023-05-10 12:33 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877ctg7csj.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.