mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
ee0ea8b12d
commit
88fe165e14
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue