From nobody Tue Feb 10 11:16:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694707009; cv=none; d=zohomail.com; s=zohoarc; b=Rv73rz2T+SdGNRkZ1KZx3HCoukn1HWBdo9fsGRqwR4NSMKQ7Xpylayv4BjWqmSbsKlN8iis2uMwbnp1tqFSr4atXkniJWCtHhrHtf8Afg7Y06bPehZnkW/GpMWV+eTBz1r0hATDrODkevfcbKbSLVLnvtl84nNKimi62FN21sO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694707009; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HZcF5/gSkiSoxCO096FcHnSr7utgTrP+2NsmOiiXXQE=; b=J7JyToZE51NvokJF45nq297sV3fRHuo7Ik6uT6sHy6ySQmEkHGzNUa+n0l1A0T5VYo63D1EyjfYC4kr2Uff5+sx+w38qNeDVpAPacK0wRuKg/5QN5gWyY+5elsoI6Ucd1Lh/U390yWHC/urjLfujs6GmcxWKL+m3g9abmhRBb6s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169470700988717.854671733859504; Thu, 14 Sep 2023 08:56:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgogG-0002Dk-Id; Thu, 14 Sep 2023 11:55:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgofw-0001XY-IO for qemu-devel@nongnu.org; Thu, 14 Sep 2023 11:54:40 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgofn-00087l-SK for qemu-devel@nongnu.org; Thu, 14 Sep 2023 11:54:40 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-401d80f4ef8so12536835e9.1 for ; Thu, 14 Sep 2023 08:54:27 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a4-20020a5d4d44000000b00317e77106dbsm2075765wru.48.2023.09.14.08.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 08:54:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 02D6A1FFC0; Thu, 14 Sep 2023 16:54:23 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694706866; x=1695311666; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HZcF5/gSkiSoxCO096FcHnSr7utgTrP+2NsmOiiXXQE=; b=Jk2Tne8B38sri77kpoUBAy54D+qM1MvfhPmzYGIrVqbAEgdDdW8E1sxUR8tywyNazh YTzTqIzUET7Zptnv6GJFLXVJNYjdfAZQ84okWmzQr/AGM1yTC/1tYwE6keetUavyOrbu Fqsyj/tkIuSUI3XhvyKIdEQOSUrZSh8iv8FEpyt6XZTIBfLyrqTXO6wGwkLkYZasHApY Ti0wmRIoTpqLUiL+VPYZsjdGL/JJ14iV6HtdNxKrc9ZhgtaKOpPZaAXpLwxMe28/uNTz BGE0j80MY8jJbLhYVKo2BIagER4ohw7wLF5MvLgYarfitgzR0S3mwtC76Nis1l6QUQ3o ryXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694706866; x=1695311666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HZcF5/gSkiSoxCO096FcHnSr7utgTrP+2NsmOiiXXQE=; b=rDaddXZbzJHbkK0AuzyfoY6LzTSAb61rsbkolxwRkHZCprIyK7ndMhKxb+dtxHAFLw ObwjsJGwhuM9LrTy0HfPGxe0BCzEWsQv2ws91JUMB/HF59Mn+AAydMPLnKZvt4Vvpofn vYeXrbLXmTh/5Ddlxs1wUgEy3JCAaXcOgKAY+e5J+QXmhq8e4hpu5XEkBbstYA8bo60s QEVyalKMkAGyBpSVRc7EUV/NcFfTKdidAHFcJwSGWg0zorSTceGES4G3YIshw1X+ndcB hF4BwHCPv+pv/VQccjp4f9LMhWzROc+roR/gDlluZ85IPE3YRfo1Yxjc2Y97b3IklKz7 13Vw== X-Gm-Message-State: AOJu0YwkOhUW8pxWhTrLRUL+H8ei8eotB/OiE/Aa0qa1UxJM9Ja3MjDV 7SeaOVrVv4x8ywEvVIoL10MBEg== X-Google-Smtp-Source: AGHT+IG/tWW5Z2q7tX1z8PC6AZIIPCnI37Nw9aQAgY35Pug38fIRKdo9NA7kJ9g/TC0ogzHdJlsczw== X-Received: by 2002:a5d:5148:0:b0:31f:a682:d27f with SMTP id u8-20020a5d5148000000b0031fa682d27fmr5416472wrt.67.1694706866513; Thu, 14 Sep 2023 08:54:26 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Joel Stanley , Wainer dos Santos Moschetta , Beraldo Leal , Richard Henderson , Pavel Dovgalyuk , qemu-arm@nongnu.org, Thomas Huth , Jiaxun Yang , John Snow , Mark Cave-Ayland , Peter Maydell , Laurent Vivier , Aurelien Jarno , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Stefan Hajnoczi Subject: [PATCH 5/9] qtest: kill orphaned qtest QEMU processes on FreeBSD Date: Thu, 14 Sep 2023 16:54:18 +0100 Message-Id: <20230914155422.426639-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230914155422.426639-1-alex.bennee@linaro.org> References: <20230914155422.426639-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694707010544100007 From: Daniel P. Berrang=C3=A9 On Linux we use PR_SET_PDEATHSIG to kill orphaned QEMU processes if we fail to call qtest_quit(), or the test program aborts/segvs. This prevents meson from hanging forever due to the orphaned process keeping stdout open. On FreeBSD we can achieve the same using PROC_PDEATHSIG_CTL, which gives us the equivalent protection against hangs. Signed-off-by: "Daniel P. Berrang=C3=A9" Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Reviewed-by: Thomas Huth Message-Id: <20230912184130.3056054-3-berrange@redhat.com> Signed-off-by: Alex Benn=C3=A9e --- tests/qtest/libqtest.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 34b9c14b75..b1eba71ffe 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -24,6 +24,9 @@ #ifdef __linux__ #include #endif /* __linux__ */ +#ifdef __FreeBSD__ +#include +#endif /* __FreeBSD__ */ =20 #include "libqtest.h" #include "libqmp.h" @@ -414,6 +417,10 @@ static QTestState *G_GNUC_PRINTF(1, 2) qtest_spawn_qem= u(const char *fmt, ...) */ prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); #endif /* __linux__ */ +#ifdef __FreeBSD__ + int sig =3D SIGKILL; + procctl(P_PID, getpid(), PROC_PDEATHSIG_CTL, &sig); +#endif /* __FreeBSD__ */ if (!g_setenv("QEMU_AUDIO_DRV", "none", true)) { exit(1); } --=20 2.39.2