Refactor qemuBuildSeccompSandboxCommandLine

Exit early if possible to simplify the logic.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Ján Tomko 2018-04-10 10:34:32 +02:00
parent ee0ea8b12d
commit 88fe165e14

View File

@ -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;