Skip to content

Commit

Permalink
qemu: Pass sandboxID to agent for logging purposes
Browse files Browse the repository at this point in the history
Add a kernel command-line option that the agent can read to determine
the sandbox ID of the VM. It can use this to create a `sandbox=` log
field for improved log analysis.

Fixes kata-containers#465.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Jul 4, 2018
1 parent bf1cf68 commit 793a220
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,14 @@ func (q *qemu) createSandbox(sandboxConfig SandboxConfig) error {
return err
}

// Pass the sandbox name to the agent via the kernel command-line to
// allow the agent to use it in log messages.
params := q.kernelParameters() + " " + "agent.sandbox=" + sandboxConfig.ID

kernel := govmmQemu.Kernel{
Path: kernelPath,
InitrdPath: initrdPath,
Params: q.kernelParameters(),
Params: params,
}

rtc := govmmQemu.RTC{
Expand Down

0 comments on commit 793a220

Please sign in to comment.