All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Alistair Francis" <alistair.francis@xilinx.com>,
	qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
	pbonzini@redhat.com
Cc: alistair23@gmail.com
Subject: Re: [Qemu-devel] [PATCH v1 1/1] char-socket: Don't report TCP socket waiting as an error
Date: Tue, 6 Jun 2017 10:37:16 -0300	[thread overview]
Message-ID: <e340cdb9-3c97-8624-81d9-f7888f819a68@amsat.org> (raw)
In-Reply-To: <CAJ+F1CLuPkWjG3Hn8hfaxTApn6+ouqh5nJZNWSQYX1C3_HRFqA@mail.gmail.com>

On 06/06/2017 08:58 AM, Marc-André Lureau wrote:
> Hi
>
> On Mon, Jun 5, 2017 at 10:37 PM Alistair Francis <
> alistair.francis@xilinx.com> wrote:
>
>> When QEMU is waiting for a TCP socket connection it reports that message as
>> an error. This isn't an error though, so let's change the report to just
>> use qemu_log().
>>
>>
> I don't think this is a good idea, since stdout output my be mixed with
> console or other expected output.
>
> In fact, it used to be on stdout, and got moved to stderr:

This is somehow confusing. I don't think it is worth having another 
qemu_log_stderr() function rather than using error_report() but this 
very call might deserve a comment explaining this unusual use. What do 
you think?

>
> commit fdca2124adc293f84f2b7aaf0df43faa6b6bf420
> Author: Gerd Hoffmann <kraxel@redhat.com>
> Date:   Mon Jun 24 08:39:49 2013 +0200
>
>     qemu-char: print notification to stderr
>
>     Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>     Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>     Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
>
> diff --git a/qemu-char.c b/qemu-char.c
> index e3b3224886..371f6308c5 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -2666,8 +2666,8 @@ static CharDriverState *qemu_chr_open_socket_fd(int
> fd, bool do_nodelay,
>      }
>
>      if (is_listen && is_waitconnect) {
> -        printf("QEMU waiting for connection on: %s\n",
> -               chr->filename);
> +        fprintf(stderr, "QEMU waiting for connection on: %s\n",
> +                chr->filename);
>
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>> ---
>>
>>  chardev/char-socket.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
>> index ccc499cfa1..a9884fa85b 100644
>> --- a/chardev/char-socket.c
>> +++ b/chardev/char-socket.c
>> @@ -27,6 +27,7 @@
>>  #include "io/channel-tls.h"
>>  #include "qemu/error-report.h"
>>  #include "qapi/error.h"
>> +#include "qemu/log.h"
>>  #include "qapi/clone-visitor.h"
>>
>>  #include "chardev/char-io.h"
>> @@ -765,7 +766,7 @@ static int tcp_chr_wait_connected(Chardev *chr, Error
>> **errp)
>>       * in TLS and telnet cases, only wait for an accepted socket */
>>      while (!s->ioc) {
>>          if (s->is_listen) {
>> -            error_report("QEMU waiting for connection on: %s",
>> +            qemu_log("QEMU waiting for connection on: %s",
>>                           chr->filename);
>>              qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), true,
>> NULL);
>>              tcp_chr_accept(QIO_CHANNEL(s->listen_ioc), G_IO_IN, chr);
>> --
>> 2.11.0
>>
>>
>> --
> Marc-André Lureau
>

  reply	other threads:[~2017-06-06 13:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 18:34 [Qemu-devel] [PATCH v1 1/1] char-socket: Don't report TCP socket waiting as an error Alistair Francis
2017-06-05 20:12 ` Philippe Mathieu-Daudé
2017-06-06 11:58 ` Marc-André Lureau
2017-06-06 13:37   ` Philippe Mathieu-Daudé [this message]
2017-06-06 16:30     ` Alistair Francis
2017-06-06 22:14       ` Paolo Bonzini
2017-06-06 23:55         ` Alistair Francis
2017-06-07  7:19         ` Markus Armbruster
2017-06-07 23:47           ` Alistair Francis
2017-06-08  6:03             ` Markus Armbruster
2017-06-08 16:53               ` Alistair Francis
2017-06-08 17:56                 ` Markus Armbruster
2017-06-08 19:57                   ` Alistair Francis
2017-06-09  5:16                     ` Markus Armbruster
2017-06-27 18:49                       ` Alistair Francis

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=e340cdb9-3c97-8624-81d9-f7888f819a68@amsat.org \
    --to=f4bug@amsat.org \
    --cc=alistair.francis@xilinx.com \
    --cc=alistair23@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.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.