summaryrefslogtreecommitdiffstats
path: root/include/io
diff options
context:
space:
mode:
authorDaniel P. Berrange2016-08-11 18:38:07 +0200
committerDaniel P. Berrange2017-01-23 16:32:19 +0100
commit59de517d8d482416a079da7ee8344187d513d4a4 (patch)
treef24cf5539b7780c8a794bcba796cb2ab4e78c37f /include/io
parentio: change the QIOTask callback signature (diff)
downloadqemu-59de517d8d482416a079da7ee8344187d513d4a4.tar.gz
qemu-59de517d8d482416a079da7ee8344187d513d4a4.tar.xz
qemu-59de517d8d482416a079da7ee8344187d513d4a4.zip
io: remove Error parameter from QIOTask thread worker
Now that task objects have a directly associated error, there's no need for an an Error **errp parameter to the QIOTask thread worker function. It already has a QIOTask object, so can directly set the error on it. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'include/io')
-rw-r--r--include/io/task.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/include/io/task.h b/include/io/task.h
index ad90970491..6021f51336 100644
--- a/include/io/task.h
+++ b/include/io/task.h
@@ -29,9 +29,8 @@ typedef struct QIOTask QIOTask;
typedef void (*QIOTaskFunc)(QIOTask *task,
gpointer opaque);
-typedef int (*QIOTaskWorker)(QIOTask *task,
- Error **errp,
- gpointer opaque);
+typedef void (*QIOTaskWorker)(QIOTask *task,
+ gpointer opaque);
/**
* QIOTask:
@@ -163,18 +162,16 @@ typedef int (*QIOTaskWorker)(QIOTask *task,
* socket listen using QIOTask would require:
*
* <example>
- * static int myobject_listen_worker(QIOTask *task,
- * Error **errp,
- * gpointer opaque)
+ * static void myobject_listen_worker(QIOTask *task,
+ * gpointer opaque)
* {
* QMyObject obj = QMY_OBJECT(qio_task_get_source(task));
* SocketAddress *addr = opaque;
+ * Error *err = NULL;
*
- * obj->fd = socket_listen(addr, errp);
- * if (obj->fd < 0) {
- * return -1;
- * }
- * return 0;
+ * obj->fd = socket_listen(addr, &err);
+ *
+ qio_task_set_error(task, err);
* }
*
* void myobject_listen_async(QMyObject *obj,