提交 88fe165e 编写于 作者: J Ján Tomko

Refactor qemuBuildSeccompSandboxCommandLine

Exit early if possible to simplify the logic.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 ee0ea8b1
...@@ -9729,9 +9729,12 @@ qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd, ...@@ -9729,9 +9729,12 @@ qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED) virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED)
{ {
if (cfg->seccompSandbox == 0) if (cfg->seccompSandbox == 0) {
virCommandAddArgList(cmd, "-sandbox", "off", NULL); virCommandAddArgList(cmd, "-sandbox", "off", NULL);
else if (cfg->seccompSandbox > 0) return 0;
}
if (cfg->seccompSandbox > 0)
virCommandAddArgList(cmd, "-sandbox", "on", NULL); virCommandAddArgList(cmd, "-sandbox", "on", NULL);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册