2 * QEMU live migration channel operations
4 * Copyright Red Hat, Inc. 2016
7 * Daniel P. Berrange <berrange@redhat.com>
9 * Contributions after 2012-01-13 are licensed under the terms of the
10 * GNU GPL, version 2 or (at your option) any later version.
13 #include "qemu/osdep.h"
16 #include "migration/migration.h"
17 #include "qemu-file-channel.h"
19 #include "qapi/error.h"
20 #include "io/channel-tls.h"
22 void migration_channel_process_incoming(MigrationState
*s
,
25 trace_migration_set_incoming_channel(
26 ioc
, object_get_typename(OBJECT(ioc
)));
28 if (s
->parameters
.tls_creds
&&
29 *s
->parameters
.tls_creds
&&
30 !object_dynamic_cast(OBJECT(ioc
),
31 TYPE_QIO_CHANNEL_TLS
)) {
32 Error
*local_err
= NULL
;
33 migration_tls_channel_process_incoming(s
, ioc
, &local_err
);
35 error_report_err(local_err
);
38 QEMUFile
*f
= qemu_fopen_channel_input(ioc
);
39 migration_fd_process_incoming(f
);
44 void migration_channel_connect(MigrationState
*s
,
48 trace_migration_set_outgoing_channel(
49 ioc
, object_get_typename(OBJECT(ioc
)), hostname
);
51 if (s
->parameters
.tls_creds
&&
52 *s
->parameters
.tls_creds
&&
53 !object_dynamic_cast(OBJECT(ioc
),
54 TYPE_QIO_CHANNEL_TLS
)) {
55 Error
*local_err
= NULL
;
56 migration_tls_channel_connect(s
, ioc
, hostname
, &local_err
);
58 migrate_fd_error(s
, local_err
);
59 error_free(local_err
);
62 QEMUFile
*f
= qemu_fopen_channel_output(ioc
);
66 migrate_fd_connect(s
);