aboutsummaryrefslogtreecommitdiff
path: root/include/io
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-10-06 15:36:55 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-10-12 19:22:01 +0400
commita95570e3e4d61a7c8e527e512246665c51caa6f4 (patch)
tree335c5e60b5908261038044db448fb4660b3abbb9 /include/io
parentbb06b0143b492203ab3d17640be1d819cfc33de7 (diff)
downloadqemu-a95570e3e4d61a7c8e527e512246665c51caa6f4.zip
qemu-a95570e3e4d61a7c8e527e512246665c51caa6f4.tar.gz
qemu-a95570e3e4d61a7c8e527e512246665c51caa6f4.tar.bz2
io/command: use glib GSpawn, instead of open-coding fork/exec
Simplify qio_channel_command_new_spawn() with GSpawn API. This will allow to build for WIN32 in the following patches. As pointed out by Daniel Berrangé: there is a change in semantics here too. The current code only touches stdin/stdout/stderr. Any other FDs which do NOT have O_CLOEXEC set will be inherited. With the new code, all FDs except stdin/out/err will be explicitly closed, because we don't set the flag G_SPAWN_LEAVE_DESCRIPTORS_OPEN. The only place we use QIOChannelCommand today is the migration exec: protocol, and that is only declared to use stdin/stdout. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20221006113657.2656108-5-marcandre.lureau@redhat.com>
Diffstat (limited to 'include/io')
-rw-r--r--include/io/channel-command.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/io/channel-command.h b/include/io/channel-command.h
index 305ac1d..8dc5827 100644
--- a/include/io/channel-command.h
+++ b/include/io/channel-command.h
@@ -41,7 +41,7 @@ struct QIOChannelCommand {
QIOChannel parent;
int writefd;
int readfd;
- pid_t pid;
+ GPid pid;
};