On 16.09.25 16:57, Peter Xu wrote:
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é <[email protected]>
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
---
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.
Agree, sounds good.
--
Best regards,
Vladimir