From d89f7c8194690ab5979ab4802de67e919126be9f Mon Sep 17 00:00:00 2001 From: Peter Foley Date: Thu, 5 Mar 2026 11:04:57 -0500 Subject: [PATCH] net/passt: Don't try to read the pidfile if passt got a signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit g_subprocess_get_if_exited returns false if passt was killed by a signal, so we fall through to trying to read the pidfile. Update the error when passt exits to include the exit code. Reviewed-by: Laurent Vivier Signed-off-by: Peter Foley Message-ID: <20260305-passt-v2-2-f0582198afc0@google.com> Signed-off-by: Philippe Mathieu-Daudé --- net/passt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net/passt.c b/net/passt.c index b3d4b71314..4ff94ee509 100644 --- a/net/passt.c +++ b/net/passt.c @@ -270,8 +270,17 @@ static int net_passt_start_daemon(NetPasstState *s, int sock, Error **errp) return -1; } - if (g_subprocess_get_if_exited(daemon) && - g_subprocess_get_exit_status(daemon)) { + if (g_subprocess_get_if_exited(daemon)) { + gint status = g_subprocess_get_exit_status(daemon); + if (status) { + error_setg(errp, "Passt exited with code %d", status); + return -1; + } + } + + if (g_subprocess_get_if_signaled(daemon)) { + error_setg(errp, "Passt killed with signal %d", + g_subprocess_get_term_sig(daemon)); return -1; }