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>
This commit is contained in:
Greg Kurz
2023-06-14 12:33:45 +02:00
parent 8e00dc6944
commit a43ea24dfc
5 changed files with 9 additions and 9 deletions

View File

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

View File

@@ -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, " "))