summary refs log tree commit diff stats
path: root/hw/misc/ivshmem-flat.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2025-09-23 11:09:59 +0200
committerMarkus Armbruster <armbru@redhat.com>2025-10-01 08:33:24 +0200
commite0c6c38738501ff4f79864ab2b10622433317711 (patch)
tree4021c2d0e7d5948bc720c260e82f4454b3414adc /hw/misc/ivshmem-flat.c
parentf3da25a5571573dfd8b5459b3b4458cd4de38db7 (diff)
downloadfocaccia-qemu-e0c6c38738501ff4f79864ab2b10622433317711.tar.gz
focaccia-qemu-e0c6c38738501ff4f79864ab2b10622433317711.zip
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 <gustavo.romero@linaro.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250923091000.3180122-13-armbru@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Diffstat (limited to 'hw/misc/ivshmem-flat.c')
-rw-r--r--hw/misc/ivshmem-flat.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/misc/ivshmem-flat.c b/hw/misc/ivshmem-flat.c
index e83e6c6ee9..27ee8c9218 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);