All of lore.kernel.org
 help / color / mirror / Atom feed
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 2/2] system/os-win32: Remove unused Error** argument in qemu_socket_select
Date: Tue, 15 Jul 2025 09:56:09 +0100	[thread overview]
Message-ID: <aHYXqRUPOVbyw0mN@redhat.com> (raw)
In-Reply-To: <20250715083517.47556-3-philmd@linaro.org>

On Tue, Jul 15, 2025 at 10:35:17AM +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 +-
>  util/aio-win32.c          |  2 +-
>  util/oslib-win32.c        | 13 +++++--------
>  3 files changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/include/system/os-win32.h b/include/system/os-win32.h
> index 40712a948c3..47882bc2f49 100644
> --- a/include/system/os-win32.h
> +++ b/include/system/os-win32.h
> @@ -170,7 +170,7 @@ static inline void qemu_funlockfile(FILE *f)
>  
>  /* Helper for WSAEventSelect, to report errors */
>  bool qemu_socket_select(int sockfd, WSAEVENT hEventObject,
> -                        long lNetworkEvents, Error **errp);
> +                        long lNetworkEvents);
>  
>  bool qemu_socket_unselect(int sockfd);
>  
> diff --git a/util/aio-win32.c b/util/aio-win32.c
> index 6583d5c5f31..9c2f0fb86e7 100644
> --- a/util/aio-win32.c
> +++ b/util/aio-win32.c
> @@ -121,7 +121,7 @@ void aio_set_fd_handler(AioContext *ctx,
>  
>          QLIST_INSERT_HEAD_RCU(&ctx->aio_handlers, node, node);
>          event = event_notifier_get_handle(&ctx->notifier);
> -        qemu_socket_select(fd, event, bitmask, NULL);
> +        qemu_socket_select(fd, event, bitmask);

This should likely be &error_abort, as we never expect this
to fail AFAICT.


> diff --git a/util/oslib-win32.c b/util/oslib-win32.c
> index 7ac3482d449..fed5ab14efb 100644
> --- a/util/oslib-win32.c
> +++ b/util/oslib-win32.c
> @@ -292,21 +292,18 @@ char *qemu_get_pid_name(pid_t pid)
>  
>  
>  bool qemu_socket_select(int sockfd, WSAEVENT hEventObject,
> -                        long lNetworkEvents, Error **errp)
> +                        long lNetworkEvents)
>  {
>      SOCKET s = _get_osfhandle(sockfd);
>  
> -    if (errp == NULL) {
> -        errp = &error_warn;
> -    }

This pre-existing code should never have existed - the caller should
have decided this reporting policy by passing in &error_warn.

> -
>      if (s == INVALID_SOCKET) {
> -        error_setg(errp, "invalid socket fd=%d", sockfd);
> +        error_setg(&error_warn, "invalid socket fd=%d", sockfd);
>          return false;
>      }
>  
>      if (WSAEventSelect(s, hEventObject, lNetworkEvents) != 0) {
> -        error_setg_win32(errp, WSAGetLastError(), "failed to WSAEventSelect()");
> +        error_setg_win32(&error_warn, WSAGetLastError(),
> +                         "failed to WSAEventSelect()");
>          return false;
>      }
>  
> @@ -315,7 +312,7 @@ bool qemu_socket_select(int sockfd, WSAEVENT hEventObject,


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 :|



  parent reply	other threads:[~2025-07-15  8:57 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é
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é [this message]
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=aHYXqRUPOVbyw0mN@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.