summary refs log tree commit diff stats
path: root/hw/vfio-user/proxy.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2025-07-23 15:32:57 +0200
committerMarkus Armbruster <armbru@redhat.com>2025-09-01 13:11:13 +0200
commitec14a3de622ae30a8afa78b6f564bc743b753ee1 (patch)
treecd63b5ef85e13f54572f4a70b4d79c1860bc284d /hw/vfio-user/proxy.c
parentb2e4534a2c9ce3d20ba44d855f1e2b71cc53c3a3 (diff)
downloadfocaccia-qemu-ec14a3de622ae30a8afa78b6f564bc743b753ee1.tar.gz
focaccia-qemu-ec14a3de622ae30a8afa78b6f564bc743b753ee1.zip
vfio scsi ui: Error-check qio_channel_socket_connect_sync() the same way
qio_channel_socket_connect_sync() returns 0 on success, and -1 on
failure, with errp set.  Some callers check the return value, and some
check whether errp was set.

For consistency, always check the return value, and always check it's
negative.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250723133257.1497640-3-armbru@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Diffstat (limited to 'hw/vfio-user/proxy.c')
-rw-r--r--hw/vfio-user/proxy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/vfio-user/proxy.c b/hw/vfio-user/proxy.c
index 2275d3fe39..2c03d49f97 100644
--- a/hw/vfio-user/proxy.c
+++ b/hw/vfio-user/proxy.c
@@ -885,7 +885,7 @@ VFIOUserProxy *vfio_user_connect_dev(SocketAddress *addr, Error **errp)
 
     sioc = qio_channel_socket_new();
     ioc = QIO_CHANNEL(sioc);
-    if (qio_channel_socket_connect_sync(sioc, addr, errp)) {
+    if (qio_channel_socket_connect_sync(sioc, addr, errp) < 0) {
         object_unref(OBJECT(ioc));
         return NULL;
     }