qemu: only pass -sandbox off if supported

This way we don't rely on QEMU supplying the -sandbox option
without CONFIG_SECCOMP.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Ján Tomko 2018-05-18 14:57:51 +02:00
parent 6dbe7243f9
commit b87222a909

View File

@ -9853,7 +9853,8 @@ qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd,
virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED)
{
if (cfg->seccompSandbox == 0) {
virCommandAddArgList(cmd, "-sandbox", "off", NULL);
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SECCOMP_SANDBOX))
virCommandAddArgList(cmd, "-sandbox", "off", NULL);
return 0;
}