mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07: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:
parent
1a447e4f02
commit
60e705c51c
15 changed files with 110 additions and 112 deletions
18
qemu-char.c
18
qemu-char.c
|
|
@ -3277,14 +3277,13 @@ static void tcp_chr_telnet_init(CharDriverState *chr)
|
|||
}
|
||||
|
||||
|
||||
static void tcp_chr_tls_handshake(Object *source,
|
||||
Error *err,
|
||||
static void tcp_chr_tls_handshake(QIOTask *task,
|
||||
gpointer user_data)
|
||||
{
|
||||
CharDriverState *chr = user_data;
|
||||
TCPCharDriver *s = chr->opaque;
|
||||
|
||||
if (err) {
|
||||
if (qio_task_propagate_error(task, NULL)) {
|
||||
tcp_chr_disconnect(chr);
|
||||
} else {
|
||||
if (s->do_telnetopt) {
|
||||
|
|
@ -3492,20 +3491,23 @@ static void tcp_chr_free(CharDriverState *chr)
|
|||
}
|
||||
|
||||
|
||||
static void qemu_chr_socket_connected(Object *src, Error *err, void *opaque)
|
||||
static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
|
||||
{
|
||||
QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(src);
|
||||
QIOChannelSocket *sioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));
|
||||
CharDriverState *chr = opaque;
|
||||
TCPCharDriver *s = chr->opaque;
|
||||
Error *err = NULL;
|
||||
|
||||
if (err) {
|
||||
if (qio_task_propagate_error(task, &err)) {
|
||||
check_report_connect_error(chr, err);
|
||||
object_unref(src);
|
||||
return;
|
||||
error_free(err);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
s->connect_err_reported = false;
|
||||
tcp_chr_new_client(chr, sioc);
|
||||
|
||||
cleanup:
|
||||
object_unref(OBJECT(sioc));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue