mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 21:46:25 +00:00
net/passt: Don't try to read the pidfile if passt got a signal
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 <lvivier@redhat.com> Signed-off-by: Peter Foley <pefoley@google.com> Message-ID: <20260305-passt-v2-2-f0582198afc0@google.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
a1596cdc37
commit
d89f7c8194
13
net/passt.c
13
net/passt.c
@@ -270,8 +270,17 @@ static int net_passt_start_daemon(NetPasstState *s, int sock, Error **errp)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_subprocess_get_if_exited(daemon) &&
|
if (g_subprocess_get_if_exited(daemon)) {
|
||||||
g_subprocess_get_exit_status(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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user