From nobody Mon Dec 15 01:33:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551230579176455.5933360668889; Tue, 26 Feb 2019 17:22:59 -0800 (PST) Received: from localhost ([127.0.0.1]:35693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gynvp-0005az-Ao for importer@patchew.org; Tue, 26 Feb 2019 20:22:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gynur-0005GT-L0 for qemu-devel@nongnu.org; Tue, 26 Feb 2019 20:21:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gynuq-0000nQ-SO for qemu-devel@nongnu.org; Tue, 26 Feb 2019 20:21:45 -0500 Received: from ozlabs.org ([203.11.71.1]:54101) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gynuo-0000jo-K0; Tue, 26 Feb 2019 20:21:43 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 448Hvk07Qyz9s9y; Wed, 27 Feb 2019 12:21:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1551230498; bh=a70pfbZwnhUC1G1Vt8lv30TMlENthwRKn6JPPYVZOQw=; h=From:To:Cc:Subject:Date:From; b=fWAkvF1k8YaAjMAefonjLOL/fJwYwzOd8EKofCqg0nUyt392HvLYnMckzpXc4O5Ld LsuRZxnnD4q/oKoM7BYMtsALsFDnMQuIynXMjPvd6GKEs/IrfB2H6xTu+XbZJ9lOfK veiTOS1xFwozLkFL9oJMPgIaCTs5L1xwb+jz64bc= From: David Gibson To: otubo@redhat.com, pbonzini@redhat.com Date: Wed, 27 Feb 2019 12:21:32 +1100 Message-Id: <20190227012132.16271-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PATCH] Allow -sandbox off with --disable-seccomp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" At present, when seccomp support is compiled out with --disable-seccomp we fail with an error if the user puts -sandbox on the command line. That kind of makes sense, but it's a bit strange that we reject a request to disable sandboxing with "-sandbox off" saying we don't support sandboxing. This puts in a small sandbox to (correctly) silently ignore -sandbox off when we don't have sandboxing support compiled in. This makes life easier for testcases, since they can safely specify "-sandbox off" without having to care if the qemu they're using is compiled with sandbox support or not. Signed-off-by: David Gibson Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Stefano Garzarella --- vl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vl.c b/vl.c index 502857a176..9d5f1b7ebb 100644 --- a/vl.c +++ b/vl.c @@ -3857,9 +3857,11 @@ int main(int argc, char **argv, char **envp) exit(1); } #else - error_report("-sandbox support is not enabled " - "in this QEMU binary"); - exit(1); + if (!g_str_equal(optarg, "off")) { + error_report("-sandbox support is not enabled " + "in this QEMU binary"); + exit(1); + } #endif break; case QEMU_OPTION_add_fd: --=20 2.20.1