OSDN Git Service

io: tls: Inherit QIO_CHANNEL_FEATURE_SHUTDOWN on server side
authorPeter Xu <peterx@redhat.com>
Sun, 26 Mar 2023 17:25:38 +0000 (13:25 -0400)
committerJuan Quintela <quintela@redhat.com>
Wed, 12 Apr 2023 19:19:05 +0000 (21:19 +0200)
TLS iochannel will inherit io_shutdown() from the master ioc, however we
missed to do that on the server side.

This will e.g. allow qemu_file_shutdown() to work on dest QEMU too for
migration.

Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
io/channel-tls.c

index 5a7a3d4..9805dd0 100644 (file)
@@ -74,6 +74,9 @@ qio_channel_tls_new_server(QIOChannel *master,
     ioc = QIO_CHANNEL_TLS(object_new(TYPE_QIO_CHANNEL_TLS));
 
     ioc->master = master;
+    if (qio_channel_has_feature(master, QIO_CHANNEL_FEATURE_SHUTDOWN)) {
+        qio_channel_set_feature(QIO_CHANNEL(ioc), QIO_CHANNEL_FEATURE_SHUTDOWN);
+    }
     object_ref(OBJECT(master));
 
     ioc->session = qcrypto_tls_session_new(