From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, "Fam Zheng" <fam@euphon.net>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Stefan Weil" <sw@weilnetz.de>,
qemu-block@nongnu.org
Subject: Re: [RFC PATCH 1/2] system/os-win32: Remove unused Error** argument in qemu_socket_unselect
Date: Tue, 15 Jul 2025 09:54:38 +0100 [thread overview]
Message-ID: <aHYXP3XNpZVUug9c@redhat.com> (raw)
In-Reply-To: <20250715083517.47556-2-philmd@linaro.org>
On Tue, Jul 15, 2025 at 10:35:16AM +0200, Philippe Mathieu-Daudé wrote:
> @errp is always NULL. Remove it, as unused.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/system/os-win32.h | 2 +-
> io/channel-socket.c | 4 ++--
> util/oslib-win32.c | 6 +++---
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/system/os-win32.h b/include/system/os-win32.h
> index 3aa6cee4c23..40712a948c3 100644
> --- a/include/system/os-win32.h
> +++ b/include/system/os-win32.h
> @@ -172,7 +172,7 @@ static inline void qemu_funlockfile(FILE *f)
> bool qemu_socket_select(int sockfd, WSAEVENT hEventObject,
> long lNetworkEvents, Error **errp);
>
> -bool qemu_socket_unselect(int sockfd, Error **errp);
> +bool qemu_socket_unselect(int sockfd);
>
> /* We wrap all the sockets functions so that we can set errno based on
> * WSAGetLastError(), and use file-descriptors instead of SOCKET.
> diff --git a/io/channel-socket.c b/io/channel-socket.c
> index 3b7ca924ff3..6ee6217e7ac 100644
> --- a/io/channel-socket.c
> +++ b/io/channel-socket.c
> @@ -454,7 +454,7 @@ static void qio_channel_socket_finalize(Object *obj)
> }
> }
> #ifdef WIN32
> - qemu_socket_unselect(ioc->fd, NULL);
> + qemu_socket_unselect(ioc->fd);
> #endif
It seems to me like this code should instead be using
&error_warn, because the errors are still relevant and
potentially a sign of a bug, but we don't want to stop
this finalization path.
> close(ioc->fd);
> ioc->fd = -1;
> @@ -890,7 +890,7 @@ qio_channel_socket_close(QIOChannel *ioc,
>
> if (sioc->fd != -1) {
> #ifdef WIN32
> - qemu_socket_unselect(sioc->fd, NULL);
> + qemu_socket_unselect(sioc->fd);
> #endif
Here too, we don't want to stop the close operation early,
as we need to 'close()' the FD, but we should diagnose
the failure none the less
> if (qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_LISTEN)) {
> socket_listen_cleanup(sioc->fd, errp);
> diff --git a/util/oslib-win32.c b/util/oslib-win32.c
> index b7351634ece..7ac3482d449 100644
> --- a/util/oslib-win32.c
> +++ b/util/oslib-win32.c
> @@ -180,7 +180,7 @@ static int socket_error(void)
> void qemu_socket_set_block(int fd)
> {
> unsigned long opt = 0;
> - qemu_socket_unselect(fd, NULL);
> + qemu_socket_unselect(fd);
> ioctlsocket(fd, FIONBIO, &opt);
> }
>
> @@ -313,9 +313,9 @@ bool qemu_socket_select(int sockfd, WSAEVENT hEventObject,
> return true;
> }
>
> -bool qemu_socket_unselect(int sockfd, Error **errp)
> +bool qemu_socket_unselect(int sockfd)
> {
> - return qemu_socket_select(sockfd, NULL, 0, errp);
> + return qemu_socket_select(sockfd, NULL, 0, NULL);
> }
>
> int qemu_socketpair(int domain, int type, int protocol, int sv[2])
> --
> 2.49.0
>
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 :|
next prev parent reply other threads:[~2025-07-15 8:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 8:35 [RFC PATCH 0/2] system/win32: Remove unused Error argument in qemu_socket_[un]select() Philippe Mathieu-Daudé
2025-07-15 8:35 ` [RFC PATCH 1/2] system/os-win32: Remove unused Error** argument in qemu_socket_unselect Philippe Mathieu-Daudé
2025-07-15 8:44 ` Manos Pitsidianakis
2025-07-15 8:54 ` Daniel P. Berrangé [this message]
2025-07-16 10:41 ` Markus Armbruster
2025-07-16 10:50 ` Daniel P. Berrangé
2025-07-16 11:01 ` Markus Armbruster
2025-07-15 8:35 ` [RFC PATCH 2/2] system/os-win32: Remove unused Error** argument in qemu_socket_select Philippe Mathieu-Daudé
2025-07-15 8:44 ` Manos Pitsidianakis
2025-07-15 8:56 ` Daniel P. Berrangé
2025-07-16 10:48 ` Markus Armbruster
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=aHYXP3XNpZVUug9c@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=fam@euphon.net \
--cc=marcandre.lureau@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/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.