From 88fe165e143ce9db58880ae213bd2b97d0d82630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 10 Apr 2018 10:34:32 +0200 Subject: [PATCH] Refactor qemuBuildSeccompSandboxCommandLine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exit early if possible to simplify the logic. Signed-off-by: Ján Tomko Reviewed-by: John Ferlan Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_command.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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;