On 23/9/25 11:09, Markus Armbruster wrote:
qemu_socket_select() and its wrapper qemu_socket_unselect() treat a
null @errp as &error_warn.  This is wildly inappropriate.  A caller
passing null @errp specifies that errors are to be ignored.  If
warnings are wanted, the caller must pass &error_warn.

Change callers to do that, and drop the inappropriate treatment of
null @errp.

This assumes that warnings are wanted.  I'm not familiar with the
calling code, so I can't say whether it will work when the socket is
invalid, or WSAEventSelect() fails.  If it doesn't, then this should
be an error instead of a warning.  Invalid socket might even be a
programming error.

These warnings were introduced in commit f5fd677ae7cf (win32/socket:
introduce qemu_socket_select() helper).  I considered reverting to
silence, but Daniel Berrangé asked for the warnings to be preserved.

Cc: Marc-André Lureau <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
---
  io/channel-socket.c | 4 ++--
  io/channel-watch.c  | 2 +-
  util/aio-win32.c    | 2 +-
  util/oslib-win32.c  | 6 +-----
  4 files changed, 5 insertions(+), 9 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to