mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-13 21:56:32 +00:00
virtiofsd: Convert legacy -o
sub-options to their --
replacement
The `-o` option is the legacy way to configure virtiofsd, inherited
from the C implementation. The rust implementation honours it for
compatibility but it logs deprecation warnings.
Let's use the replacement options in the go shim code. Also drop
references to `-o` from the configuration TOML file.
Fixes #7111
Signed-off-by: Greg Kurz <groug@kaod.org>
(cherry picked from commit a43ea24dfc
)
Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
2e9125c32b
commit
993ecec932
@ -210,7 +210,7 @@ DEFVIRTIOFSQUEUESIZE ?= 1024
|
||||
#
|
||||
# see `virtiofsd -h` for possible options.
|
||||
# Make sure you quote args.
|
||||
DEFVIRTIOFSEXTRAARGS ?= [\"--thread-pool-size=1\", \"-o\", \"announce_submounts\"]
|
||||
DEFVIRTIOFSEXTRAARGS ?= [\"--thread-pool-size=1\", \"--announce-submounts\"]
|
||||
DEFENABLEIOTHREADS := false
|
||||
DEFENABLEVHOSTUSERSTORE := false
|
||||
DEFVHOSTUSERSTOREPATH := $(PKGRUNDIR)/vhost-user
|
||||
|
@ -145,9 +145,9 @@ virtio_fs_queue_size = @DEFVIRTIOFSQUEUESIZE@
|
||||
# Extra args for virtiofsd daemon
|
||||
#
|
||||
# Format example:
|
||||
# ["-o", "arg1=xxx,arg2", "-o", "hello world", "--arg3=yyy"]
|
||||
# ["--arg1=xxx", "--arg2=yyy"]
|
||||
# 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.
|
||||
virtio_fs_extra_args = @DEFVIRTIOFSEXTRAARGS@
|
||||
|
||||
|
@ -197,9 +197,9 @@ virtio_fs_queue_size = @DEFVIRTIOFSQUEUESIZE@
|
||||
# Extra args for virtiofsd daemon
|
||||
#
|
||||
# Format example:
|
||||
# ["-o", "arg1=xxx,arg2", "-o", "hello world", "--arg3=yyy"]
|
||||
# ["--arg1=xxx", "--arg2=yyy"]
|
||||
# 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.
|
||||
virtio_fs_extra_args = @DEFVIRTIOFSEXTRAARGS@
|
||||
|
@ -186,9 +186,9 @@ func (v *virtiofsd) args(FdSocketNumber uint) ([]string, error) {
|
||||
// Send logs to syslog
|
||||
"--syslog",
|
||||
// cache mode for virtiofsd
|
||||
"-o", "cache=" + v.cache,
|
||||
"--cache=" + v.cache,
|
||||
// shared directory tree
|
||||
"-o", "source=" + v.sourcePath,
|
||||
"--shared-dir=" + v.sourcePath,
|
||||
// fd number of vhost-user socket
|
||||
fmt.Sprintf("--fd=%v", FdSocketNumber),
|
||||
}
|
||||
|
@ -79,12 +79,12 @@ func TestVirtiofsdArgs(t *testing.T) {
|
||||
cache: "none",
|
||||
}
|
||||
|
||||
expected := "--syslog -o cache=none -o source=/run/kata-shared/foo --fd=123"
|
||||
expected := "--syslog --cache=none --shared-dir=/run/kata-shared/foo --fd=123"
|
||||
args, err := v.args(123)
|
||||
assert.NoError(err)
|
||||
assert.Equal(expected, strings.Join(args, " "))
|
||||
|
||||
expected = "--syslog -o cache=none -o source=/run/kata-shared/foo --fd=456"
|
||||
expected = "--syslog --cache=none --shared-dir=/run/kata-shared/foo --fd=456"
|
||||
args, err = v.args(456)
|
||||
assert.NoError(err)
|
||||
assert.Equal(expected, strings.Join(args, " "))
|
||||
|
Loading…
Reference in New Issue
Block a user