qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Allow -sandbox off with --disable-seccomp
@ 2019-02-27  1:21 David Gibson
  2019-02-27  9:51 ` Marc-André Lureau
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David Gibson @ 2019-02-27  1:21 UTC (permalink / raw)
  To: otubo, pbonzini; +Cc: qemu-devel, qemu-ppc, David Gibson

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 <david@gibson.dropbear.id.au>
---
 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:
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-02-28 10:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-27  1:21 [Qemu-devel] [PATCH] Allow -sandbox off with --disable-seccomp David Gibson
2019-02-27  9:51 ` Marc-André Lureau
2019-02-27 10:39 ` Stefano Garzarella
2019-02-27 11:01 ` Daniel P. Berrangé
2019-02-27 13:59   ` Eric Blake
2019-02-27 14:08     ` Daniel P. Berrangé
2019-02-27 19:21       ` Markus Armbruster
2019-02-28 10:22         ` Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).