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

Introduce qemuBuildSeccompSandboxCommandLine

Move the building of -sandbox command line into a separate function.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 7de761a6
......@@ -9724,6 +9724,21 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver,
}
static int
qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd,
virQEMUDriverConfigPtr cfg,
virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED)
{
if (cfg->seccompSandbox == 0)
virCommandAddArgList(cmd, "-sandbox", "off", NULL);
else if (cfg->seccompSandbox > 0)
virCommandAddArgList(cmd, "-sandbox", "on", NULL);
return 0;
}
/*
* Constructs a argv suitable for launching qemu with config defined
* for a given virtual machine.
......@@ -9954,10 +9969,8 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
? qemucmd->env_value[i] : "");
}
if (cfg->seccompSandbox == 0)
virCommandAddArgList(cmd, "-sandbox", "off", NULL);
else if (cfg->seccompSandbox > 0)
virCommandAddArgList(cmd, "-sandbox", "on", NULL);
if (qemuBuildSeccompSandboxCommandLine(cmd, cfg, qemuCaps) < 0)
goto error;
if (qemuBuildPanicCommandLine(cmd, def, qemuCaps) < 0)
goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册