X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=migration%2Ftls.c;h=45bec44ca4fac5eefbe875f1b15d8971045a47c4;hb=0e5d6327f3abb8d582cbc2e444a23ef0dc6a64c7;hp=49ca9a8930e44a9074d5fe58bbbe022d0c404076;hpb=6bc56d317f7b5004ea2d89d264bddc8b4d081700;p=mirror_qemu.git diff --git a/migration/tls.c b/migration/tls.c index 49ca9a8930..45bec44ca4 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -61,15 +61,15 @@ migration_tls_get_creds(MigrationState *s, } -static void migration_tls_incoming_handshake(Object *src, - Error *err, +static void migration_tls_incoming_handshake(QIOTask *task, gpointer opaque) { - QIOChannel *ioc = QIO_CHANNEL(src); + QIOChannel *ioc = QIO_CHANNEL(qio_task_get_source(task)); + Error *err = NULL; - if (err) { + if (qio_task_propagate_error(task, &err)) { trace_migration_tls_incoming_handshake_error(error_get_pretty(err)); - error_report("%s", error_get_pretty(err)); + error_report_err(err); } else { trace_migration_tls_incoming_handshake_complete(); migration_channel_process_incoming(migrate_get_current(), ioc); @@ -107,17 +107,18 @@ void migration_tls_channel_process_incoming(MigrationState *s, } -static void migration_tls_outgoing_handshake(Object *src, - Error *err, +static void migration_tls_outgoing_handshake(QIOTask *task, gpointer opaque) { MigrationState *s = opaque; - QIOChannel *ioc = QIO_CHANNEL(src); + QIOChannel *ioc = QIO_CHANNEL(qio_task_get_source(task)); + Error *err = NULL; - if (err) { + if (qio_task_propagate_error(task, &err)) { trace_migration_tls_outgoing_handshake_error(error_get_pretty(err)); s->to_dst_file = NULL; migrate_fd_error(s, err); + error_free(err); } else { trace_migration_tls_outgoing_handshake_complete(); migration_channel_connect(s, ioc, NULL); @@ -140,7 +141,7 @@ void migration_tls_channel_connect(MigrationState *s, return; } - if (s->parameters.tls_hostname) { + if (s->parameters.tls_hostname && *s->parameters.tls_hostname) { hostname = s->parameters.tls_hostname; } if (!hostname) {