From: Ján Tomko Date: Tue, 10 Apr 2018 08:34:32 +0000 (+0200) Subject: Refactor qemuBuildSeccompSandboxCommandLine X-Git-Tag: v4.3.0-rc1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88fe165e143ce9db58880ae213bd2b97d0d82630;p=thirdparty%2Flibvirt.git Refactor qemuBuildSeccompSandboxCommandLine Exit early if possible to simplify the logic. Signed-off-by: Ján Tomko Reviewed-by: John Ferlan Reviewed-by: Daniel P. Berrangé --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ea0dc6f183..c59d0a9ff1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9729,9 +9729,12 @@ qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd, virQEMUDriverConfigPtr cfg, virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED) { - if (cfg->seccompSandbox == 0) + if (cfg->seccompSandbox == 0) { virCommandAddArgList(cmd, "-sandbox", "off", NULL); - else if (cfg->seccompSandbox > 0) + return 0; + } + + if (cfg->seccompSandbox > 0) virCommandAddArgList(cmd, "-sandbox", "on", NULL); return 0;