qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: minyard@acm.org, qemu-devel@nongnu.org
Cc: Corey Minyard <cminyard@mvista.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-sockets: Add error to non-blocking connect handler
Date: Wed, 08 Oct 2014 00:15:36 +0200	[thread overview]
Message-ID: <54346608.7040509@redhat.com> (raw)
In-Reply-To: <1412618363-14968-3-git-send-email-minyard@acm.org>

Il 06/10/2014 19:59, minyard@acm.org ha scritto:
> +        error_setg_errno(&err, errno, "Error connecting to socket");
>          closesocket(s->fd);
>          s->fd = rc;
>      }
> @@ -257,9 +259,14 @@ static void wait_for_connect(void *opaque)
>          while (s->current_addr->ai_next != NULL && s->fd < 0) {
>              s->current_addr = s->current_addr->ai_next;
>              s->fd = inet_connect_addr(s->current_addr, &in_progress, s, NULL);
> +            if (s->fd < 0) {
> +                error_free(err);
> +                err = NULL;
> +                error_setg_errno(&err, errno, "Unable to start socket connect");

So the above snippet is the actual errors that are passed here:

> +static void check_report_connect_error(CharDriverState *chr, const char *str,
> +                                       Error *err)
>  {
>      TCPCharDriver *s = chr->opaque;
>  
>      if (!s->connect_err_reported) {
> -        error_report("%s char device %s\n", str, chr->label);
> +        error_report("%s char device %s: %s\n", str, chr->label,
> +                     error_get_pretty(err));


If you just make it

error_report("%s: %s", chr->label, error_get_pretty(err));

we still get a good error.  It would arguably be better, since there's
no duplication, except that it doesn't mention character devices
anymore.  But something like "serial0: error connecting to socket" is a
decent error.

Thanks,

Paolo

      reply	other threads:[~2014-10-07 22:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 17:59 [Qemu-devel] [PATCH 0/2] qemu-char: Clean up socket reporting minyard
2014-10-06 17:59 ` [Qemu-devel] [PATCH 1/2] qemu-char: Fix reconnect socket error reporting minyard
2014-10-06 18:36   ` Eric Blake
2014-10-06 19:52     ` Corey Minyard
2014-10-06 20:36     ` Paolo Bonzini
2014-10-08  6:56   ` Markus Armbruster
2014-10-06 17:59 ` [Qemu-devel] [PATCH 2/2] qemu-sockets: Add error to non-blocking connect handler minyard
2014-10-07 22:15   ` Paolo Bonzini [this message]

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=54346608.7040509@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cminyard@mvista.com \
    --cc=minyard@acm.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).