mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Introduce qemuBuildSeccompSandboxCommandLine
Move the building of -sandbox command line into a separate function. 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
7de761a67b
commit
ee0ea8b12d
@ -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
|
* Constructs a argv suitable for launching qemu with config defined
|
||||||
* for a given virtual machine.
|
* for a given virtual machine.
|
||||||
@ -9954,10 +9969,8 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
|
|||||||
? qemucmd->env_value[i] : "");
|
? qemucmd->env_value[i] : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg->seccompSandbox == 0)
|
if (qemuBuildSeccompSandboxCommandLine(cmd, cfg, qemuCaps) < 0)
|
||||||
virCommandAddArgList(cmd, "-sandbox", "off", NULL);
|
goto error;
|
||||||
else if (cfg->seccompSandbox > 0)
|
|
||||||
virCommandAddArgList(cmd, "-sandbox", "on", NULL);
|
|
||||||
|
|
||||||
if (qemuBuildPanicCommandLine(cmd, def, qemuCaps) < 0)
|
if (qemuBuildPanicCommandLine(cmd, def, qemuCaps) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user