mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user