Merge pull request #7155 from gkurz/backport-pr-7112

[stable-3.1] Fix deprecated virtiofsd args (go shim only)
This commit is contained in:
Greg Kurz
2023-06-22 11:23:41 +02:00
committed by GitHub
5 changed files with 9 additions and 14 deletions

View File

@@ -210,7 +210,7 @@ DEFVIRTIOFSQUEUESIZE ?= 1024
# #
# see `virtiofsd -h` for possible options. # see `virtiofsd -h` for possible options.
# Make sure you quote args. # Make sure you quote args.
DEFVIRTIOFSEXTRAARGS ?= [\"--thread-pool-size=1\", \"-o\", \"announce_submounts\"] DEFVIRTIOFSEXTRAARGS ?= [\"--thread-pool-size=1\", \"--announce-submounts\"]
DEFENABLEIOTHREADS := false DEFENABLEIOTHREADS := false
DEFENABLEVHOSTUSERSTORE := false DEFENABLEVHOSTUSERSTORE := false
DEFVHOSTUSERSTOREPATH := $(PKGRUNDIR)/vhost-user DEFVHOSTUSERSTOREPATH := $(PKGRUNDIR)/vhost-user

View File

@@ -145,9 +145,9 @@ virtio_fs_queue_size = @DEFVIRTIOFSQUEUESIZE@
# Extra args for virtiofsd daemon # Extra args for virtiofsd daemon
# #
# Format example: # Format example:
# ["-o", "arg1=xxx,arg2", "-o", "hello world", "--arg3=yyy"] # ["--arg1=xxx", "--arg2=yyy"]
# Examples: # Examples:
# Set virtiofsd log level to debug : ["-o", "log_level=debug"] or ["-d"] # Set virtiofsd log level to debug : ["--log-level=debug"]
# see `virtiofsd -h` for possible options. # see `virtiofsd -h` for possible options.
virtio_fs_extra_args = @DEFVIRTIOFSEXTRAARGS@ virtio_fs_extra_args = @DEFVIRTIOFSEXTRAARGS@

View File

@@ -197,9 +197,9 @@ virtio_fs_queue_size = @DEFVIRTIOFSQUEUESIZE@
# Extra args for virtiofsd daemon # Extra args for virtiofsd daemon
# #
# Format example: # Format example:
# ["-o", "arg1=xxx,arg2", "-o", "hello world", "--arg3=yyy"] # ["--arg1=xxx", "--arg2=yyy"]
# Examples: # Examples:
# Set virtiofsd log level to debug : ["-o", "log_level=debug"] or ["-d"] # Set virtiofsd log level to debug : ["--log-level=debug"]
# #
# see `virtiofsd -h` for possible options. # see `virtiofsd -h` for possible options.
virtio_fs_extra_args = @DEFVIRTIOFSEXTRAARGS@ virtio_fs_extra_args = @DEFVIRTIOFSEXTRAARGS@

View File

@@ -186,16 +186,11 @@ func (v *virtiofsd) args(FdSocketNumber uint) ([]string, error) {
// Send logs to syslog // Send logs to syslog
"--syslog", "--syslog",
// cache mode for virtiofsd // cache mode for virtiofsd
"-o", "cache=" + v.cache, "--cache=" + v.cache,
// disable posix locking in daemon: bunch of basic posix locks properties are broken
// apt-get update is broken if enabled
"-o", "no_posix_lock",
// shared directory tree // shared directory tree
"-o", "source=" + v.sourcePath, "--shared-dir=" + v.sourcePath,
// fd number of vhost-user socket // fd number of vhost-user socket
fmt.Sprintf("--fd=%v", FdSocketNumber), fmt.Sprintf("--fd=%v", FdSocketNumber),
// foreground operation
"-f",
} }
if len(v.extraArgs) != 0 { if len(v.extraArgs) != 0 {

View File

@@ -79,12 +79,12 @@ func TestVirtiofsdArgs(t *testing.T) {
cache: "none", cache: "none",
} }
expected := "--syslog -o cache=none -o no_posix_lock -o source=/run/kata-shared/foo --fd=123 -f" expected := "--syslog --cache=none --shared-dir=/run/kata-shared/foo --fd=123"
args, err := v.args(123) args, err := v.args(123)
assert.NoError(err) assert.NoError(err)
assert.Equal(expected, strings.Join(args, " ")) assert.Equal(expected, strings.Join(args, " "))
expected = "--syslog -o cache=none -o no_posix_lock -o source=/run/kata-shared/foo --fd=456 -f" expected = "--syslog --cache=none --shared-dir=/run/kata-shared/foo --fd=456"
args, err = v.args(456) args, err = v.args(456)
assert.NoError(err) assert.NoError(err)
assert.Equal(expected, strings.Join(args, " ")) assert.Equal(expected, strings.Join(args, " "))