]> git.proxmox.com Git - mirror_qemu.git/commit - qga/commands-posix.c
qga/commands-posix: don't do fork()/exec() when suspending via sysfs
authorAndrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Wed, 20 Mar 2024 16:16:47 +0000 (18:16 +0200)
committerKonstantin Kostiuk <kkostiuk@redhat.com>
Wed, 1 May 2024 07:10:08 +0000 (10:10 +0300)
commit2048129625bdca60bc76d3b8c3ee51c08aacedc2
tree4b0d1142f0f56d73eb88df76dd66c870c476435a
parent8ef383b460826e1ab138e892559f7ed2305e049d
qga/commands-posix: don't do fork()/exec() when suspending via sysfs

Since commit 246d76eba ("qga: guest_suspend: decoupling pm-utils and sys
logic") pm-utils logic is running in a separate child from the sysfs
logic.  Now when suspending via sysfs we don't really need to do that in
a separate process as we only need to perform one write to /sys/power/state.

Let's just use g_file_set_contents() to simplify things here.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20240320161648.158226-7-andrey.drobyshev@virtuozzo.com
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
qga/commands-posix.c