Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtiofsd: use virtiofsd --syslog
Browse files Browse the repository at this point in the history
Log to syslog instead of stderr.  This way all Kata and virtiofsd logs
are captured in syslog (or the systemd journal).  This makes debugging
much easier.

Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
stefanhaRH committed Oct 7, 2019
1 parent d5a3d0a commit 23a5dc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ func (q *qemu) virtiofsdArgs(fd uintptr) []string {
args := []string{
fmt.Sprintf("--fd=%v", fd),
"-o", "source=" + sourcePath,
"-o", "cache=" + q.config.VirtioFSCache}
"-o", "cache=" + q.config.VirtioFSCache,
"--syslog"}
if q.config.Debug {
args = append(args, "-d")
} else {
Expand Down
4 changes: 2 additions & 2 deletions virtcontainers/qemu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,12 @@ func TestQemuVirtiofsdArgs(t *testing.T) {
kataHostSharedDir = savedKataHostSharedDir
}()

result := "--fd=123 -o source=test-share-dir/foo -o cache=none -d"
result := "--fd=123 -o source=test-share-dir/foo -o cache=none --syslog -d"
args := q.virtiofsdArgs(123)
assert.Equal(strings.Join(args, " "), result)

q.config.Debug = false
result = "--fd=123 -o source=test-share-dir/foo -o cache=none -f"
result = "--fd=123 -o source=test-share-dir/foo -o cache=none --syslog -f"
args = q.virtiofsdArgs(123)
assert.Equal(strings.Join(args, " "), result)
}
Expand Down

0 comments on commit 23a5dc7

Please sign in to comment.