Skip to contentSkip to conversation

migration: setup bi-directional I/O channel for exec: protocol

PATCH In review Daniel P. Berrange 2 participants 2 messages Apr 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: setup bi-directional I/O channel for exec: protocol

Historically the migration data channel has only needed to be unidirectional. Thus the 'exec:' protocol was requesting an I/O channel with O_RDONLY on incoming side, and O_WRONLY on the outgoing side.

This is fine for classic migration, but if you then try to run TLS over it, this fails because the TLS handshake requires a bi-directional channel.

---
 migration/exec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
migration/exec.c +2 -2
index 9157721..aba9089 100644
@@ -32,7 +32,7 @@ void exec_start_outgoing_migration(MigrationState *s, const char *command, Error
 
     trace_migration_exec_outgoing(command);
     ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv,
-                                                    O_WRONLY,
+                                                    O_RDWR,
                                                     errp));
     if (!ioc) {
         return;
@@ -59,7 +59,7 @@ void exec_start_incoming_migration(const char *command, Error **errp)
 
     trace_migration_exec_incoming(command);
     ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv,
-                                                    O_RDONLY,
+                                                    O_RDWR,
                                                     errp));
     if (!ioc) {
         return;
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Daniel P. Berrange

Historically the migration data channel has only needed to be unidirectional. Thus the 'exec:' protocol was requesting an I/O channel with O_RDONLY on incoming side, and O_WRONLY on the outgoing side.

This is fine for classic migration, but if you then try to run TLS over it, this fails because the TLS handshake requires a bi-directional channel.

Actually, lots of people request that we have bi-directional communication always that it is possible.