mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 21:50:33 +00:00
net/passt: Only kill passt if it wrote a pidfile
Avoid killing qemu if passt failed before writing a pidfile. pid is initialized to 0, so calling pid in this scenario would kill the entire process group. Reviewed-by: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Peter Foley <pefoley@google.com> Message-ID: <20260305-passt-v2-1-f0582198afc0@google.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
4efd93949f
commit
a1596cdc37
@@ -102,7 +102,9 @@ static void net_passt_cleanup(NetClientState *nc)
|
||||
}
|
||||
#endif
|
||||
|
||||
kill(s->pid, SIGTERM);
|
||||
if (s->pid > 0) {
|
||||
kill(s->pid, SIGTERM);
|
||||
}
|
||||
if (g_remove(s->pidfile) != 0) {
|
||||
warn_report("Failed to remove passt pidfile %s: %s",
|
||||
s->pidfile, strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user