qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to command


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCHv4 2/6] seccomp: add obsolete argument to command line
Date: Fri, 1 Sep 2017 12:05:41 +0100
User-agent: Mutt/1.8.3 (2017-05-23)

On Fri, Sep 01, 2017 at 12:58:14PM +0200, Eduardo Otubo wrote:
> This patch introduces the argument [,obsolete=allow] to the `-sandbox on'
> option. It allows Qemu to run safely on old system that still relies on
> old system calls.
> 
> Signed-off-by: Eduardo Otubo <address@hidden>
> ---
>  include/sysemu/seccomp.h |  3 ++-
>  qemu-options.hx          | 12 ++++++++++--
>  qemu-seccomp.c           | 23 ++++++++++++++++++++++-
>  vl.c                     | 22 +++++++++++++++++++++-
>  4 files changed, 55 insertions(+), 5 deletions(-)
> 

> @@ -72,6 +85,14 @@ int seccomp_start(void)
>  
>      for (i = 0; i < ARRAY_SIZE(blacklist); i++) {
>          switch (blacklist[i].set) {
> +        case QEMU_SECCOMP_SET_OBSOLETE:
> +            if (!(seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {
> +                goto add_syscall;
> +            } else {
> +                continue;
> +            }
> +
> +            break;

THis can be simplified:

            if ((seccomp_opts & QEMU_SECCOMP_SET_OBSOLETE)) {
                continue;
            }

            break;

thus avoiding need to 'goto'

Likewise for all following patches

>          default:
>              goto add_syscall;
>          }

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 :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]