diff --git a/virtcontainers/qemu.go b/virtcontainers/qemu.go index 47dd22e6c..7500c0ae6 100644 --- a/virtcontainers/qemu.go +++ b/virtcontainers/qemu.go @@ -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 { diff --git a/virtcontainers/qemu_test.go b/virtcontainers/qemu_test.go index 72dcace95..7a4a7b6f5 100644 --- a/virtcontainers/qemu_test.go +++ b/virtcontainers/qemu_test.go @@ -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) }