summary refs log tree commit diff stats
path: root/util/aio-win32.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2025-09-23 11:09:55 +0200
committerMarkus Armbruster <armbru@redhat.com>2025-09-30 14:43:53 +0200
commit5bd58f04b831f7086f21ae70c90d1a86b6565762 (patch)
treeaea43aeccd128ad899d4eecdc0ba887391213014 /util/aio-win32.c
parentb46b8cf29c56e423b227021f1a5b7aa9b11181b4 (diff)
downloadfocaccia-qemu-5bd58f04b831f7086f21ae70c90d1a86b6565762.tar.gz
focaccia-qemu-5bd58f04b831f7086f21ae70c90d1a86b6565762.zip
util/oslib-win32: Do not treat null @errp as &error_warn
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 <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250923091000.3180122-9-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Diffstat (limited to 'util/aio-win32.c')
-rw-r--r--util/aio-win32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/aio-win32.c b/util/aio-win32.c
index 6583d5c5f3..b125924433 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, &error_warn);
     }
     if (old_node) {
         aio_remove_fd_handler(ctx, old_node);