linux: Add RuntimeRoot to RuncOptions

This allow specifying wher the OCI runtime should store its state data.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-08-31 13:26:51 -07:00
parent ab0cb4e756
commit 1b79170849
7 changed files with 131 additions and 70 deletions

View File

@@ -38,8 +38,9 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type RuncOptions struct {
Runtime string `protobuf:"bytes,1,opt,name=runtime,proto3" json:"runtime,omitempty"`
CriuPath string `protobuf:"bytes,2,opt,name=criu_path,json=criuPath,proto3" json:"criu_path,omitempty"`
SystemdCgroup bool `protobuf:"varint,3,opt,name=systemd_cgroup,json=systemdCgroup,proto3" json:"systemd_cgroup,omitempty"`
RuntimeRoot string `protobuf:"bytes,2,opt,name=runtime_root,json=runtimeRoot,proto3" json:"runtime_root,omitempty"`
CriuPath string `protobuf:"bytes,3,opt,name=criu_path,json=criuPath,proto3" json:"criu_path,omitempty"`
SystemdCgroup bool `protobuf:"varint,4,opt,name=systemd_cgroup,json=systemdCgroup,proto3" json:"systemd_cgroup,omitempty"`
}
func (m *RuncOptions) Reset() { *m = RuncOptions{} }
@@ -102,14 +103,20 @@ func (m *RuncOptions) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintRunc(dAtA, i, uint64(len(m.Runtime)))
i += copy(dAtA[i:], m.Runtime)
}
if len(m.CriuPath) > 0 {
if len(m.RuntimeRoot) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintRunc(dAtA, i, uint64(len(m.RuntimeRoot)))
i += copy(dAtA[i:], m.RuntimeRoot)
}
if len(m.CriuPath) > 0 {
dAtA[i] = 0x1a
i++
i = encodeVarintRunc(dAtA, i, uint64(len(m.CriuPath)))
i += copy(dAtA[i:], m.CriuPath)
}
if m.SystemdCgroup {
dAtA[i] = 0x18
dAtA[i] = 0x20
i++
if m.SystemdCgroup {
dAtA[i] = 1
@@ -349,6 +356,10 @@ func (m *RuncOptions) Size() (n int) {
if l > 0 {
n += 1 + l + sovRunc(uint64(l))
}
l = len(m.RuntimeRoot)
if l > 0 {
n += 1 + l + sovRunc(uint64(l))
}
l = len(m.CriuPath)
if l > 0 {
n += 1 + l + sovRunc(uint64(l))
@@ -447,6 +458,7 @@ func (this *RuncOptions) String() string {
}
s := strings.Join([]string{`&RuncOptions{`,
`Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`,
`RuntimeRoot:` + fmt.Sprintf("%v", this.RuntimeRoot) + `,`,
`CriuPath:` + fmt.Sprintf("%v", this.CriuPath) + `,`,
`SystemdCgroup:` + fmt.Sprintf("%v", this.SystemdCgroup) + `,`,
`}`,
@@ -554,6 +566,35 @@ func (m *RuncOptions) Unmarshal(dAtA []byte) error {
m.Runtime = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field RuntimeRoot", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRunc
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthRunc
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.RuntimeRoot = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CriuPath", wireType)
}
@@ -582,7 +623,7 @@ func (m *RuncOptions) Unmarshal(dAtA []byte) error {
}
m.CriuPath = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field SystemdCgroup", wireType)
}
@@ -1198,34 +1239,35 @@ func init() {
}
var fileDescriptorRunc = []byte{
// 453 bytes of a gzipped FileDescriptorProto
0x1f, 0x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0x6b, 0xe4, 0xdf, 0x61, 0x1d, 0xda, 0x8e, 0xfa, 0x33, 0x60, 0x37,
0x17, 0x05, 0xc8, 0x52, 0x93, 0x42, 0xd7, 0x0f, 0xcb, 0xd9, 0x3e, 0xb4, 0xaa, 0xdf, 0xd3, 0xeb,
0x7f, 0x75, 0xc8, 0x97, 0xe9, 0xe5, 0x55, 0xb2, 0xf3, 0xfd, 0x2a, 0xd9, 0xf9, 0xb2, 0x4e, 0x82,
0xcb, 0x75, 0x12, 0x7c, 0x5d, 0x27, 0xc1, 0x8f, 0x75, 0x12, 0x7c, 0x7c, 0xf6, 0x97, 0xdf, 0xe8,
0x45, 0x2f, 0xce, 0x0f, 0xfc, 0xf7, 0x78, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x85, 0x79,
0xc9, 0x89, 0x03, 0x00, 0x00,
// 467 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x93, 0x41, 0x6f, 0xd3, 0x40,
0x10, 0x85, 0xbb, 0x6d, 0x69, 0x9d, 0x4d, 0x53, 0x60, 0xa1, 0x92, 0x29, 0xc2, 0x84, 0x08, 0xa4,
0x70, 0x49, 0x24, 0xb8, 0x20, 0xb8, 0x91, 0x23, 0x50, 0x2a, 0x03, 0x17, 0x2e, 0x2b, 0x77, 0x33,
0x24, 0xab, 0xd8, 0x33, 0xab, 0xdd, 0x35, 0x75, 0x6e, 0xfc, 0x02, 0x7e, 0x57, 0x8f, 0x88, 0x13,
0x47, 0x9a, 0x3f, 0x02, 0xf2, 0xda, 0x2e, 0x5c, 0xb9, 0x72, 0x7b, 0xf3, 0xbd, 0xb1, 0xe7, 0xe9,
0x49, 0xcb, 0x9f, 0x2f, 0xb4, 0x5f, 0x96, 0x67, 0x13, 0x45, 0xc5, 0x54, 0x11, 0xfa, 0x4c, 0x23,
0xd8, 0xf9, 0xdf, 0x32, 0xd7, 0x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 +8,9 @@ option go_package = "github.com/containerd/containerd/linux/runcopts;runcopts";
message RuncOptions {
string runtime = 1;
string criu_path = 2;
bool systemd_cgroup = 3;
string runtime_root = 2;
string criu_path = 3;
bool systemd_cgroup = 4;
}
message CreateOptions {