From: "Daniel P. Berrangé" <berrange@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: otubo@redhat.com, pbonzini@redhat.com, qemu-ppc@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Allow -sandbox off with --disable-seccomp
Date: Wed, 27 Feb 2019 11:01:27 +0000 [thread overview]
Message-ID: <20190227110127.GE31688@redhat.com> (raw)
In-Reply-To: <20190227012132.16271-1-david@gibson.dropbear.id.au>
On Wed, Feb 27, 2019 at 12:21:32PM +1100, David Gibson wrote:
> 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);
> + }
'-sandbox off' is just syntax sugar for '-sandbox enable=off', with
the default arg name handled by QemuOpts.
If we want to keep ability to run "-sandbox off" we should do it via
the QEMU opts code we already have in the first part of the conditional,
so that "-sandbox enable=off" also works as normal.
Essentially we need to push the #ifdef CONFIG_SECCOMP down into the
parse_sandbox method, so that it parses the "enable" option normally
but rejects any value except disabled..
The QemuOptsList should also be conditional to only register the
"enable" arg and not the other bits.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2019-02-27 11:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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é [this message]
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é
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190227110127.GE31688@redhat.com \
--to=berrange@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=otubo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).