qemu/qga
Michal Privoznik c6f5dd7ac8 qga: Don't daemonize before channel is initialized
If the agent is set to daemonize but for whatever reason fails to
init the channel, the error message is lost. Worse, the agent
daemonizes needlessly and returns success. For instance:

  # qemu-ga -m virtio-serial \
            -p /dev/nonexistent_device \
            -f /run/qemu-ga.pid \
            -t /run \
            -d
  # echo $?
  0

This makes it needlessly hard for init scripts to detect a
failure in qemu-ga startup. Though, they shouldn't pass '-d' in
the first place.

Let's open the channel first and only after that become a daemon.

Related bug: https://bugs.gentoo.org/810628

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Message-ID: <7a42b0cbda5c7e01cf76bc1b29a1210cd018fa78.1736261360.git.mprivozn@redhat.com>
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
2025-02-26 13:34:25 +02:00
..
installer qga/win/installer: add VssOption to installer 2023-03-08 18:26:49 +02:00
vss-win32 qga: fix missing static and prototypes windows warnings 2024-11-04 14:16:14 +02:00
channel-posix.c qga/: spelling fixes 2023-09-08 13:08:52 +03:00
channel-win32.c qga: Add spaces around operator 2021-03-16 20:20:37 -05:00
channel.h qga: add systemd socket activation support 2017-03-06 00:54:18 -06:00
commands-bsd.c error: Drop superfluous #include "qapi/qmp/qerror.h" 2024-10-18 15:03:35 +02:00
commands-common-ssh.c qga: Refactor common SSH functions 2024-05-01 10:35:45 +03:00
commands-common-ssh.h qga: Refactor common SSH functions 2024-05-01 10:35:45 +03:00
commands-common.h qga: move CONFIG_FSFREEZE/TRIM to be meson defined options 2024-07-19 11:50:35 +03:00
commands-linux.c qga: skip bind mounts in fs list 2024-12-18 13:14:49 +02:00
commands-posix-ssh.c Remove glib compatibility code that is not required anymore 2024-05-14 12:46:39 +02:00
commands-posix.c qga: Add log to guest-fsfreeze-thaw command 2025-02-26 13:33:39 +02:00
commands-win32.c qga: Add log to guest-fsfreeze-thaw command 2025-02-26 13:33:39 +02:00
commands-windows-ssh.c qga: fix -Wsometimes-uninitialized windows warning 2024-11-04 14:16:14 +02:00
commands-windows-ssh.h qga: Implement SSH commands for Windows 2024-05-01 10:35:45 +03:00
commands.c qga: Shorten several error messages 2024-05-27 12:59:10 +02:00
cutils.c qga: Clean up includes 2023-02-08 07:16:23 +01:00
cutils.h qga: Clean up includes 2023-02-08 07:16:23 +01:00
guest-agent-command-state.c qga: use local path for local headers 2018-06-01 19:20:38 +03:00
guest-agent-core.h qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h 2025-02-10 15:33:29 +01:00
main.c qga: Don't daemonize before channel is initialized 2025-02-26 13:34:25 +02:00
meson.build qga: Implement SSH commands for Windows 2024-05-01 10:35:45 +03:00
messages-win32.mc qga-win: add logging to Windows event log 2022-12-20 15:54:41 +02:00
qapi-schema.json qga: implement a 'guest-get-load' command 2025-01-06 12:48:46 +02:00
service-win32.c qga: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
service-win32.h qga-win: changing --retry-path option behavior 2018-10-31 09:04:20 -05:00
vss-win32.c qga-win: add support for qmp_guest_fsfreeze_freeze_list 2018-10-30 16:48:49 -05:00
vss-win32.h qga-win: add support for qmp_guest_fsfreeze_freeze_list 2018-10-30 16:48:49 -05:00