All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, peterx@redhat.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Stefano Garzarella <sgarzare@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Michael Roth <michael.roth@amd.com>,
	Kostiantyn Kostiuk <kkostiuk@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, Stefan Weil <sw@weilnetz.de>,
	Coiby Xu <Coiby.Xu@gmail.com>
Subject: Re: [PATCH 04/10] util: drop qemu_socket_set_nonblock()
Date: Fri, 12 Sep 2025 15:51:50 +0100	[thread overview]
Message-ID: <aMQzhtn14Q4wZ-79@redhat.com> (raw)
In-Reply-To: <719b1b6e-524e-4993-9977-cbceaff2a776@yandex-team.ru>

On Wed, Sep 10, 2025 at 09:52:40PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> On 10.09.25 21:15, Daniel P. Berrangé wrote:
> > On Wed, Sep 10, 2025 at 08:55:57PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > > On 10.09.25 12:44, Daniel P. Berrangé wrote:
> > > > > @@ -36,7 +37,11 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel,
> > > > >            g_warning("error converting fd to gsocket: %s", strerror(errno));
> > > > >            goto out;
> > > > >        }
> > > > > -    qemu_socket_set_nonblock(client_fd);
> > > > > +    if (!qemu_set_blocking(client_fd, false, &err)) {
> > > > > +        g_warning("errer: %s", error_get_pretty(err));
> > > > s/errer/error/
> > > > 
> > > > 
> > > > This is a pre-existing problem, but none of this code should be using
> > > > g_warning. g_printerr() should have been used for printing error
> > > > messages. I'm not expecting you to fix that, just an observation.
> > > 
> > > 
> > > Why not g_error()? I see some g_warnings in qga code a correct "warnings", not "errors".. And if we use sometimes g_warning, the g_error is more correct pair for it.
> > > 
> > > Or we don't want any of g_error / g_warning in QEMU code?
> > 
> > g_error will call abort() after printing the message, which will
> > prevent graceful cleanup and result in a core file, so is not
> > very desirable to use.
> 
> Oh, right, I was stupid)
> 
> > 
> > g_warning will also turn into g_error if G_DEBUG=fatal-warnings
> > is set.
> > 
> > We really just want a plain message printed on the console with
> > no side effects, and g_printerr gives us that.
> > 
> > 
> 
> Still, it's strange for me, that we just not use error_reprot()/warn_report() everywhere.

Those would be viable alternatives too. Basically anything is better
than 'g_warning' for this scenario :-)

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2025-09-12 14:52 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03  9:44 [PATCH 00/10] io: deal with blocking/non-blocking fds Vladimir Sementsov-Ogievskiy
2025-09-03  9:44 ` [PATCH 01/10] io/channel: document how qio_channel_readv_full() handles fds Vladimir Sementsov-Ogievskiy
2025-09-09  8:34   ` Daniel P. Berrangé
2025-09-03  9:44 ` [PATCH 02/10] char-socket: rework tcp_chr_recv() Vladimir Sementsov-Ogievskiy
2025-09-08 21:53   ` Peter Xu
2025-09-09  7:49     ` Vladimir Sementsov-Ogievskiy
2025-09-09  8:38   ` Daniel P. Berrangé
2025-09-09  8:46     ` Vladimir Sementsov-Ogievskiy
2025-09-03  9:44 ` [PATCH 03/10] util: add qemu_set_blocking() function Vladimir Sementsov-Ogievskiy
2025-09-08 22:02   ` Peter Xu
2025-09-09  7:51     ` Vladimir Sementsov-Ogievskiy
2025-09-09  8:59   ` Daniel P. Berrangé
2025-09-03  9:44 ` [PATCH 04/10] util: drop qemu_socket_set_nonblock() Vladimir Sementsov-Ogievskiy
2025-09-08 22:16   ` Peter Xu
2025-09-09  8:19     ` Vladimir Sementsov-Ogievskiy
2025-09-10  9:41       ` Daniel P. Berrangé
2025-09-10 10:32         ` Vladimir Sementsov-Ogievskiy
2025-09-10  9:44   ` Daniel P. Berrangé
2025-09-10 10:33     ` Vladimir Sementsov-Ogievskiy
2025-09-10 15:30       ` Vladimir Sementsov-Ogievskiy
2025-09-10 17:55     ` Vladimir Sementsov-Ogievskiy
2025-09-10 18:15       ` Daniel P. Berrangé
2025-09-10 18:52         ` Vladimir Sementsov-Ogievskiy
2025-09-12 14:51           ` Daniel P. Berrangé [this message]
2025-09-03  9:44 ` [PATCH 05/10] util: drop qemu_socket_try_set_nonblock() Vladimir Sementsov-Ogievskiy
2025-09-09  0:09   ` Peter Xu
2025-09-03  9:44 ` [PATCH 06/10] util: drop qemu_socket_set_block() Vladimir Sementsov-Ogievskiy
2025-09-03  9:44 ` [PATCH 07/10] use qemu_set_blocking instead of g_unix_set_fd_nonblocking Vladimir Sementsov-Ogievskiy
2025-09-09  9:00   ` Daniel P. Berrangé
2025-09-09  9:11     ` Vladimir Sementsov-Ogievskiy
2025-09-09  9:15       ` Daniel P. Berrangé
2025-09-09  9:50         ` Vladimir Sementsov-Ogievskiy
2025-09-10  9:32           ` Daniel P. Berrangé
2025-09-09 14:24   ` Stefan Hajnoczi
2025-09-03  9:44 ` [PATCH 08/10] oslib-posix: add qemu_fds_set_blocking() helper Vladimir Sementsov-Ogievskiy
2025-09-03  9:48   ` Vladimir Sementsov-Ogievskiy
2025-09-10  9:52   ` Daniel P. Berrangé
2025-09-10 10:42     ` Vladimir Sementsov-Ogievskiy
2025-09-03  9:44 ` [PATCH 09/10] qio_channel_readv_full(): move setting fd blocking to callers Vladimir Sementsov-Ogievskiy
2025-09-03  9:44 ` [PATCH 10/10] migration/qemu-file: don't make incoming fds blocking again Vladimir Sementsov-Ogievskiy
2025-09-03  9:47   ` Vladimir Sementsov-Ogievskiy
2025-09-04 14:35 ` [PATCH 00/10] io: deal with blocking/non-blocking fds Lei Yang
2025-09-09  8:12 ` Vladimir Sementsov-Ogievskiy
2025-09-09 14:25   ` Stefan Hajnoczi

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=aMQzhtn14Q4wZ-79@redhat.com \
    --to=berrange@redhat.com \
    --cc=Coiby.Xu@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=kkostiuk@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=sw@weilnetz.de \
    --cc=vsementsov@yandex-team.ru \
    /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.