virtiofsd: use virtiofsd --syslog

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 <stefanha@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2019-08-21 10:52:19 +01:00
parent d5a3d0a61c
commit 23a5dc7ff8
2 changed files with 4 additions and 3 deletions

View File

@ -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 {

View File

@ -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)
}