summaryrefslogtreecommitdiffstats
path: root/nbd
diff options
context:
space:
mode:
authorDaniel P. Berrange2016-08-11 16:20:58 +0200
committerDaniel P. Berrange2017-01-23 16:32:18 +0100
commit60e705c51c66373f78e536e0462744a610c27cf6 (patch)
treea92d50a052c105d1554b11ab4c89a90f15a54be0 /nbd
parentio: add ability to associate an error with a task (diff)
downloadqemu-60e705c51c66373f78e536e0462744a610c27cf6.tar.gz
qemu-60e705c51c66373f78e536e0462744a610c27cf6.tar.xz
qemu-60e705c51c66373f78e536e0462744a610c27cf6.zip
io: change the QIOTask callback signature
Currently the QIOTaskFunc signature takes an Object * for the source, and an Error * for any error. We also need to be able to provide a result pointer. Rather than continue to add parameters to QIOTaskFunc, remove the existing ones and simply pass the QIOTask object instead. This has methods to access all the other data items required in the callback impl. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'nbd')
-rw-r--r--nbd/common.c8
-rw-r--r--nbd/nbd-internal.h3
2 files changed, 4 insertions, 7 deletions
diff --git a/nbd/common.c b/nbd/common.c
index b583a4f4cf..a5f39ea58e 100644
--- a/nbd/common.c
+++ b/nbd/common.c
@@ -78,15 +78,13 @@ ssize_t nbd_wr_syncv(QIOChannel *ioc,
}
-void nbd_tls_handshake(Object *src,
- Error *err,
+void nbd_tls_handshake(QIOTask *task,
void *opaque)
{
struct NBDTLSHandshakeData *data = opaque;
- if (err) {
- TRACE("TLS failed %s", error_get_pretty(err));
- data->error = error_copy(err);
+ if (qio_task_propagate_error(task, &data->error)) {
+ TRACE("TLS failed %s", error_get_pretty(data->error));
}
data->complete = true;
g_main_loop_quit(data->loop);
diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h
index eee20abc25..f43d990a05 100644
--- a/nbd/nbd-internal.h
+++ b/nbd/nbd-internal.h
@@ -120,8 +120,7 @@ struct NBDTLSHandshakeData {
};
-void nbd_tls_handshake(Object *src,
- Error *err,
+void nbd_tls_handshake(QIOTask *task,
void *opaque);
#endif