aboutsummaryrefslogtreecommitdiff
path: root/pkg/machine/qemu/machine.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-07 18:21:55 +0000
committerGitHub <noreply@github.com>2022-07-07 18:21:55 +0000
commitd481fbe7593b8b2ead4c77f6ceaaf2a233ef209b (patch)
tree9df5f994d6dccf3bd6899ad153338e50d4fbb1a1 /pkg/machine/qemu/machine.go
parent41ac2cfb1976c9ca793fd29ac1a4099ced27bbee (diff)
parent03ee8204d394da467e991b9ec62581b80fc6c2fb (diff)
downloadpodman-d481fbe7593b8b2ead4c77f6ceaaf2a233ef209b.tar.gz
podman-d481fbe7593b8b2ead4c77f6ceaaf2a233ef209b.tar.bz2
podman-d481fbe7593b8b2ead4c77f6ceaaf2a233ef209b.zip
Merge pull request #14803 from bugfood/volumes
make 9p security model configurable; document
Diffstat (limited to 'pkg/machine/qemu/machine.go')
-rw-r--r--pkg/machine/qemu/machine.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index d208b11eb..322aa3a15 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -318,6 +318,7 @@ func (v *MachineVM) Init(opts machine.InitOptions) (bool, error) {
source := paths[0]
target := source
readonly := false
+ securityModel := "mapped-xattr"
if len(paths) > 1 {
target = paths[1]
}
@@ -325,18 +326,20 @@ func (v *MachineVM) Init(opts machine.InitOptions) (bool, error) {
options := paths[2]
volopts := strings.Split(options, ",")
for _, o := range volopts {
- switch o {
- case "rw":
+ switch {
+ case o == "rw":
readonly = false
- case "ro":
+ case o == "ro":
readonly = true
+ case strings.HasPrefix(o, "security_model="):
+ securityModel = strings.Split(o, "=")[1]
default:
fmt.Printf("Unknown option: %s\n", o)
}
}
}
if volumeType == VolumeTypeVirtfs {
- virtfsOptions := fmt.Sprintf("local,path=%s,mount_tag=%s,security_model=mapped-xattr", source, tag)
+ virtfsOptions := fmt.Sprintf("local,path=%s,mount_tag=%s,security_model=%s", source, tag, securityModel)
if readonly {
virtfsOptions += ",readonly"
}