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

Commit

Permalink
virtiofsd: Do not use posix lock.
Browse files Browse the repository at this point in the history
We have some issues trying to run `apt upgrade` on
a container that uses virtiofsd with `-o posix_lock`.

Add virtiofsd `-o no_posix_lock` argument to not use the
posix lock.

Signed-off-by: Salvador Fuentes <[email protected]>
  • Loading branch information
chavafg committed Oct 7, 2019
1 parent 23a5dc7 commit ad15631
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion virtcontainers/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func (q *qemu) virtiofsdArgs(fd uintptr) []string {
fmt.Sprintf("--fd=%v", fd),
"-o", "source=" + sourcePath,
"-o", "cache=" + q.config.VirtioFSCache,
"--syslog"}
"--syslog", "-o", "no_posix_lock"}
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 --syslog -d"
result := "--fd=123 -o source=test-share-dir/foo -o cache=none --syslog -o no_posix_lock -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 --syslog -f"
result = "--fd=123 -o source=test-share-dir/foo -o cache=none --syslog -o no_posix_lock -f"
args = q.virtiofsdArgs(123)
assert.Equal(strings.Join(args, " "), result)
}
Expand Down

0 comments on commit ad15631

Please sign in to comment.