diff --git a/src/runtime/hack/update-generated-hypervisor-proto.sh b/src/runtime/hack/update-generated-hypervisor-proto.sh new file mode 100755 index 0000000000..16c873d98e --- /dev/null +++ b/src/runtime/hack/update-generated-hypervisor-proto.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -o errexit -o pipefail -o nounset + +cd "$(dirname "${BASH_SOURCE[0]}")/.." + +protoc --gogottrpc_out=protocols/hypervisor \ + --gogottrpc_opt=plugins=ttrpc+fieldpath,paths=source_relative \ + -Iprotocols/hypervisor \ + -I../agent/protocols/protos/gogo/protobuf \ + protocols/hypervisor/hypervisor.proto diff --git a/src/runtime/protocols/hypervisor/hypervisor.pb.go b/src/runtime/protocols/hypervisor/hypervisor.pb.go new file mode 100644 index 0000000000..ba3b7d7786 --- /dev/null +++ b/src/runtime/protocols/hypervisor/hypervisor.pb.go @@ -0,0 +1,1848 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: hypervisor.proto + +package hypervisor + +import ( + context "context" + fmt "fmt" + github_com_containerd_ttrpc "github.com/containerd/ttrpc" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type VersionRequest struct { + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VersionRequest) Reset() { *m = VersionRequest{} } +func (*VersionRequest) ProtoMessage() {} +func (*VersionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{0} +} +func (m *VersionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VersionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VersionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_VersionRequest.Merge(m, src) +} +func (m *VersionRequest) XXX_Size() int { + return m.Size() +} +func (m *VersionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_VersionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_VersionRequest proto.InternalMessageInfo + +type VersionResponse struct { + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VersionResponse) Reset() { *m = VersionResponse{} } +func (*VersionResponse) ProtoMessage() {} +func (*VersionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{1} +} +func (m *VersionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VersionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VersionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_VersionResponse.Merge(m, src) +} +func (m *VersionResponse) XXX_Size() int { + return m.Size() +} +func (m *VersionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_VersionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_VersionResponse proto.InternalMessageInfo + +type CreateVMRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + NetworkNamespacePath string `protobuf:"bytes,3,opt,name=networkNamespacePath,proto3" json:"networkNamespacePath,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateVMRequest) Reset() { *m = CreateVMRequest{} } +func (*CreateVMRequest) ProtoMessage() {} +func (*CreateVMRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{2} +} +func (m *CreateVMRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateVMRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateVMRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateVMRequest.Merge(m, src) +} +func (m *CreateVMRequest) XXX_Size() int { + return m.Size() +} +func (m *CreateVMRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateVMRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateVMRequest proto.InternalMessageInfo + +type CreateVMResponse struct { + AgentSocketPath string `protobuf:"bytes,1,opt,name=agentSocketPath,proto3" json:"agentSocketPath,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateVMResponse) Reset() { *m = CreateVMResponse{} } +func (*CreateVMResponse) ProtoMessage() {} +func (*CreateVMResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{3} +} +func (m *CreateVMResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CreateVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CreateVMResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CreateVMResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateVMResponse.Merge(m, src) +} +func (m *CreateVMResponse) XXX_Size() int { + return m.Size() +} +func (m *CreateVMResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CreateVMResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateVMResponse proto.InternalMessageInfo + +type StartVMRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StartVMRequest) Reset() { *m = StartVMRequest{} } +func (*StartVMRequest) ProtoMessage() {} +func (*StartVMRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{4} +} +func (m *StartVMRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StartVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StartVMRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StartVMRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StartVMRequest.Merge(m, src) +} +func (m *StartVMRequest) XXX_Size() int { + return m.Size() +} +func (m *StartVMRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StartVMRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StartVMRequest proto.InternalMessageInfo + +type StartVMResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StartVMResponse) Reset() { *m = StartVMResponse{} } +func (*StartVMResponse) ProtoMessage() {} +func (*StartVMResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{5} +} +func (m *StartVMResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StartVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StartVMResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StartVMResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StartVMResponse.Merge(m, src) +} +func (m *StartVMResponse) XXX_Size() int { + return m.Size() +} +func (m *StartVMResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StartVMResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StartVMResponse proto.InternalMessageInfo + +type StopVMRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StopVMRequest) Reset() { *m = StopVMRequest{} } +func (*StopVMRequest) ProtoMessage() {} +func (*StopVMRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{6} +} +func (m *StopVMRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StopVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StopVMRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StopVMRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StopVMRequest.Merge(m, src) +} +func (m *StopVMRequest) XXX_Size() int { + return m.Size() +} +func (m *StopVMRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StopVMRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StopVMRequest proto.InternalMessageInfo + +type StopVMResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StopVMResponse) Reset() { *m = StopVMResponse{} } +func (*StopVMResponse) ProtoMessage() {} +func (*StopVMResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7b34fdb27c05edf8, []int{7} +} +func (m *StopVMResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StopVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StopVMResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StopVMResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StopVMResponse.Merge(m, src) +} +func (m *StopVMResponse) XXX_Size() int { + return m.Size() +} +func (m *StopVMResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StopVMResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StopVMResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*VersionRequest)(nil), "hypervisor.VersionRequest") + proto.RegisterType((*VersionResponse)(nil), "hypervisor.VersionResponse") + proto.RegisterType((*CreateVMRequest)(nil), "hypervisor.CreateVMRequest") + proto.RegisterMapType((map[string]string)(nil), "hypervisor.CreateVMRequest.AnnotationsEntry") + proto.RegisterType((*CreateVMResponse)(nil), "hypervisor.CreateVMResponse") + proto.RegisterType((*StartVMRequest)(nil), "hypervisor.StartVMRequest") + proto.RegisterType((*StartVMResponse)(nil), "hypervisor.StartVMResponse") + proto.RegisterType((*StopVMRequest)(nil), "hypervisor.StopVMRequest") + proto.RegisterType((*StopVMResponse)(nil), "hypervisor.StopVMResponse") +} + +func init() { proto.RegisterFile("hypervisor.proto", fileDescriptor_7b34fdb27c05edf8) } + +var fileDescriptor_7b34fdb27c05edf8 = []byte{ + // 390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcf, 0x4e, 0xf2, 0x40, + 0x14, 0xc5, 0x3b, 0x25, 0x1f, 0x7c, 0x5e, 0x22, 0xad, 0x13, 0x16, 0xb5, 0x98, 0x4a, 0xba, 0x22, + 0x6a, 0x58, 0xe0, 0xc6, 0x18, 0x63, 0x82, 0x7f, 0xa2, 0x1b, 0x89, 0x81, 0x84, 0xfd, 0x08, 0x13, + 0x69, 0xd0, 0x99, 0x3a, 0x1d, 0x30, 0xec, 0x7c, 0x18, 0x1f, 0x86, 0xa5, 0x4b, 0x97, 0xd2, 0xc4, + 0xf7, 0x30, 0xb4, 0xa5, 0xb4, 0x4d, 0x61, 0xd7, 0xb9, 0xf7, 0xcc, 0xe9, 0xef, 0x9e, 0xdc, 0x01, + 0x7d, 0x34, 0x73, 0xa9, 0x98, 0x3a, 0x1e, 0x17, 0x4d, 0x57, 0x70, 0xc9, 0x31, 0xac, 0x2b, 0xf6, + 0x11, 0x54, 0xfa, 0x54, 0x78, 0x0e, 0x67, 0x5d, 0xfa, 0x36, 0xa1, 0x9e, 0xc4, 0x06, 0x94, 0xa6, + 0x61, 0xc5, 0x40, 0x75, 0xd4, 0xd8, 0xe9, 0xae, 0x8e, 0xf6, 0x31, 0x68, 0xb1, 0xd6, 0x73, 0x39, + 0xf3, 0xe8, 0x16, 0xf1, 0x2f, 0x02, 0xed, 0x5a, 0x50, 0x22, 0x69, 0xff, 0x61, 0x65, 0x5d, 0x01, + 0xd5, 0x19, 0x46, 0x42, 0xd5, 0x19, 0xe2, 0x0e, 0x94, 0x09, 0x63, 0x5c, 0x12, 0xe9, 0x70, 0xe6, + 0x19, 0x6a, 0xbd, 0xd0, 0x28, 0xb7, 0x4e, 0x9a, 0x09, 0xe0, 0x8c, 0x43, 0xb3, 0xbd, 0x96, 0xdf, + 0x32, 0x29, 0x66, 0xdd, 0xa4, 0x01, 0x6e, 0x41, 0x95, 0x51, 0xf9, 0xce, 0xc5, 0xb8, 0x43, 0x5e, + 0xa9, 0xe7, 0x92, 0x01, 0x7d, 0x24, 0x72, 0x64, 0x14, 0x82, 0x3f, 0xe6, 0xf6, 0xcc, 0x4b, 0xd0, + 0xb3, 0xa6, 0x58, 0x87, 0xc2, 0x98, 0xce, 0x22, 0xd0, 0xe5, 0x27, 0xae, 0xc2, 0xbf, 0x29, 0x79, + 0x99, 0x50, 0x43, 0x0d, 0x6a, 0xe1, 0xe1, 0x5c, 0x3d, 0x43, 0xf6, 0x05, 0xe8, 0x6b, 0xc8, 0x28, + 0x95, 0x06, 0x68, 0xe4, 0x99, 0x32, 0xd9, 0xe3, 0x83, 0x31, 0x95, 0x01, 0x42, 0xe8, 0x95, 0x2d, + 0xdb, 0x75, 0xa8, 0xf4, 0x24, 0x11, 0x72, 0x63, 0x46, 0xf6, 0x1e, 0x68, 0xb1, 0x22, 0xb4, 0xb7, + 0x0f, 0x61, 0xb7, 0x27, 0xb9, 0xbb, 0xf9, 0x8e, 0xbe, 0x74, 0x0d, 0x05, 0xe1, 0x95, 0xd6, 0xa7, + 0x0a, 0x70, 0x1f, 0xc7, 0x8a, 0xef, 0xe0, 0xff, 0x0a, 0x1a, 0xd7, 0xb6, 0xe4, 0x6d, 0x1e, 0xe4, + 0x37, 0x23, 0x10, 0x05, 0xdf, 0x40, 0x29, 0xa2, 0xc3, 0x66, 0x52, 0x9a, 0x1e, 0xca, 0xac, 0xe5, + 0xf6, 0x62, 0x97, 0x36, 0x14, 0x43, 0x5e, 0xbc, 0x9f, 0x16, 0x26, 0x86, 0x34, 0xcd, 0xbc, 0x56, + 0x12, 0x24, 0xda, 0xcd, 0x34, 0x48, 0x7a, 0xb9, 0xd3, 0x20, 0x99, 0x65, 0xb6, 0x95, 0x2b, 0x63, + 0xbe, 0xb0, 0x94, 0xef, 0x85, 0xa5, 0x7c, 0xf8, 0x16, 0x9a, 0xfb, 0x16, 0xfa, 0xf2, 0x2d, 0xf4, + 0xe3, 0x5b, 0xe8, 0xa9, 0x18, 0x3c, 0x9d, 0xd3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xc0, + 0xa3, 0xa4, 0x4e, 0x03, 0x00, 0x00, +} + +func (m *VersionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VersionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VersionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintHypervisor(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *VersionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VersionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintHypervisor(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateVMRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateVMRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.NetworkNamespacePath) > 0 { + i -= len(m.NetworkNamespacePath) + copy(dAtA[i:], m.NetworkNamespacePath) + i = encodeVarintHypervisor(dAtA, i, uint64(len(m.NetworkNamespacePath))) + i-- + dAtA[i] = 0x1a + } + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintHypervisor(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintHypervisor(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintHypervisor(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintHypervisor(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateVMResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateVMResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.AgentSocketPath) > 0 { + i -= len(m.AgentSocketPath) + copy(dAtA[i:], m.AgentSocketPath) + i = encodeVarintHypervisor(dAtA, i, uint64(len(m.AgentSocketPath))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StartVMRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StartVMRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StartVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintHypervisor(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StartVMResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StartVMResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StartVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func (m *StopVMRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopVMRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StopVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintHypervisor(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StopVMResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopVMResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StopVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + return len(dAtA) - i, nil +} + +func encodeVarintHypervisor(dAtA []byte, offset int, v uint64) int { + offset -= sovHypervisor(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *VersionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + sovHypervisor(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *VersionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + sovHypervisor(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CreateVMRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovHypervisor(uint64(l)) + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovHypervisor(uint64(len(k))) + 1 + len(v) + sovHypervisor(uint64(len(v))) + n += mapEntrySize + 1 + sovHypervisor(uint64(mapEntrySize)) + } + } + l = len(m.NetworkNamespacePath) + if l > 0 { + n += 1 + l + sovHypervisor(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CreateVMResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AgentSocketPath) + if l > 0 { + n += 1 + l + sovHypervisor(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StartVMRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovHypervisor(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StartVMResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StopVMRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovHypervisor(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StopVMResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovHypervisor(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozHypervisor(x uint64) (n int) { + return sovHypervisor(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *VersionRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VersionRequest{`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *VersionResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VersionResponse{`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CreateVMRequest) String() string { + if this == nil { + return "nil" + } + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k, _ := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + s := strings.Join([]string{`&CreateVMRequest{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `Annotations:` + mapStringForAnnotations + `,`, + `NetworkNamespacePath:` + fmt.Sprintf("%v", this.NetworkNamespacePath) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *CreateVMResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CreateVMResponse{`, + `AgentSocketPath:` + fmt.Sprintf("%v", this.AgentSocketPath) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *StartVMRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StartVMRequest{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *StartVMResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StartVMResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *StopVMRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StopVMRequest{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func (this *StopVMResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StopVMResponse{`, + `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, + `}`, + }, "") + return s +} +func valueToStringHypervisor(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} + +type HypervisorService interface { + CreateVM(ctx context.Context, req *CreateVMRequest) (*CreateVMResponse, error) + StartVM(ctx context.Context, req *StartVMRequest) (*StartVMResponse, error) + StopVM(ctx context.Context, req *StopVMRequest) (*StopVMResponse, error) + Version(ctx context.Context, req *VersionRequest) (*VersionResponse, error) +} + +func RegisterHypervisorService(srv *github_com_containerd_ttrpc.Server, svc HypervisorService) { + srv.Register("hypervisor.Hypervisor", map[string]github_com_containerd_ttrpc.Method{ + "CreateVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req CreateVMRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.CreateVM(ctx, &req) + }, + "StartVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req StartVMRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.StartVM(ctx, &req) + }, + "StopVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req StopVMRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.StopVM(ctx, &req) + }, + "Version": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req VersionRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Version(ctx, &req) + }, + }) +} + +type hypervisorClient struct { + client *github_com_containerd_ttrpc.Client +} + +func NewHypervisorClient(client *github_com_containerd_ttrpc.Client) HypervisorService { + return &hypervisorClient{ + client: client, + } +} + +func (c *hypervisorClient) CreateVM(ctx context.Context, req *CreateVMRequest) (*CreateVMResponse, error) { + var resp CreateVMResponse + if err := c.client.Call(ctx, "hypervisor.Hypervisor", "CreateVM", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *hypervisorClient) StartVM(ctx context.Context, req *StartVMRequest) (*StartVMResponse, error) { + var resp StartVMResponse + if err := c.client.Call(ctx, "hypervisor.Hypervisor", "StartVM", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *hypervisorClient) StopVM(ctx context.Context, req *StopVMRequest) (*StopVMResponse, error) { + var resp StopVMResponse + if err := c.client.Call(ctx, "hypervisor.Hypervisor", "StopVM", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *hypervisorClient) Version(ctx context.Context, req *VersionRequest) (*VersionResponse, error) { + var resp VersionResponse + if err := c.client.Call(ctx, "hypervisor.Hypervisor", "Version", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} +func (m *VersionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VersionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VersionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + 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 ErrInvalidLengthHypervisor + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VersionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VersionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VersionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + 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 ErrInvalidLengthHypervisor + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateVMRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateVMRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateVMRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + 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 ErrInvalidLengthHypervisor + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHypervisor + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthHypervisor + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthHypervisor + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthHypervisor + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthHypervisor + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Annotations[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NetworkNamespacePath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + 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 ErrInvalidLengthHypervisor + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NetworkNamespacePath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateVMResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateVMResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateVMResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AgentSocketPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + 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 ErrInvalidLengthHypervisor + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AgentSocketPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StartVMRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StartVMRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartVMRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + 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 ErrInvalidLengthHypervisor + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StartVMResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StartVMResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartVMResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopVMRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StopVMRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopVMRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + 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 ErrInvalidLengthHypervisor + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthHypervisor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopVMResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHypervisor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StopVMResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopVMResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipHypervisor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHypervisor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipHypervisor(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHypervisor + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHypervisor + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowHypervisor + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthHypervisor + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupHypervisor + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthHypervisor + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthHypervisor = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHypervisor = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupHypervisor = fmt.Errorf("proto: unexpected end of group") +) diff --git a/src/runtime/protocols/hypervisor/hypervisor.proto b/src/runtime/protocols/hypervisor/hypervisor.proto new file mode 100644 index 0000000000..11aeb2910f --- /dev/null +++ b/src/runtime/protocols/hypervisor/hypervisor.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package hypervisor; + +service Hypervisor { + rpc CreateVM(CreateVMRequest) returns (CreateVMResponse) {} + rpc StartVM(StartVMRequest) returns (StartVMResponse) {} + rpc StopVM(StopVMRequest) returns (StopVMResponse) {} + rpc Version(VersionRequest) returns (VersionResponse) {} +} + + +message VersionRequest { + string version = 1; +} + +message VersionResponse { + string version = 1; +} + +message CreateVMRequest { + string id = 1; + map annotations = 2; + string networkNamespacePath = 3; +} + +message CreateVMResponse { + string agentSocketPath = 1; +} + +message StartVMRequest { + string id = 1; +} + +message StartVMResponse { +} + +message StopVMRequest { + string id = 1; +} + +message StopVMResponse { +}