/
plan9.go
38 lines (34 loc) · 1.05 KB
/
plan9.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package hcs
import (
"context"
"github.com/Microsoft/hcsshim/internal/hcs/resourcepaths"
hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2"
"github.com/Microsoft/hcsshim/internal/requesttype"
)
func (uvm *utilityVM) AddPlan9(ctx context.Context, path, name string, port int32, flags int32, allowed []string) error {
modification := &hcsschema.ModifySettingRequest{
RequestType: requesttype.Add,
Settings: hcsschema.Plan9Share{
Name: name,
AccessName: name,
Path: path,
Port: port,
Flags: flags,
AllowedFiles: allowed,
},
ResourcePath: resourcepaths.Plan9ShareResourcePath,
}
return uvm.cs.Modify(ctx, modification)
}
func (uvm *utilityVM) RemovePlan9(ctx context.Context, name string, port int32) error {
modification := &hcsschema.ModifySettingRequest{
RequestType: requesttype.Remove,
Settings: hcsschema.Plan9Share{
Name: name,
AccessName: name,
Port: port,
},
ResourcePath: resourcepaths.Plan9ShareResourcePath,
}
return uvm.cs.Modify(ctx, modification)
}