From: Markus Armbruster Date: Tue, 23 Sep 2025 09:09:59 +0000 (+0200) Subject: ivshmem-flat: Mark an instance of missing error handling FIXME X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0c6c38738501ff4f79864ab2b10622433317711;p=thirdparty%2Fqemu.git ivshmem-flat: Mark an instance of missing error handling FIXME ivshmem-flat's ivshmem_flat_add_vector() neglects to handle qemu_set_blocking() failure. It used to silently ignore errors there. Recent commit 6f607941b1c (treewide: use qemu_set_blocking instead of g_unix_set_fd_nonblocking) changed it to warn (without mentioning it the commit message, tsk, tsk, tsk). Note that ivshmem-pci's process_msg_connect() handles this error. Add a FIXME comment to mark the missing error handling. Cc: Gustavo Romero Signed-off-by: Markus Armbruster Message-ID: <20250923091000.3180122-13-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Akihiko Odaki --- diff --git a/hw/misc/ivshmem-flat.c b/hw/misc/ivshmem-flat.c index e83e6c6ee9a..27ee8c92183 100644 --- a/hw/misc/ivshmem-flat.c +++ b/hw/misc/ivshmem-flat.c @@ -138,6 +138,8 @@ static void ivshmem_flat_remove_peer(IvshmemFTState *s, uint16_t peer_id) static void ivshmem_flat_add_vector(IvshmemFTState *s, IvshmemPeer *peer, int vector_fd) { + Error *err = NULL; + if (peer->vector_counter >= IVSHMEM_MAX_VECTOR_NUM) { trace_ivshmem_flat_add_vector_failure(peer->vector_counter, vector_fd, peer->id); @@ -154,8 +156,10 @@ static void ivshmem_flat_add_vector(IvshmemFTState *s, IvshmemPeer *peer, * peer. */ peer->vector[peer->vector_counter].id = peer->vector_counter; - /* WARNING: qemu_socket_set_nonblock() return code ignored */ - qemu_set_blocking(vector_fd, false, &error_warn); + if (!qemu_set_blocking(vector_fd, false, &err)) { + /* FIXME handle the error */ + warn_report_err(err); + } event_notifier_init_fd(&peer->vector[peer->vector_counter].event_notifier, vector_fd);