summary refs log tree commit diff stats
path: root/ui
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 /ui
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 'ui')
-rw-r--r--ui/input-barrier.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/input-barrier.c b/ui/input-barrier.c
index 9793258aac..0a2198ca50 100644
--- a/ui/input-barrier.c
+++ b/ui/input-barrier.c
@@ -490,7 +490,6 @@ static gboolean input_barrier_event(QIOChannel *ioc G_GNUC_UNUSED,
 static void input_barrier_complete(UserCreatable *uc, Error **errp)
 {
     InputBarrier *ib = INPUT_BARRIER(uc);
-    Error *local_err = NULL;
 
     if (!ib->name) {
         error_setg(errp, QERR_MISSING_PARAMETER, "name");
@@ -506,9 +505,7 @@ static void input_barrier_complete(UserCreatable *uc, Error **errp)
     ib->sioc = qio_channel_socket_new();
     qio_channel_set_name(QIO_CHANNEL(ib->sioc), "barrier-client");
 
-    qio_channel_socket_connect_sync(ib->sioc, &ib->saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (qio_channel_socket_connect_sync(ib->sioc, &ib->saddr, errp) < 0) {
         return;
     }