From: Peter Xu <peterx@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: berrange@redhat.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, leiyang@redhat.com,
	marcandre.lureau@redhat.com, "Eric Blake" <eblake@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	"Jagannathan Raman" <jag.raman@oracle.com>,
	"John Levon" <john.levon@nutanix.com>,
	"Thanos Makatos" <thanos.makatos@nutanix.com>,
	"Cédric Le Goater" <clg@redhat.com>, "Fam Zheng" <fam@euphon.net>,
	"Zhao Liu" <zhao1.liu@intel.com>, "Coiby Xu" <Coiby.Xu@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>
Subject: Re: [PATCH v5 04/13] handle result of qio_channel_set_blocking()
Date: Tue, 16 Sep 2025 09:57:40 -0400	[thread overview]
Message-ID: <aMls1F7VyCzE9-jg@x1.local> (raw)
In-Reply-To: <20250916131403.368343-5-vsementsov@yandex-team.ru>
On Tue, Sep 16, 2025 at 04:13:53PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Currently, we just always pass NULL as errp argument. That doesn't
> look good.
> 
> Some realizations of interface may actually report errors.
> Channel-socket realization actually either ignore or crash on
> errors, but we are going to straighten it out to always reporting
> an errp in further commits.
> 
> So, convert all callers to either handle the error (where environment
> allows) or explicitly use &error_abort.
> 
> Take also a chance to change the return value to more convenient
> bool (keeping also in mind, that underlying realizations may
> return -1 on failure, not -errno).
> 
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  block/nbd.c                      |  4 +++-
>  chardev/char-socket.c            | 20 ++++++++++++++++----
>  hw/remote/proxy.c                |  6 +++++-
>  hw/remote/remote-obj.c           |  6 +++++-
>  hw/vfio-user/proxy.c             | 11 ++++++++---
>  include/io/channel.h             |  6 +++---
>  io/channel.c                     |  4 ++--
>  nbd/server.c                     |  4 +++-
>  scsi/qemu-pr-helper.c            |  9 ++++++---
>  tests/unit/io-channel-helpers.c  |  5 +++--
>  tests/unit/test-io-channel-tls.c |  4 ++--
>  tools/i386/qemu-vmsr-helper.c    |  6 ++++--
>  ui/vnc.c                         |  2 +-
>  util/vhost-user-server.c         |  7 ++++++-
>  14 files changed, 67 insertions(+), 27 deletions(-)
No need to repost, but just to mention (if possible to be touched up when
Dan queues this..).. it's still good to always have a prefix for subject.
IMHO we can use "treewide:"; qemu started using it in a few commits.  Linux
kernel used it much more.  We can keep the trend, IMHO.
-- 
Peter Xu
next prev parent reply	other threads:[~2025-09-16 13:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 13:13 [PATCH v5 00/13] io: deal with blocking/non-blocking fds Vladimir Sementsov-Ogievskiy
2025-09-16 13:13 ` [PATCH v5 01/13] char-socket: tcp_chr_recv(): drop extra _set_(block, cloexec) Vladimir Sementsov-Ogievskiy
2025-09-16 13:13 ` [PATCH v5 02/13] char-socket: tcp_chr_recv(): add comment Vladimir Sementsov-Ogievskiy
2025-09-16 13:13 ` [PATCH v5 03/13] util: add qemu_set_blocking() function Vladimir Sementsov-Ogievskiy
2025-09-16 13:13 ` [PATCH v5 04/13] handle result of qio_channel_set_blocking() Vladimir Sementsov-Ogievskiy
2025-09-16 13:57   ` Peter Xu [this message]
2025-09-16 14:18     ` Vladimir Sementsov-Ogievskiy
2025-09-19 10:22   ` Daniel P. Berrangé
2025-09-16 13:13 ` [PATCH v5 05/13] migration: qemu_file_set_blocking(): add errp parameter Vladimir Sementsov-Ogievskiy
2025-09-16 14:02   ` Peter Xu
2025-09-16 15:38   ` Daniel P. Berrangé
2025-09-16 15:43   ` Daniel P. Berrangé
2025-09-16 13:13 ` [PATCH v5 06/13] util: drop qemu_socket_set_nonblock() Vladimir Sementsov-Ogievskiy
2025-09-16 15:47   ` Daniel P. Berrangé
2025-09-16 13:13 ` [PATCH v5 07/13] util: drop qemu_socket_try_set_nonblock() Vladimir Sementsov-Ogievskiy
2025-09-16 13:13 ` [PATCH v5 08/13] io/channel-socket: rework qio_channel_socket_copy_fds() Vladimir Sementsov-Ogievskiy
2025-09-16 13:13 ` [PATCH v5 09/13] util: drop qemu_socket_set_block() Vladimir Sementsov-Ogievskiy
2025-09-16 13:13 ` [PATCH v5 10/13] use qemu_set_blocking instead of g_unix_set_fd_nonblocking Vladimir Sementsov-Ogievskiy
2025-09-19 10:24   ` Daniel P. Berrangé
2025-09-16 13:14 ` [PATCH v5 11/13] chardev: qemu_chr_open_fd(): add errp Vladimir Sementsov-Ogievskiy
2025-09-16 13:14 ` [PATCH v5 12/13] chardev: close an fd on failure path Vladimir Sementsov-Ogievskiy
2025-09-16 13:14 ` [PATCH v5 13/13] util/vhost-user-server: vu_message_read(): improve error handling Vladimir Sementsov-Ogievskiy
2025-09-16 15:50   ` Daniel P. Berrangé
2025-09-17 10:13     ` Vladimir Sementsov-Ogievskiy
2025-09-19 10:27       ` Daniel P. Berrangé
2025-09-19 10:44         ` Vladimir Sementsov-Ogievskiy
2025-09-16 13:15 ` [PATCH v5 00/13] io: deal with blocking/non-blocking fds Vladimir Sementsov-Ogievskiy
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=aMls1F7VyCzE9-jg@x1.local \
    --to=peterx@redhat.com \
    --cc=Coiby.Xu@gmail.com \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=eblake@redhat.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=jag.raman@oracle.com \
    --cc=john.levon@nutanix.com \
    --cc=kwolf@redhat.com \
    --cc=leiyang@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=thanos.makatos@nutanix.com \
    --cc=vsementsov@yandex-team.ru \
    --cc=zhao1.liu@intel.com \
    /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).