diff --git a/Makefile b/Makefile index 9ac489a..88eab9c 100644 --- a/Makefile +++ b/Makefile @@ -122,9 +122,18 @@ generate-wire: $(WIRE) @echo "Generating wire code..." cd ./cmd/api && $(WIRE) +# Install proto generators from go.mod versions (pinned via tools.go) +install-proto-tools: + @echo "Installing proto generators from go.mod versions..." + go install google.golang.org/protobuf/cmd/protoc-gen-go + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc + # Generate gRPC code from proto -generate-grpc: +# Run 'make install-proto-tools' first to install generators from go.mod +generate-grpc: install-proto-tools @echo "Generating gRPC code from proto..." + @echo "Using protoc-gen-go: $$(protoc-gen-go --version)" + @echo "Using protoc-gen-go-grpc: $$(protoc-gen-go-grpc --version)" protoc --go_out=. --go_opt=paths=source_relative \ --go-grpc_out=. --go-grpc_opt=paths=source_relative \ lib/guest/guest.proto diff --git a/cmd/api/api/exec.go b/cmd/api/api/exec.go index 9fdd043..b9f5f3b 100644 --- a/cmd/api/api/exec.go +++ b/cmd/api/api/exec.go @@ -33,8 +33,18 @@ type ExecRequest struct { TTY bool `json:"tty"` Env map[string]string `json:"env,omitempty"` Cwd string `json:"cwd,omitempty"` - Timeout int32 `json:"timeout,omitempty"` // seconds + Timeout int32 `json:"timeout,omitempty"` // seconds WaitForAgent int32 `json:"wait_for_agent,omitempty"` // seconds to wait for guest agent to be ready + Rows uint32 `json:"rows,omitempty"` // Initial terminal rows (0 = default) + Cols uint32 `json:"cols,omitempty"` // Initial terminal cols (0 = default) +} + +// ResizeMessage represents a window resize control message +type ResizeMessage struct { + Resize struct { + Rows uint32 `json:"rows"` + Cols uint32 `json:"cols"` + } `json:"resize"` } // ExecHandler handles exec requests via WebSocket for bidirectional streaming @@ -108,10 +118,19 @@ func (s *ApiService) ExecHandler(w http.ResponseWriter, r *http.Request) { "cwd", execReq.Cwd, "timeout", execReq.Timeout, "wait_for_agent", execReq.WaitForAgent, + "rows", execReq.Rows, + "cols", execReq.Cols, ) - // Create WebSocket read/writer wrapper - wsConn := &wsReadWriter{ws: ws, ctx: ctx} + // Create resize channel for TTY sessions + var resizeChan chan *guest.WindowSize + if execReq.TTY { + resizeChan = make(chan *guest.WindowSize, 10) + defer close(resizeChan) + } + + // Create WebSocket read/writer wrapper that handles resize messages + wsConn := &wsReadWriter{ws: ws, ctx: ctx, resizeChan: resizeChan} // Create vsock dialer for this hypervisor type dialer, err := hypervisor.NewVsockDialer(hypervisor.Type(inst.HypervisorType), inst.VsockSocket, inst.VsockCID) @@ -133,6 +152,9 @@ func (s *ApiService) ExecHandler(w http.ResponseWriter, r *http.Request) { Cwd: execReq.Cwd, Timeout: execReq.Timeout, WaitForAgent: time.Duration(execReq.WaitForAgent) * time.Second, + Rows: execReq.Rows, + Cols: execReq.Cols, + ResizeChan: resizeChan, }) duration := time.Since(startTime) @@ -167,41 +189,61 @@ func (s *ApiService) ExecHandler(w http.ResponseWriter, r *http.Request) { } // wsReadWriter wraps a WebSocket connection to implement io.ReadWriter +// It also handles resize control messages for TTY sessions type wsReadWriter struct { - ws *websocket.Conn - ctx context.Context - reader io.Reader - mu sync.Mutex + ws *websocket.Conn + ctx context.Context + reader io.Reader + mu sync.Mutex + resizeChan chan<- *guest.WindowSize // Channel to send resize events (nil if not TTY) } func (w *wsReadWriter) Read(p []byte) (n int, err error) { w.mu.Lock() defer w.mu.Unlock() - // If we have a pending reader, continue reading from it - if w.reader != nil { - n, err = w.reader.Read(p) - if err != io.EOF { - return n, err + for { + // If we have a pending reader, continue reading from it + if w.reader != nil { + n, err = w.reader.Read(p) + if err != io.EOF { + return n, err + } + // EOF means we finished this message, get next one + w.reader = nil } - // EOF means we finished this message, get next one - w.reader = nil - } - // Read next WebSocket message - messageType, data, err := w.ws.ReadMessage() - if err != nil { - return 0, err - } + // Read next WebSocket message + messageType, data, err := w.ws.ReadMessage() + if err != nil { + return 0, err + } - // Only handle binary and text messages - if messageType != websocket.BinaryMessage && messageType != websocket.TextMessage { - return 0, fmt.Errorf("unexpected message type: %d", messageType) - } + // Handle text messages as potential control messages + if messageType == websocket.TextMessage && w.resizeChan != nil { + // Try to parse as resize message + var resizeMsg ResizeMessage + if err := json.Unmarshal(data, &resizeMsg); err == nil && resizeMsg.Resize.Rows > 0 && resizeMsg.Resize.Cols > 0 { + // Send resize event (non-blocking) + select { + case w.resizeChan <- &guest.WindowSize{Rows: resizeMsg.Resize.Rows, Cols: resizeMsg.Resize.Cols}: + default: + // Channel full, skip + } + continue // Get next message + } + // Not a resize message, treat as stdin + } - // Create reader for this message - w.reader = bytes.NewReader(data) - return w.reader.Read(p) + // Binary messages and non-resize text messages are stdin data + if messageType != websocket.BinaryMessage && messageType != websocket.TextMessage { + return 0, fmt.Errorf("unexpected message type: %d", messageType) + } + + // Create reader for this message + w.reader = bytes.NewReader(data) + return w.reader.Read(p) + } } func (w *wsReadWriter) Write(p []byte) (n int, err error) { diff --git a/cmd/api/api/exec_test.go b/cmd/api/api/exec_test.go index 7809114..be21bc5 100644 --- a/cmd/api/api/exec_test.go +++ b/cmd/api/api/exec_test.go @@ -272,7 +272,6 @@ func TestExecWithDebianMinimal(t *testing.T) { assert.Contains(t, stdout.String(), "Debian", "Should be running Debian") assert.Contains(t, stdout.String(), "bookworm", "Should be Debian 12 (bookworm)") t.Logf("OS: %s", strings.Split(stdout.String(), "\n")[0]) - } // collectTestLogs collects logs from an instance (non-streaming) diff --git a/go.mod b/go.mod index e796654..16a40d3 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,6 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/go-chi/chi/v5 v5.2.3 github.com/golang-jwt/jwt/v5 v5.3.0 - github.com/golang/protobuf v1.5.4 github.com/google/go-containerregistry v0.20.6 github.com/google/uuid v1.6.0 github.com/google/wire v0.7.0 @@ -49,6 +48,8 @@ require ( golang.org/x/sync v0.17.0 golang.org/x/sys v0.38.0 google.golang.org/grpc v1.77.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.0 + google.golang.org/protobuf v1.36.10 gvisor.dev/gvisor v0.0.0-20251125014920-fc40e232ff54 ) @@ -115,7 +116,6 @@ require ( golang.org/x/tools v0.37.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect - google.golang.org/protobuf v1.36.10 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.2 // indirect diff --git a/go.sum b/go.sum index 2844776..6fd5278 100644 --- a/go.sum +++ b/go.sum @@ -347,6 +347,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM= google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.0 h1:6Al3kEFFP9VJhRz3DID6quisgPnTeZVr4lep9kkxdPA= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.0/go.mod h1:QLvsjh0OIR0TYBeiu2bkWGTJBUNQ64st52iWj/yA93I= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= diff --git a/lib/guest/client.go b/lib/guest/client.go index 93b2a16..0afd7f2 100644 --- a/lib/guest/client.go +++ b/lib/guest/client.go @@ -111,6 +111,9 @@ type ExitStatus struct { Code int } +// Note: WindowSize is defined in guest.pb.go (proto-generated) +// Use guest.WindowSize{Rows: N, Cols: M} for resize events + // ExecOptions configures command execution type ExecOptions struct { Command []string @@ -118,10 +121,13 @@ type ExecOptions struct { Stdout io.Writer Stderr io.Writer TTY bool - Env map[string]string // Environment variables - Cwd string // Working directory (optional) - Timeout int32 // Execution timeout in seconds (0 = no timeout) - WaitForAgent time.Duration // Max time to wait for agent to be ready (0 = no wait, fail immediately) + Env map[string]string // Environment variables + Cwd string // Working directory (optional) + Timeout int32 // Execution timeout in seconds (0 = no timeout) + WaitForAgent time.Duration // Max time to wait for agent to be ready (0 = no wait, fail immediately) + Rows uint32 // Initial terminal rows (0 = default 24) + Cols uint32 // Initial terminal cols (0 = default 80) + ResizeChan <-chan *WindowSize // Optional: channel to receive resize events (pointer to avoid copying mutex) } // ExecIntoInstance executes command in instance via vsock using gRPC. @@ -203,7 +209,7 @@ func execIntoInstanceOnce(ctx context.Context, dialer hypervisor.VsockDialer, op // Ensure stream is properly closed when we're done defer stream.CloseSend() - // Send start request + // Send start request with initial window size if err := stream.Send(&ExecRequest{ Request: &ExecRequest_Start{ Start: &ExecStart{ @@ -212,12 +218,17 @@ func execIntoInstanceOnce(ctx context.Context, dialer hypervisor.VsockDialer, op Env: opts.Env, Cwd: opts.Cwd, TimeoutSeconds: opts.Timeout, + Rows: opts.Rows, + Cols: opts.Cols, }, }, }); err != nil { return nil, fmt.Errorf("send start request: %w", err) } + // Mutex to protect concurrent stream.Send/CloseSend calls (gRPC streams are not thread-safe) + var streamMu sync.Mutex + // Handle stdin in background if opts.Stdin != nil { go func() { @@ -225,19 +236,38 @@ func execIntoInstanceOnce(ctx context.Context, dialer hypervisor.VsockDialer, op for { n, err := opts.Stdin.Read(buf) if n > 0 { + streamMu.Lock() stream.Send(&ExecRequest{ Request: &ExecRequest_Stdin{Stdin: buf[:n]}, }) + streamMu.Unlock() atomic.AddInt64(&bytesSent, int64(n)) } if err != nil { + streamMu.Lock() stream.CloseSend() + streamMu.Unlock() return } } }() } + // Handle resize events in background (if channel provided) + if opts.ResizeChan != nil { + go func() { + for resize := range opts.ResizeChan { + streamMu.Lock() + stream.Send(&ExecRequest{ + Request: &ExecRequest_Resize{ + Resize: resize, + }, + }) + streamMu.Unlock() + } + }() + } + // Receive responses var totalStdout, totalStderr int for { diff --git a/lib/guest/guest.pb.go b/lib/guest/guest.pb.go index 8054907..baf6037 100644 --- a/lib/guest/guest.pb.go +++ b/lib/guest/guest.pb.go @@ -1,231 +1,362 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v3.21.12 // source: lib/guest/guest.proto package guest import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" ) -// 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.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // ExecRequest represents messages from client to server type ExecRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Request: // // *ExecRequest_Start // *ExecRequest_Stdin - Request isExecRequest_Request `protobuf_oneof:"request"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // *ExecRequest_Resize + Request isExecRequest_Request `protobuf_oneof:"request"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ExecRequest) Reset() { *m = ExecRequest{} } -func (m *ExecRequest) String() string { return proto.CompactTextString(m) } -func (*ExecRequest) ProtoMessage() {} -func (*ExecRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{0} +func (x *ExecRequest) Reset() { + *x = ExecRequest{} + mi := &file_lib_guest_guest_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ExecRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExecRequest.Unmarshal(m, b) +func (x *ExecRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExecRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExecRequest.Marshal(b, m, deterministic) + +func (*ExecRequest) ProtoMessage() {} + +func (x *ExecRequest) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *ExecRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExecRequest.Merge(m, src) + +// Deprecated: Use ExecRequest.ProtoReflect.Descriptor instead. +func (*ExecRequest) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{0} } -func (m *ExecRequest) XXX_Size() int { - return xxx_messageInfo_ExecRequest.Size(m) + +func (x *ExecRequest) GetRequest() isExecRequest_Request { + if x != nil { + return x.Request + } + return nil } -func (m *ExecRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ExecRequest.DiscardUnknown(m) + +func (x *ExecRequest) GetStart() *ExecStart { + if x != nil { + if x, ok := x.Request.(*ExecRequest_Start); ok { + return x.Start + } + } + return nil } -var xxx_messageInfo_ExecRequest proto.InternalMessageInfo +func (x *ExecRequest) GetStdin() []byte { + if x != nil { + if x, ok := x.Request.(*ExecRequest_Stdin); ok { + return x.Stdin + } + } + return nil +} + +func (x *ExecRequest) GetResize() *WindowSize { + if x != nil { + if x, ok := x.Request.(*ExecRequest_Resize); ok { + return x.Resize + } + } + return nil +} type isExecRequest_Request interface { isExecRequest_Request() } type ExecRequest_Start struct { - Start *ExecStart `protobuf:"bytes,1,opt,name=start,proto3,oneof"` + Start *ExecStart `protobuf:"bytes,1,opt,name=start,proto3,oneof"` // Initial exec request } type ExecRequest_Stdin struct { - Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3,oneof"` + Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3,oneof"` // Stdin data +} + +type ExecRequest_Resize struct { + Resize *WindowSize `protobuf:"bytes,3,opt,name=resize,proto3,oneof"` // Window resize event } func (*ExecRequest_Start) isExecRequest_Request() {} func (*ExecRequest_Stdin) isExecRequest_Request() {} -func (m *ExecRequest) GetRequest() isExecRequest_Request { - if m != nil { - return m.Request +func (*ExecRequest_Resize) isExecRequest_Request() {} + +// ExecStart initiates command execution +type ExecStart struct { + state protoimpl.MessageState `protogen:"open.v1"` + Command []string `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"` // Command and arguments + Tty bool `protobuf:"varint,2,opt,name=tty,proto3" json:"tty,omitempty"` // Allocate pseudo-TTY + Env map[string]string `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Environment variables + Cwd string `protobuf:"bytes,4,opt,name=cwd,proto3" json:"cwd,omitempty"` // Working directory (optional) + TimeoutSeconds int32 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` // Execution timeout in seconds (0 = no timeout) + Rows uint32 `protobuf:"varint,6,opt,name=rows,proto3" json:"rows,omitempty"` // Initial terminal rows (0 = default 24) + Cols uint32 `protobuf:"varint,7,opt,name=cols,proto3" json:"cols,omitempty"` // Initial terminal cols (0 = default 80) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExecStart) Reset() { + *x = ExecStart{} + mi := &file_lib_guest_guest_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecStart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecStart) ProtoMessage() {} + +func (x *ExecStart) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (m *ExecRequest) GetStart() *ExecStart { - if x, ok := m.GetRequest().(*ExecRequest_Start); ok { - return x.Start - } - return nil +// Deprecated: Use ExecStart.ProtoReflect.Descriptor instead. +func (*ExecStart) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{1} } -func (m *ExecRequest) GetStdin() []byte { - if x, ok := m.GetRequest().(*ExecRequest_Stdin); ok { - return x.Stdin +func (x *ExecStart) GetCommand() []string { + if x != nil { + return x.Command } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ExecRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ExecRequest_Start)(nil), - (*ExecRequest_Stdin)(nil), +func (x *ExecStart) GetTty() bool { + if x != nil { + return x.Tty } + return false } -// ExecStart initiates command execution -type ExecStart struct { - Command []string `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"` - Tty bool `protobuf:"varint,2,opt,name=tty,proto3" json:"tty,omitempty"` - Env map[string]string `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Cwd string `protobuf:"bytes,4,opt,name=cwd,proto3" json:"cwd,omitempty"` - TimeoutSeconds int32 `protobuf:"varint,5,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ExecStart) Reset() { *m = ExecStart{} } -func (m *ExecStart) String() string { return proto.CompactTextString(m) } -func (*ExecStart) ProtoMessage() {} -func (*ExecStart) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{1} +func (x *ExecStart) GetEnv() map[string]string { + if x != nil { + return x.Env + } + return nil } -func (m *ExecStart) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExecStart.Unmarshal(m, b) +func (x *ExecStart) GetCwd() string { + if x != nil { + return x.Cwd + } + return "" } -func (m *ExecStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExecStart.Marshal(b, m, deterministic) + +func (x *ExecStart) GetTimeoutSeconds() int32 { + if x != nil { + return x.TimeoutSeconds + } + return 0 } -func (m *ExecStart) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExecStart.Merge(m, src) + +func (x *ExecStart) GetRows() uint32 { + if x != nil { + return x.Rows + } + return 0 } -func (m *ExecStart) XXX_Size() int { - return xxx_messageInfo_ExecStart.Size(m) + +func (x *ExecStart) GetCols() uint32 { + if x != nil { + return x.Cols + } + return 0 } -func (m *ExecStart) XXX_DiscardUnknown() { - xxx_messageInfo_ExecStart.DiscardUnknown(m) + +// WindowSize represents terminal window dimensions for resize events +type WindowSize struct { + state protoimpl.MessageState `protogen:"open.v1"` + Rows uint32 `protobuf:"varint,1,opt,name=rows,proto3" json:"rows,omitempty"` + Cols uint32 `protobuf:"varint,2,opt,name=cols,proto3" json:"cols,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -var xxx_messageInfo_ExecStart proto.InternalMessageInfo +func (x *WindowSize) Reset() { + *x = WindowSize{} + mi := &file_lib_guest_guest_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} -func (m *ExecStart) GetCommand() []string { - if m != nil { - return m.Command - } - return nil +func (x *WindowSize) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExecStart) GetTty() bool { - if m != nil { - return m.Tty +func (*WindowSize) ProtoMessage() {} + +func (x *WindowSize) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return false + return mi.MessageOf(x) } -func (m *ExecStart) GetEnv() map[string]string { - if m != nil { - return m.Env - } - return nil +// Deprecated: Use WindowSize.ProtoReflect.Descriptor instead. +func (*WindowSize) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{2} } -func (m *ExecStart) GetCwd() string { - if m != nil { - return m.Cwd +func (x *WindowSize) GetRows() uint32 { + if x != nil { + return x.Rows } - return "" + return 0 } -func (m *ExecStart) GetTimeoutSeconds() int32 { - if m != nil { - return m.TimeoutSeconds +func (x *WindowSize) GetCols() uint32 { + if x != nil { + return x.Cols } return 0 } // ExecResponse represents messages from server to client type ExecResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Response: // // *ExecResponse_Stdout // *ExecResponse_Stderr // *ExecResponse_ExitCode - Response isExecResponse_Response `protobuf_oneof:"response"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Response isExecResponse_Response `protobuf_oneof:"response"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *ExecResponse) Reset() { *m = ExecResponse{} } -func (m *ExecResponse) String() string { return proto.CompactTextString(m) } -func (*ExecResponse) ProtoMessage() {} -func (*ExecResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{2} +func (x *ExecResponse) Reset() { + *x = ExecResponse{} + mi := &file_lib_guest_guest_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *ExecResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExecResponse.Unmarshal(m, b) +func (x *ExecResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecResponse) ProtoMessage() {} + +func (x *ExecResponse) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *ExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExecResponse.Marshal(b, m, deterministic) + +// Deprecated: Use ExecResponse.ProtoReflect.Descriptor instead. +func (*ExecResponse) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{3} } -func (m *ExecResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExecResponse.Merge(m, src) + +func (x *ExecResponse) GetResponse() isExecResponse_Response { + if x != nil { + return x.Response + } + return nil } -func (m *ExecResponse) XXX_Size() int { - return xxx_messageInfo_ExecResponse.Size(m) + +func (x *ExecResponse) GetStdout() []byte { + if x != nil { + if x, ok := x.Response.(*ExecResponse_Stdout); ok { + return x.Stdout + } + } + return nil } -func (m *ExecResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ExecResponse.DiscardUnknown(m) + +func (x *ExecResponse) GetStderr() []byte { + if x != nil { + if x, ok := x.Response.(*ExecResponse_Stderr); ok { + return x.Stderr + } + } + return nil } -var xxx_messageInfo_ExecResponse proto.InternalMessageInfo +func (x *ExecResponse) GetExitCode() int32 { + if x != nil { + if x, ok := x.Response.(*ExecResponse_ExitCode); ok { + return x.ExitCode + } + } + return 0 +} type isExecResponse_Response interface { isExecResponse_Response() } type ExecResponse_Stdout struct { - Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3,oneof"` + Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3,oneof"` // Stdout data } type ExecResponse_Stderr struct { - Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3,oneof"` + Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3,oneof"` // Stderr data } type ExecResponse_ExitCode struct { - ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3,oneof"` + ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3,oneof"` // Command exit code (final message) } func (*ExecResponse_Stdout) isExecResponse_Response() {} @@ -234,891 +365,1017 @@ func (*ExecResponse_Stderr) isExecResponse_Response() {} func (*ExecResponse_ExitCode) isExecResponse_Response() {} -func (m *ExecResponse) GetResponse() isExecResponse_Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *ExecResponse) GetStdout() []byte { - if x, ok := m.GetResponse().(*ExecResponse_Stdout); ok { - return x.Stdout - } - return nil -} - -func (m *ExecResponse) GetStderr() []byte { - if x, ok := m.GetResponse().(*ExecResponse_Stderr); ok { - return x.Stderr - } - return nil -} - -func (m *ExecResponse) GetExitCode() int32 { - if x, ok := m.GetResponse().(*ExecResponse_ExitCode); ok { - return x.ExitCode - } - return 0 -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ExecResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ExecResponse_Stdout)(nil), - (*ExecResponse_Stderr)(nil), - (*ExecResponse_ExitCode)(nil), - } -} - // CopyToGuestRequest represents messages for copying files to guest type CopyToGuestRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Request: // // *CopyToGuestRequest_Start // *CopyToGuestRequest_Data // *CopyToGuestRequest_End - Request isCopyToGuestRequest_Request `protobuf_oneof:"request"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Request isCopyToGuestRequest_Request `protobuf_oneof:"request"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CopyToGuestRequest) Reset() { *m = CopyToGuestRequest{} } -func (m *CopyToGuestRequest) String() string { return proto.CompactTextString(m) } -func (*CopyToGuestRequest) ProtoMessage() {} -func (*CopyToGuestRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{3} +func (x *CopyToGuestRequest) Reset() { + *x = CopyToGuestRequest{} + mi := &file_lib_guest_guest_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CopyToGuestRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyToGuestRequest.Unmarshal(m, b) -} -func (m *CopyToGuestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyToGuestRequest.Marshal(b, m, deterministic) -} -func (m *CopyToGuestRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyToGuestRequest.Merge(m, src) -} -func (m *CopyToGuestRequest) XXX_Size() int { - return xxx_messageInfo_CopyToGuestRequest.Size(m) -} -func (m *CopyToGuestRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CopyToGuestRequest.DiscardUnknown(m) +func (x *CopyToGuestRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_CopyToGuestRequest proto.InternalMessageInfo +func (*CopyToGuestRequest) ProtoMessage() {} -type isCopyToGuestRequest_Request interface { - isCopyToGuestRequest_Request() -} - -type CopyToGuestRequest_Start struct { - Start *CopyToGuestStart `protobuf:"bytes,1,opt,name=start,proto3,oneof"` -} - -type CopyToGuestRequest_Data struct { - Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"` +func (x *CopyToGuestRequest) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type CopyToGuestRequest_End struct { - End *CopyToGuestEnd `protobuf:"bytes,3,opt,name=end,proto3,oneof"` +// Deprecated: Use CopyToGuestRequest.ProtoReflect.Descriptor instead. +func (*CopyToGuestRequest) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{4} } -func (*CopyToGuestRequest_Start) isCopyToGuestRequest_Request() {} - -func (*CopyToGuestRequest_Data) isCopyToGuestRequest_Request() {} - -func (*CopyToGuestRequest_End) isCopyToGuestRequest_Request() {} - -func (m *CopyToGuestRequest) GetRequest() isCopyToGuestRequest_Request { - if m != nil { - return m.Request +func (x *CopyToGuestRequest) GetRequest() isCopyToGuestRequest_Request { + if x != nil { + return x.Request } return nil } -func (m *CopyToGuestRequest) GetStart() *CopyToGuestStart { - if x, ok := m.GetRequest().(*CopyToGuestRequest_Start); ok { - return x.Start +func (x *CopyToGuestRequest) GetStart() *CopyToGuestStart { + if x != nil { + if x, ok := x.Request.(*CopyToGuestRequest_Start); ok { + return x.Start + } } return nil } -func (m *CopyToGuestRequest) GetData() []byte { - if x, ok := m.GetRequest().(*CopyToGuestRequest_Data); ok { - return x.Data +func (x *CopyToGuestRequest) GetData() []byte { + if x != nil { + if x, ok := x.Request.(*CopyToGuestRequest_Data); ok { + return x.Data + } } return nil } -func (m *CopyToGuestRequest) GetEnd() *CopyToGuestEnd { - if x, ok := m.GetRequest().(*CopyToGuestRequest_End); ok { - return x.End +func (x *CopyToGuestRequest) GetEnd() *CopyToGuestEnd { + if x != nil { + if x, ok := x.Request.(*CopyToGuestRequest_End); ok { + return x.End + } } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*CopyToGuestRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*CopyToGuestRequest_Start)(nil), - (*CopyToGuestRequest_Data)(nil), - (*CopyToGuestRequest_End)(nil), - } +type isCopyToGuestRequest_Request interface { + isCopyToGuestRequest_Request() } -// CopyToGuestStart initiates a copy-to-guest operation -type CopyToGuestStart struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Mode uint32 `protobuf:"varint,2,opt,name=mode,proto3" json:"mode,omitempty"` - IsDir bool `protobuf:"varint,3,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` - Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` - Mtime int64 `protobuf:"varint,5,opt,name=mtime,proto3" json:"mtime,omitempty"` - Uid uint32 `protobuf:"varint,6,opt,name=uid,proto3" json:"uid,omitempty"` - Gid uint32 `protobuf:"varint,7,opt,name=gid,proto3" json:"gid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CopyToGuestStart) Reset() { *m = CopyToGuestStart{} } -func (m *CopyToGuestStart) String() string { return proto.CompactTextString(m) } -func (*CopyToGuestStart) ProtoMessage() {} -func (*CopyToGuestStart) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{4} +type CopyToGuestRequest_Start struct { + Start *CopyToGuestStart `protobuf:"bytes,1,opt,name=start,proto3,oneof"` // Initial copy request with metadata } -func (m *CopyToGuestStart) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyToGuestStart.Unmarshal(m, b) -} -func (m *CopyToGuestStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyToGuestStart.Marshal(b, m, deterministic) -} -func (m *CopyToGuestStart) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyToGuestStart.Merge(m, src) +type CopyToGuestRequest_Data struct { + Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"` // File content chunk } -func (m *CopyToGuestStart) XXX_Size() int { - return xxx_messageInfo_CopyToGuestStart.Size(m) + +type CopyToGuestRequest_End struct { + End *CopyToGuestEnd `protobuf:"bytes,3,opt,name=end,proto3,oneof"` // End of file marker } -func (m *CopyToGuestStart) XXX_DiscardUnknown() { - xxx_messageInfo_CopyToGuestStart.DiscardUnknown(m) + +func (*CopyToGuestRequest_Start) isCopyToGuestRequest_Request() {} + +func (*CopyToGuestRequest_Data) isCopyToGuestRequest_Request() {} + +func (*CopyToGuestRequest_End) isCopyToGuestRequest_Request() {} + +// CopyToGuestStart initiates a copy-to-guest operation +type CopyToGuestStart struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // Destination path in guest + Mode uint32 `protobuf:"varint,2,opt,name=mode,proto3" json:"mode,omitempty"` // File mode (permissions) + IsDir bool `protobuf:"varint,3,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` // True if this is a directory + Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // Expected total size (0 for directories) + Mtime int64 `protobuf:"varint,5,opt,name=mtime,proto3" json:"mtime,omitempty"` // Modification time (Unix timestamp) + Uid uint32 `protobuf:"varint,6,opt,name=uid,proto3" json:"uid,omitempty"` // User ID (archive mode only, 0 = use default) + Gid uint32 `protobuf:"varint,7,opt,name=gid,proto3" json:"gid,omitempty"` // Group ID (archive mode only, 0 = use default) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CopyToGuestStart) Reset() { + *x = CopyToGuestStart{} + mi := &file_lib_guest_guest_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CopyToGuestStart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CopyToGuestStart) ProtoMessage() {} + +func (x *CopyToGuestStart) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CopyToGuestStart proto.InternalMessageInfo +// Deprecated: Use CopyToGuestStart.ProtoReflect.Descriptor instead. +func (*CopyToGuestStart) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{5} +} -func (m *CopyToGuestStart) GetPath() string { - if m != nil { - return m.Path +func (x *CopyToGuestStart) GetPath() string { + if x != nil { + return x.Path } return "" } -func (m *CopyToGuestStart) GetMode() uint32 { - if m != nil { - return m.Mode +func (x *CopyToGuestStart) GetMode() uint32 { + if x != nil { + return x.Mode } return 0 } -func (m *CopyToGuestStart) GetIsDir() bool { - if m != nil { - return m.IsDir +func (x *CopyToGuestStart) GetIsDir() bool { + if x != nil { + return x.IsDir } return false } -func (m *CopyToGuestStart) GetSize() int64 { - if m != nil { - return m.Size +func (x *CopyToGuestStart) GetSize() int64 { + if x != nil { + return x.Size } return 0 } -func (m *CopyToGuestStart) GetMtime() int64 { - if m != nil { - return m.Mtime +func (x *CopyToGuestStart) GetMtime() int64 { + if x != nil { + return x.Mtime } return 0 } -func (m *CopyToGuestStart) GetUid() uint32 { - if m != nil { - return m.Uid +func (x *CopyToGuestStart) GetUid() uint32 { + if x != nil { + return x.Uid } return 0 } -func (m *CopyToGuestStart) GetGid() uint32 { - if m != nil { - return m.Gid +func (x *CopyToGuestStart) GetGid() uint32 { + if x != nil { + return x.Gid } return 0 } // CopyToGuestEnd signals the end of a file transfer type CopyToGuestEnd struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CopyToGuestEnd) Reset() { *m = CopyToGuestEnd{} } -func (m *CopyToGuestEnd) String() string { return proto.CompactTextString(m) } -func (*CopyToGuestEnd) ProtoMessage() {} -func (*CopyToGuestEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{5} +func (x *CopyToGuestEnd) Reset() { + *x = CopyToGuestEnd{} + mi := &file_lib_guest_guest_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CopyToGuestEnd) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyToGuestEnd.Unmarshal(m, b) -} -func (m *CopyToGuestEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyToGuestEnd.Marshal(b, m, deterministic) +func (x *CopyToGuestEnd) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CopyToGuestEnd) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyToGuestEnd.Merge(m, src) -} -func (m *CopyToGuestEnd) XXX_Size() int { - return xxx_messageInfo_CopyToGuestEnd.Size(m) -} -func (m *CopyToGuestEnd) XXX_DiscardUnknown() { - xxx_messageInfo_CopyToGuestEnd.DiscardUnknown(m) + +func (*CopyToGuestEnd) ProtoMessage() {} + +func (x *CopyToGuestEnd) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CopyToGuestEnd proto.InternalMessageInfo +// Deprecated: Use CopyToGuestEnd.ProtoReflect.Descriptor instead. +func (*CopyToGuestEnd) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{6} +} // CopyToGuestResponse is the response after a copy-to-guest operation type CopyToGuestResponse struct { - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - BytesWritten int64 `protobuf:"varint,3,opt,name=bytes_written,json=bytesWritten,proto3" json:"bytes_written,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Whether the copy succeeded + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // Error message if failed + BytesWritten int64 `protobuf:"varint,3,opt,name=bytes_written,json=bytesWritten,proto3" json:"bytes_written,omitempty"` // Total bytes written + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CopyToGuestResponse) Reset() { *m = CopyToGuestResponse{} } -func (m *CopyToGuestResponse) String() string { return proto.CompactTextString(m) } -func (*CopyToGuestResponse) ProtoMessage() {} -func (*CopyToGuestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{6} +func (x *CopyToGuestResponse) Reset() { + *x = CopyToGuestResponse{} + mi := &file_lib_guest_guest_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CopyToGuestResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyToGuestResponse.Unmarshal(m, b) -} -func (m *CopyToGuestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyToGuestResponse.Marshal(b, m, deterministic) -} -func (m *CopyToGuestResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyToGuestResponse.Merge(m, src) +func (x *CopyToGuestResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CopyToGuestResponse) XXX_Size() int { - return xxx_messageInfo_CopyToGuestResponse.Size(m) -} -func (m *CopyToGuestResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CopyToGuestResponse.DiscardUnknown(m) + +func (*CopyToGuestResponse) ProtoMessage() {} + +func (x *CopyToGuestResponse) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CopyToGuestResponse proto.InternalMessageInfo +// Deprecated: Use CopyToGuestResponse.ProtoReflect.Descriptor instead. +func (*CopyToGuestResponse) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{7} +} -func (m *CopyToGuestResponse) GetSuccess() bool { - if m != nil { - return m.Success +func (x *CopyToGuestResponse) GetSuccess() bool { + if x != nil { + return x.Success } return false } -func (m *CopyToGuestResponse) GetError() string { - if m != nil { - return m.Error +func (x *CopyToGuestResponse) GetError() string { + if x != nil { + return x.Error } return "" } -func (m *CopyToGuestResponse) GetBytesWritten() int64 { - if m != nil { - return m.BytesWritten +func (x *CopyToGuestResponse) GetBytesWritten() int64 { + if x != nil { + return x.BytesWritten } return 0 } // CopyFromGuestRequest initiates a copy-from-guest operation type CopyFromGuestRequest struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - FollowLinks bool `protobuf:"varint,2,opt,name=follow_links,json=followLinks,proto3" json:"follow_links,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // Source path in guest + FollowLinks bool `protobuf:"varint,2,opt,name=follow_links,json=followLinks,proto3" json:"follow_links,omitempty"` // Follow symbolic links (like -L flag) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CopyFromGuestRequest) Reset() { *m = CopyFromGuestRequest{} } -func (m *CopyFromGuestRequest) String() string { return proto.CompactTextString(m) } -func (*CopyFromGuestRequest) ProtoMessage() {} -func (*CopyFromGuestRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{7} +func (x *CopyFromGuestRequest) Reset() { + *x = CopyFromGuestRequest{} + mi := &file_lib_guest_guest_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CopyFromGuestRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyFromGuestRequest.Unmarshal(m, b) -} -func (m *CopyFromGuestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyFromGuestRequest.Marshal(b, m, deterministic) +func (x *CopyFromGuestRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CopyFromGuestRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyFromGuestRequest.Merge(m, src) -} -func (m *CopyFromGuestRequest) XXX_Size() int { - return xxx_messageInfo_CopyFromGuestRequest.Size(m) -} -func (m *CopyFromGuestRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CopyFromGuestRequest.DiscardUnknown(m) + +func (*CopyFromGuestRequest) ProtoMessage() {} + +func (x *CopyFromGuestRequest) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CopyFromGuestRequest proto.InternalMessageInfo +// Deprecated: Use CopyFromGuestRequest.ProtoReflect.Descriptor instead. +func (*CopyFromGuestRequest) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{8} +} -func (m *CopyFromGuestRequest) GetPath() string { - if m != nil { - return m.Path +func (x *CopyFromGuestRequest) GetPath() string { + if x != nil { + return x.Path } return "" } -func (m *CopyFromGuestRequest) GetFollowLinks() bool { - if m != nil { - return m.FollowLinks +func (x *CopyFromGuestRequest) GetFollowLinks() bool { + if x != nil { + return x.FollowLinks } return false } // CopyFromGuestResponse streams file data from guest type CopyFromGuestResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Response: // // *CopyFromGuestResponse_Header // *CopyFromGuestResponse_Data // *CopyFromGuestResponse_End // *CopyFromGuestResponse_Error - Response isCopyFromGuestResponse_Response `protobuf_oneof:"response"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Response isCopyFromGuestResponse_Response `protobuf_oneof:"response"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CopyFromGuestResponse) Reset() { *m = CopyFromGuestResponse{} } -func (m *CopyFromGuestResponse) String() string { return proto.CompactTextString(m) } -func (*CopyFromGuestResponse) ProtoMessage() {} -func (*CopyFromGuestResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{8} +func (x *CopyFromGuestResponse) Reset() { + *x = CopyFromGuestResponse{} + mi := &file_lib_guest_guest_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CopyFromGuestResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyFromGuestResponse.Unmarshal(m, b) -} -func (m *CopyFromGuestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyFromGuestResponse.Marshal(b, m, deterministic) -} -func (m *CopyFromGuestResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyFromGuestResponse.Merge(m, src) -} -func (m *CopyFromGuestResponse) XXX_Size() int { - return xxx_messageInfo_CopyFromGuestResponse.Size(m) -} -func (m *CopyFromGuestResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CopyFromGuestResponse.DiscardUnknown(m) +func (x *CopyFromGuestResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_CopyFromGuestResponse proto.InternalMessageInfo +func (*CopyFromGuestResponse) ProtoMessage() {} -type isCopyFromGuestResponse_Response interface { - isCopyFromGuestResponse_Response() -} - -type CopyFromGuestResponse_Header struct { - Header *CopyFromGuestHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"` -} - -type CopyFromGuestResponse_Data struct { - Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"` -} - -type CopyFromGuestResponse_End struct { - End *CopyFromGuestEnd `protobuf:"bytes,3,opt,name=end,proto3,oneof"` +func (x *CopyFromGuestResponse) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -type CopyFromGuestResponse_Error struct { - Error *CopyFromGuestError `protobuf:"bytes,4,opt,name=error,proto3,oneof"` +// Deprecated: Use CopyFromGuestResponse.ProtoReflect.Descriptor instead. +func (*CopyFromGuestResponse) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{9} } -func (*CopyFromGuestResponse_Header) isCopyFromGuestResponse_Response() {} - -func (*CopyFromGuestResponse_Data) isCopyFromGuestResponse_Response() {} - -func (*CopyFromGuestResponse_End) isCopyFromGuestResponse_Response() {} - -func (*CopyFromGuestResponse_Error) isCopyFromGuestResponse_Response() {} - -func (m *CopyFromGuestResponse) GetResponse() isCopyFromGuestResponse_Response { - if m != nil { - return m.Response +func (x *CopyFromGuestResponse) GetResponse() isCopyFromGuestResponse_Response { + if x != nil { + return x.Response } return nil } -func (m *CopyFromGuestResponse) GetHeader() *CopyFromGuestHeader { - if x, ok := m.GetResponse().(*CopyFromGuestResponse_Header); ok { - return x.Header +func (x *CopyFromGuestResponse) GetHeader() *CopyFromGuestHeader { + if x != nil { + if x, ok := x.Response.(*CopyFromGuestResponse_Header); ok { + return x.Header + } } return nil } -func (m *CopyFromGuestResponse) GetData() []byte { - if x, ok := m.GetResponse().(*CopyFromGuestResponse_Data); ok { - return x.Data +func (x *CopyFromGuestResponse) GetData() []byte { + if x != nil { + if x, ok := x.Response.(*CopyFromGuestResponse_Data); ok { + return x.Data + } } return nil } -func (m *CopyFromGuestResponse) GetEnd() *CopyFromGuestEnd { - if x, ok := m.GetResponse().(*CopyFromGuestResponse_End); ok { - return x.End +func (x *CopyFromGuestResponse) GetEnd() *CopyFromGuestEnd { + if x != nil { + if x, ok := x.Response.(*CopyFromGuestResponse_End); ok { + return x.End + } } return nil } -func (m *CopyFromGuestResponse) GetError() *CopyFromGuestError { - if x, ok := m.GetResponse().(*CopyFromGuestResponse_Error); ok { - return x.Error +func (x *CopyFromGuestResponse) GetError() *CopyFromGuestError { + if x != nil { + if x, ok := x.Response.(*CopyFromGuestResponse_Error); ok { + return x.Error + } } return nil } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*CopyFromGuestResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*CopyFromGuestResponse_Header)(nil), - (*CopyFromGuestResponse_Data)(nil), - (*CopyFromGuestResponse_End)(nil), - (*CopyFromGuestResponse_Error)(nil), - } +type isCopyFromGuestResponse_Response interface { + isCopyFromGuestResponse_Response() } -// CopyFromGuestHeader provides metadata about a file being copied -type CopyFromGuestHeader struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Mode uint32 `protobuf:"varint,2,opt,name=mode,proto3" json:"mode,omitempty"` - IsDir bool `protobuf:"varint,3,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` - IsSymlink bool `protobuf:"varint,4,opt,name=is_symlink,json=isSymlink,proto3" json:"is_symlink,omitempty"` - LinkTarget string `protobuf:"bytes,5,opt,name=link_target,json=linkTarget,proto3" json:"link_target,omitempty"` - Size int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` - Mtime int64 `protobuf:"varint,7,opt,name=mtime,proto3" json:"mtime,omitempty"` - Uid uint32 `protobuf:"varint,8,opt,name=uid,proto3" json:"uid,omitempty"` - Gid uint32 `protobuf:"varint,9,opt,name=gid,proto3" json:"gid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CopyFromGuestHeader) Reset() { *m = CopyFromGuestHeader{} } -func (m *CopyFromGuestHeader) String() string { return proto.CompactTextString(m) } -func (*CopyFromGuestHeader) ProtoMessage() {} -func (*CopyFromGuestHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{9} +type CopyFromGuestResponse_Header struct { + Header *CopyFromGuestHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"` // File/directory metadata } -func (m *CopyFromGuestHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyFromGuestHeader.Unmarshal(m, b) -} -func (m *CopyFromGuestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyFromGuestHeader.Marshal(b, m, deterministic) +type CopyFromGuestResponse_Data struct { + Data []byte `protobuf:"bytes,2,opt,name=data,proto3,oneof"` // File content chunk } -func (m *CopyFromGuestHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyFromGuestHeader.Merge(m, src) + +type CopyFromGuestResponse_End struct { + End *CopyFromGuestEnd `protobuf:"bytes,3,opt,name=end,proto3,oneof"` // End of file/transfer marker } -func (m *CopyFromGuestHeader) XXX_Size() int { - return xxx_messageInfo_CopyFromGuestHeader.Size(m) + +type CopyFromGuestResponse_Error struct { + Error *CopyFromGuestError `protobuf:"bytes,4,opt,name=error,proto3,oneof"` // Error during copy } -func (m *CopyFromGuestHeader) XXX_DiscardUnknown() { - xxx_messageInfo_CopyFromGuestHeader.DiscardUnknown(m) + +func (*CopyFromGuestResponse_Header) isCopyFromGuestResponse_Response() {} + +func (*CopyFromGuestResponse_Data) isCopyFromGuestResponse_Response() {} + +func (*CopyFromGuestResponse_End) isCopyFromGuestResponse_Response() {} + +func (*CopyFromGuestResponse_Error) isCopyFromGuestResponse_Response() {} + +// CopyFromGuestHeader provides metadata about a file being copied +type CopyFromGuestHeader struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // Relative path from copy root + Mode uint32 `protobuf:"varint,2,opt,name=mode,proto3" json:"mode,omitempty"` // File mode (permissions) + IsDir bool `protobuf:"varint,3,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` // True if this is a directory + IsSymlink bool `protobuf:"varint,4,opt,name=is_symlink,json=isSymlink,proto3" json:"is_symlink,omitempty"` // True if this is a symbolic link + LinkTarget string `protobuf:"bytes,5,opt,name=link_target,json=linkTarget,proto3" json:"link_target,omitempty"` // Symlink target (if is_symlink) + Size int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` // File size (0 for directories) + Mtime int64 `protobuf:"varint,7,opt,name=mtime,proto3" json:"mtime,omitempty"` // Modification time (Unix timestamp) + Uid uint32 `protobuf:"varint,8,opt,name=uid,proto3" json:"uid,omitempty"` // User ID + Gid uint32 `protobuf:"varint,9,opt,name=gid,proto3" json:"gid,omitempty"` // Group ID + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CopyFromGuestHeader) Reset() { + *x = CopyFromGuestHeader{} + mi := &file_lib_guest_guest_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CopyFromGuestHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CopyFromGuestHeader) ProtoMessage() {} + +func (x *CopyFromGuestHeader) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CopyFromGuestHeader proto.InternalMessageInfo +// Deprecated: Use CopyFromGuestHeader.ProtoReflect.Descriptor instead. +func (*CopyFromGuestHeader) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{10} +} -func (m *CopyFromGuestHeader) GetPath() string { - if m != nil { - return m.Path +func (x *CopyFromGuestHeader) GetPath() string { + if x != nil { + return x.Path } return "" } -func (m *CopyFromGuestHeader) GetMode() uint32 { - if m != nil { - return m.Mode +func (x *CopyFromGuestHeader) GetMode() uint32 { + if x != nil { + return x.Mode } return 0 } -func (m *CopyFromGuestHeader) GetIsDir() bool { - if m != nil { - return m.IsDir +func (x *CopyFromGuestHeader) GetIsDir() bool { + if x != nil { + return x.IsDir } return false } -func (m *CopyFromGuestHeader) GetIsSymlink() bool { - if m != nil { - return m.IsSymlink +func (x *CopyFromGuestHeader) GetIsSymlink() bool { + if x != nil { + return x.IsSymlink } return false } -func (m *CopyFromGuestHeader) GetLinkTarget() string { - if m != nil { - return m.LinkTarget +func (x *CopyFromGuestHeader) GetLinkTarget() string { + if x != nil { + return x.LinkTarget } return "" } -func (m *CopyFromGuestHeader) GetSize() int64 { - if m != nil { - return m.Size +func (x *CopyFromGuestHeader) GetSize() int64 { + if x != nil { + return x.Size } return 0 } -func (m *CopyFromGuestHeader) GetMtime() int64 { - if m != nil { - return m.Mtime +func (x *CopyFromGuestHeader) GetMtime() int64 { + if x != nil { + return x.Mtime } return 0 } -func (m *CopyFromGuestHeader) GetUid() uint32 { - if m != nil { - return m.Uid +func (x *CopyFromGuestHeader) GetUid() uint32 { + if x != nil { + return x.Uid } return 0 } -func (m *CopyFromGuestHeader) GetGid() uint32 { - if m != nil { - return m.Gid +func (x *CopyFromGuestHeader) GetGid() uint32 { + if x != nil { + return x.Gid } return 0 } // CopyFromGuestEnd signals the end of a file or transfer type CopyFromGuestEnd struct { - Final bool `protobuf:"varint,1,opt,name=final,proto3" json:"final,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Final bool `protobuf:"varint,1,opt,name=final,proto3" json:"final,omitempty"` // True if this is the final file + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CopyFromGuestEnd) Reset() { *m = CopyFromGuestEnd{} } -func (m *CopyFromGuestEnd) String() string { return proto.CompactTextString(m) } -func (*CopyFromGuestEnd) ProtoMessage() {} -func (*CopyFromGuestEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{10} +func (x *CopyFromGuestEnd) Reset() { + *x = CopyFromGuestEnd{} + mi := &file_lib_guest_guest_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CopyFromGuestEnd) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyFromGuestEnd.Unmarshal(m, b) +func (x *CopyFromGuestEnd) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CopyFromGuestEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyFromGuestEnd.Marshal(b, m, deterministic) -} -func (m *CopyFromGuestEnd) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyFromGuestEnd.Merge(m, src) -} -func (m *CopyFromGuestEnd) XXX_Size() int { - return xxx_messageInfo_CopyFromGuestEnd.Size(m) -} -func (m *CopyFromGuestEnd) XXX_DiscardUnknown() { - xxx_messageInfo_CopyFromGuestEnd.DiscardUnknown(m) + +func (*CopyFromGuestEnd) ProtoMessage() {} + +func (x *CopyFromGuestEnd) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CopyFromGuestEnd proto.InternalMessageInfo +// Deprecated: Use CopyFromGuestEnd.ProtoReflect.Descriptor instead. +func (*CopyFromGuestEnd) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{11} +} -func (m *CopyFromGuestEnd) GetFinal() bool { - if m != nil { - return m.Final +func (x *CopyFromGuestEnd) GetFinal() bool { + if x != nil { + return x.Final } return false } // CopyFromGuestError reports an error during copy type CopyFromGuestError struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Error message + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // Path that caused error (if applicable) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *CopyFromGuestError) Reset() { *m = CopyFromGuestError{} } -func (m *CopyFromGuestError) String() string { return proto.CompactTextString(m) } -func (*CopyFromGuestError) ProtoMessage() {} -func (*CopyFromGuestError) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{11} +func (x *CopyFromGuestError) Reset() { + *x = CopyFromGuestError{} + mi := &file_lib_guest_guest_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *CopyFromGuestError) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CopyFromGuestError.Unmarshal(m, b) +func (x *CopyFromGuestError) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CopyFromGuestError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CopyFromGuestError.Marshal(b, m, deterministic) -} -func (m *CopyFromGuestError) XXX_Merge(src proto.Message) { - xxx_messageInfo_CopyFromGuestError.Merge(m, src) -} -func (m *CopyFromGuestError) XXX_Size() int { - return xxx_messageInfo_CopyFromGuestError.Size(m) -} -func (m *CopyFromGuestError) XXX_DiscardUnknown() { - xxx_messageInfo_CopyFromGuestError.DiscardUnknown(m) + +func (*CopyFromGuestError) ProtoMessage() {} + +func (x *CopyFromGuestError) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CopyFromGuestError proto.InternalMessageInfo +// Deprecated: Use CopyFromGuestError.ProtoReflect.Descriptor instead. +func (*CopyFromGuestError) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{12} +} -func (m *CopyFromGuestError) GetMessage() string { - if m != nil { - return m.Message +func (x *CopyFromGuestError) GetMessage() string { + if x != nil { + return x.Message } return "" } -func (m *CopyFromGuestError) GetPath() string { - if m != nil { - return m.Path +func (x *CopyFromGuestError) GetPath() string { + if x != nil { + return x.Path } return "" } // StatPathRequest requests information about a path type StatPathRequest struct { - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - FollowLinks bool `protobuf:"varint,2,opt,name=follow_links,json=followLinks,proto3" json:"follow_links,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // Path to stat + FollowLinks bool `protobuf:"varint,2,opt,name=follow_links,json=followLinks,proto3" json:"follow_links,omitempty"` // Follow symbolic links + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (m *StatPathRequest) Reset() { *m = StatPathRequest{} } -func (m *StatPathRequest) String() string { return proto.CompactTextString(m) } -func (*StatPathRequest) ProtoMessage() {} -func (*StatPathRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{12} +func (x *StatPathRequest) Reset() { + *x = StatPathRequest{} + mi := &file_lib_guest_guest_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (m *StatPathRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StatPathRequest.Unmarshal(m, b) +func (x *StatPathRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StatPathRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StatPathRequest.Marshal(b, m, deterministic) -} -func (m *StatPathRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatPathRequest.Merge(m, src) -} -func (m *StatPathRequest) XXX_Size() int { - return xxx_messageInfo_StatPathRequest.Size(m) -} -func (m *StatPathRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StatPathRequest.DiscardUnknown(m) + +func (*StatPathRequest) ProtoMessage() {} + +func (x *StatPathRequest) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_StatPathRequest proto.InternalMessageInfo +// Deprecated: Use StatPathRequest.ProtoReflect.Descriptor instead. +func (*StatPathRequest) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{13} +} -func (m *StatPathRequest) GetPath() string { - if m != nil { - return m.Path +func (x *StatPathRequest) GetPath() string { + if x != nil { + return x.Path } return "" } -func (m *StatPathRequest) GetFollowLinks() bool { - if m != nil { - return m.FollowLinks +func (x *StatPathRequest) GetFollowLinks() bool { + if x != nil { + return x.FollowLinks } return false } // StatPathResponse contains information about a path type StatPathResponse struct { - Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` - IsDir bool `protobuf:"varint,2,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` - IsFile bool `protobuf:"varint,3,opt,name=is_file,json=isFile,proto3" json:"is_file,omitempty"` - IsSymlink bool `protobuf:"varint,4,opt,name=is_symlink,json=isSymlink,proto3" json:"is_symlink,omitempty"` - LinkTarget string `protobuf:"bytes,5,opt,name=link_target,json=linkTarget,proto3" json:"link_target,omitempty"` - Mode uint32 `protobuf:"varint,6,opt,name=mode,proto3" json:"mode,omitempty"` - Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` - Error string `protobuf:"bytes,8,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StatPathResponse) Reset() { *m = StatPathResponse{} } -func (m *StatPathResponse) String() string { return proto.CompactTextString(m) } -func (*StatPathResponse) ProtoMessage() {} -func (*StatPathResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_44c1cba55f3bcb29, []int{13} + state protoimpl.MessageState `protogen:"open.v1"` + Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` // Whether the path exists + IsDir bool `protobuf:"varint,2,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` // True if this is a directory + IsFile bool `protobuf:"varint,3,opt,name=is_file,json=isFile,proto3" json:"is_file,omitempty"` // True if this is a regular file + IsSymlink bool `protobuf:"varint,4,opt,name=is_symlink,json=isSymlink,proto3" json:"is_symlink,omitempty"` // True if this is a symbolic link (only if follow_links=false) + LinkTarget string `protobuf:"bytes,5,opt,name=link_target,json=linkTarget,proto3" json:"link_target,omitempty"` // Symlink target (if is_symlink) + Mode uint32 `protobuf:"varint,6,opt,name=mode,proto3" json:"mode,omitempty"` // File mode (permissions) + Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` // File size + Error string `protobuf:"bytes,8,opt,name=error,proto3" json:"error,omitempty"` // Error message if stat failed (e.g., permission denied) + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatPathResponse) Reset() { + *x = StatPathResponse{} + mi := &file_lib_guest_guest_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatPathResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatPathResponse) ProtoMessage() {} + +func (x *StatPathResponse) ProtoReflect() protoreflect.Message { + mi := &file_lib_guest_guest_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *StatPathResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StatPathResponse.Unmarshal(m, b) -} -func (m *StatPathResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StatPathResponse.Marshal(b, m, deterministic) -} -func (m *StatPathResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatPathResponse.Merge(m, src) -} -func (m *StatPathResponse) XXX_Size() int { - return xxx_messageInfo_StatPathResponse.Size(m) -} -func (m *StatPathResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StatPathResponse.DiscardUnknown(m) +// Deprecated: Use StatPathResponse.ProtoReflect.Descriptor instead. +func (*StatPathResponse) Descriptor() ([]byte, []int) { + return file_lib_guest_guest_proto_rawDescGZIP(), []int{14} } -var xxx_messageInfo_StatPathResponse proto.InternalMessageInfo - -func (m *StatPathResponse) GetExists() bool { - if m != nil { - return m.Exists +func (x *StatPathResponse) GetExists() bool { + if x != nil { + return x.Exists } return false } -func (m *StatPathResponse) GetIsDir() bool { - if m != nil { - return m.IsDir +func (x *StatPathResponse) GetIsDir() bool { + if x != nil { + return x.IsDir } return false } -func (m *StatPathResponse) GetIsFile() bool { - if m != nil { - return m.IsFile +func (x *StatPathResponse) GetIsFile() bool { + if x != nil { + return x.IsFile } return false } -func (m *StatPathResponse) GetIsSymlink() bool { - if m != nil { - return m.IsSymlink +func (x *StatPathResponse) GetIsSymlink() bool { + if x != nil { + return x.IsSymlink } return false } -func (m *StatPathResponse) GetLinkTarget() string { - if m != nil { - return m.LinkTarget +func (x *StatPathResponse) GetLinkTarget() string { + if x != nil { + return x.LinkTarget } return "" } -func (m *StatPathResponse) GetMode() uint32 { - if m != nil { - return m.Mode +func (x *StatPathResponse) GetMode() uint32 { + if x != nil { + return x.Mode } return 0 } -func (m *StatPathResponse) GetSize() int64 { - if m != nil { - return m.Size +func (x *StatPathResponse) GetSize() int64 { + if x != nil { + return x.Size } return 0 } -func (m *StatPathResponse) GetError() string { - if m != nil { - return m.Error +func (x *StatPathResponse) GetError() string { + if x != nil { + return x.Error } return "" } -func init() { - proto.RegisterType((*ExecRequest)(nil), "guest.ExecRequest") - proto.RegisterType((*ExecStart)(nil), "guest.ExecStart") - proto.RegisterMapType((map[string]string)(nil), "guest.ExecStart.EnvEntry") - proto.RegisterType((*ExecResponse)(nil), "guest.ExecResponse") - proto.RegisterType((*CopyToGuestRequest)(nil), "guest.CopyToGuestRequest") - proto.RegisterType((*CopyToGuestStart)(nil), "guest.CopyToGuestStart") - proto.RegisterType((*CopyToGuestEnd)(nil), "guest.CopyToGuestEnd") - proto.RegisterType((*CopyToGuestResponse)(nil), "guest.CopyToGuestResponse") - proto.RegisterType((*CopyFromGuestRequest)(nil), "guest.CopyFromGuestRequest") - proto.RegisterType((*CopyFromGuestResponse)(nil), "guest.CopyFromGuestResponse") - proto.RegisterType((*CopyFromGuestHeader)(nil), "guest.CopyFromGuestHeader") - proto.RegisterType((*CopyFromGuestEnd)(nil), "guest.CopyFromGuestEnd") - proto.RegisterType((*CopyFromGuestError)(nil), "guest.CopyFromGuestError") - proto.RegisterType((*StatPathRequest)(nil), "guest.StatPathRequest") - proto.RegisterType((*StatPathResponse)(nil), "guest.StatPathResponse") -} - -func init() { - proto.RegisterFile("lib/guest/guest.proto", fileDescriptor_44c1cba55f3bcb29) -} - -var fileDescriptor_44c1cba55f3bcb29 = []byte{ - // 897 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x5d, 0x6f, 0xe3, 0x44, - 0x14, 0xad, 0xe3, 0xc4, 0xb1, 0x6f, 0xd2, 0xdd, 0x68, 0xb6, 0x1f, 0x6e, 0x60, 0x45, 0x30, 0x42, - 0x6b, 0xb4, 0x52, 0xb3, 0x74, 0x11, 0x42, 0xf0, 0xd6, 0xa5, 0x25, 0x0f, 0x8b, 0x84, 0xa6, 0x2b, - 0x21, 0xed, 0x4b, 0xe4, 0xda, 0xd3, 0x64, 0xa8, 0x3f, 0xc2, 0xcc, 0xa4, 0x6d, 0xf8, 0x17, 0xbc, - 0xf0, 0xca, 0x4f, 0xe2, 0x11, 0x9e, 0xf9, 0x25, 0xe8, 0xce, 0xd8, 0xa9, 0x9d, 0x86, 0xa7, 0xee, - 0x4b, 0x3b, 0xf7, 0xf8, 0xfa, 0xcc, 0xf5, 0x39, 0x67, 0x1c, 0xc3, 0x7e, 0xca, 0x2f, 0xc7, 0xb3, - 0x25, 0x93, 0xca, 0xfc, 0x3d, 0x5e, 0x88, 0x42, 0x15, 0xa4, 0xa3, 0x8b, 0xe0, 0x3d, 0xf4, 0xce, - 0xee, 0x58, 0x4c, 0xd9, 0xaf, 0x58, 0x92, 0x10, 0x3a, 0x52, 0x45, 0x42, 0xf9, 0xd6, 0xc8, 0x0a, - 0x7b, 0x27, 0x83, 0x63, 0x73, 0x0b, 0xb6, 0x5c, 0x20, 0x3e, 0xd9, 0xa1, 0xa6, 0x81, 0x1c, 0x60, - 0x67, 0xc2, 0x73, 0xbf, 0x35, 0xb2, 0xc2, 0xbe, 0xc1, 0x13, 0x9e, 0x9f, 0x7a, 0xd0, 0x15, 0x86, - 0x2c, 0xf8, 0xdb, 0x02, 0x6f, 0x7d, 0x27, 0xf1, 0xa1, 0x1b, 0x17, 0x59, 0x16, 0xe5, 0x89, 0x6f, - 0x8d, 0xec, 0xd0, 0xa3, 0x55, 0x49, 0x06, 0x60, 0x2b, 0xb5, 0xd2, 0x44, 0x2e, 0xc5, 0x25, 0x79, - 0x09, 0x36, 0xcb, 0x6f, 0x7c, 0x7b, 0x64, 0x87, 0xbd, 0x93, 0xa3, 0xcd, 0x21, 0x8e, 0xcf, 0xf2, - 0x9b, 0xb3, 0x5c, 0x89, 0x15, 0xc5, 0x2e, 0xbc, 0x3d, 0xbe, 0x4d, 0xfc, 0xf6, 0xc8, 0x0a, 0x3d, - 0x8a, 0x4b, 0xf2, 0x02, 0x9e, 0x2a, 0x9e, 0xb1, 0x62, 0xa9, 0xa6, 0x92, 0xc5, 0x45, 0x9e, 0x48, - 0xbf, 0x33, 0xb2, 0xc2, 0x0e, 0x7d, 0x52, 0xc2, 0x17, 0x06, 0x1d, 0x7e, 0x0d, 0x6e, 0xc5, 0x85, - 0x34, 0xd7, 0x6c, 0xa5, 0x1f, 0xdc, 0xa3, 0xb8, 0x24, 0x7b, 0xd0, 0xb9, 0x89, 0xd2, 0x25, 0xd3, - 0x93, 0x79, 0xd4, 0x14, 0xdf, 0xb6, 0xbe, 0xb1, 0x82, 0x0c, 0xfa, 0x46, 0x35, 0xb9, 0x28, 0x72, - 0xc9, 0x88, 0x0f, 0x8e, 0x54, 0x49, 0xb1, 0x34, 0xba, 0xa1, 0x1a, 0x65, 0x5d, 0x5e, 0x61, 0x42, - 0xac, 0x75, 0x2a, 0x6b, 0xf2, 0x1c, 0x3c, 0x76, 0xc7, 0xd5, 0x34, 0x2e, 0x12, 0xe6, 0xdb, 0x38, - 0xde, 0x64, 0x87, 0xba, 0x08, 0xbd, 0x29, 0x12, 0x76, 0x0a, 0xe0, 0x8a, 0x92, 0x3e, 0xf8, 0xdd, - 0x02, 0xf2, 0xa6, 0x58, 0xac, 0xde, 0x15, 0x3f, 0xa0, 0x12, 0x95, 0x59, 0xe3, 0xa6, 0x59, 0x87, - 0xa5, 0x4e, 0xb5, 0xce, 0x0d, 0xcf, 0xf6, 0xa0, 0x9d, 0x44, 0x2a, 0x5a, 0x8f, 0xa2, 0x2b, 0xf2, - 0x05, 0x8a, 0x9d, 0xe8, 0x11, 0x7a, 0x27, 0xfb, 0x0f, 0x49, 0xce, 0xf2, 0x64, 0xb2, 0x83, 0x52, - 0x27, 0x75, 0x73, 0xff, 0xb4, 0x60, 0xb0, 0xb9, 0x13, 0x21, 0xd0, 0x5e, 0x44, 0x6a, 0x5e, 0x8a, - 0xa8, 0xd7, 0x88, 0x65, 0xf8, 0x88, 0xb8, 0xe9, 0x2e, 0xd5, 0x6b, 0xb2, 0x0f, 0x0e, 0x97, 0xd3, - 0x84, 0x0b, 0xbd, 0xab, 0x4b, 0x3b, 0x5c, 0x7e, 0xcf, 0x05, 0xb6, 0x4a, 0xfe, 0x1b, 0xd3, 0x56, - 0xda, 0x54, 0xaf, 0xd1, 0x84, 0x0c, 0x5d, 0xd3, 0x0e, 0xda, 0xd4, 0x14, 0x68, 0xd6, 0x92, 0x27, - 0xbe, 0xa3, 0x39, 0x71, 0x89, 0xc8, 0x8c, 0x27, 0x7e, 0xd7, 0x20, 0x33, 0x9e, 0x04, 0x03, 0x78, - 0xd2, 0x7c, 0x8a, 0xe0, 0x17, 0x78, 0xd6, 0x90, 0x71, 0xed, 0x5e, 0x57, 0x2e, 0xe3, 0x98, 0x49, - 0xa9, 0x07, 0x77, 0x69, 0x55, 0xe2, 0xe6, 0x4c, 0x88, 0x42, 0x54, 0x09, 0xd0, 0x05, 0xf9, 0x0c, - 0x76, 0x2f, 0x57, 0x8a, 0xc9, 0xe9, 0xad, 0xe0, 0x4a, 0xb1, 0x5c, 0x3f, 0x84, 0x4d, 0xfb, 0x1a, - 0xfc, 0xd9, 0x60, 0xc1, 0x8f, 0xb0, 0x87, 0x7b, 0x9d, 0x8b, 0x22, 0x6b, 0x98, 0xb6, 0x4d, 0xa2, - 0x4f, 0xa1, 0x7f, 0x55, 0xa4, 0x69, 0x71, 0x3b, 0x4d, 0x79, 0x7e, 0x2d, 0xcb, 0x93, 0xd0, 0x33, - 0xd8, 0x5b, 0x84, 0x82, 0xbf, 0x2c, 0xd8, 0xdf, 0xe0, 0x2b, 0xa7, 0xff, 0x0a, 0x9c, 0x39, 0x8b, - 0x12, 0x26, 0xca, 0x18, 0x0c, 0x6b, 0x0e, 0xae, 0xbb, 0x27, 0xba, 0x03, 0xd3, 0x67, 0x7a, 0xff, - 0x27, 0x0a, 0x2f, 0xeb, 0x51, 0x38, 0xdc, 0x46, 0x74, 0x1f, 0x06, 0xf2, 0x65, 0x25, 0x4e, 0x5b, - 0xb7, 0x1f, 0x6d, 0x6d, 0xc7, 0x06, 0x0c, 0xa0, 0xee, 0x6c, 0x84, 0xfa, 0x5f, 0xcb, 0xb8, 0xb1, - 0x31, 0xe3, 0x63, 0x33, 0xf4, 0x1c, 0x80, 0xcb, 0xa9, 0x5c, 0x65, 0x28, 0xa5, 0x1e, 0xcd, 0xa5, - 0x1e, 0x97, 0x17, 0x06, 0x20, 0x9f, 0x40, 0x0f, 0xff, 0x4f, 0x55, 0x24, 0x66, 0x4c, 0xe9, 0x50, - 0x79, 0x14, 0x10, 0x7a, 0xa7, 0x91, 0x75, 0x06, 0x9d, 0x6d, 0x19, 0xec, 0x6e, 0xc9, 0xa0, 0xfb, - 0x20, 0x83, 0xde, 0x7d, 0x06, 0x43, 0x73, 0x48, 0xea, 0xf2, 0x21, 0xdb, 0x15, 0xcf, 0xa3, 0xb4, - 0x0c, 0x9b, 0x29, 0x82, 0x53, 0x73, 0xc4, 0x9b, 0xca, 0x61, 0x34, 0x33, 0x26, 0x65, 0x34, 0x63, - 0xa5, 0x1e, 0x55, 0xb9, 0x96, 0xa9, 0x75, 0x2f, 0x53, 0x30, 0x81, 0xa7, 0x17, 0x2a, 0x52, 0x3f, - 0x45, 0x6a, 0xfe, 0xc8, 0xb8, 0xfd, 0x63, 0xc1, 0xe0, 0x9e, 0xaa, 0x4c, 0xda, 0x01, 0x38, 0xec, - 0x8e, 0x4b, 0x55, 0x1d, 0x93, 0xb2, 0xaa, 0x39, 0xd1, 0xaa, 0x3b, 0x71, 0x08, 0x5d, 0x2e, 0xa7, - 0x57, 0x3c, 0x65, 0xa5, 0x43, 0x0e, 0x97, 0xe7, 0x3c, 0x65, 0x1f, 0xc2, 0x22, 0x9d, 0x06, 0xa7, - 0x96, 0x86, 0xca, 0xb6, 0x6e, 0xd3, 0x36, 0x13, 0x50, 0xb7, 0x76, 0x7a, 0x4f, 0xfe, 0x68, 0x41, - 0xdf, 0xbc, 0xb2, 0x98, 0xb8, 0xe1, 0x31, 0x23, 0xaf, 0xa1, 0x8d, 0x2f, 0x73, 0x42, 0x6a, 0xbf, - 0x33, 0xa5, 0x7c, 0xc3, 0x67, 0x0d, 0xcc, 0xe8, 0x10, 0x5a, 0xaf, 0x2c, 0x72, 0x0e, 0xbd, 0xda, - 0xab, 0x84, 0x1c, 0x3d, 0x7c, 0x6d, 0x56, 0x14, 0xc3, 0x6d, 0x97, 0x2a, 0x26, 0xf2, 0x16, 0x76, - 0x1b, 0xb6, 0x93, 0x8f, 0xb6, 0x1d, 0xa3, 0x8a, 0xeb, 0xe3, 0xed, 0x17, 0x0d, 0xdb, 0x2b, 0x8b, - 0x7c, 0x07, 0x6e, 0xe5, 0x1a, 0x39, 0x28, 0x7b, 0x37, 0x12, 0x31, 0x3c, 0x7c, 0x80, 0x9b, 0xdb, - 0x4f, 0x5f, 0xbc, 0xff, 0x7c, 0xc6, 0xd5, 0x7c, 0x79, 0x79, 0x1c, 0x17, 0xd9, 0xb8, 0xc8, 0xaf, - 0x99, 0xc8, 0x59, 0x3a, 0x9e, 0xaf, 0x16, 0x2c, 0x8b, 0xf2, 0xf1, 0xfa, 0x33, 0xe2, 0xd2, 0xd1, - 0x5f, 0x10, 0xaf, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x85, 0xa3, 0x7e, 0x65, 0x5a, 0x08, 0x00, - 0x00, +var File_lib_guest_guest_proto protoreflect.FileDescriptor + +const file_lib_guest_guest_proto_rawDesc = "" + + "\n" + + "\x15lib/guest/guest.proto\x12\x05guest\"\x87\x01\n" + + "\vExecRequest\x12(\n" + + "\x05start\x18\x01 \x01(\v2\x10.guest.ExecStartH\x00R\x05start\x12\x16\n" + + "\x05stdin\x18\x02 \x01(\fH\x00R\x05stdin\x12+\n" + + "\x06resize\x18\x03 \x01(\v2\x11.guest.WindowSizeH\x00R\x06resizeB\t\n" + + "\arequest\"\xff\x01\n" + + "\tExecStart\x12\x18\n" + + "\acommand\x18\x01 \x03(\tR\acommand\x12\x10\n" + + "\x03tty\x18\x02 \x01(\bR\x03tty\x12+\n" + + "\x03env\x18\x03 \x03(\v2\x19.guest.ExecStart.EnvEntryR\x03env\x12\x10\n" + + "\x03cwd\x18\x04 \x01(\tR\x03cwd\x12'\n" + + "\x0ftimeout_seconds\x18\x05 \x01(\x05R\x0etimeoutSeconds\x12\x12\n" + + "\x04rows\x18\x06 \x01(\rR\x04rows\x12\x12\n" + + "\x04cols\x18\a \x01(\rR\x04cols\x1a6\n" + + "\bEnvEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"4\n" + + "\n" + + "WindowSize\x12\x12\n" + + "\x04rows\x18\x01 \x01(\rR\x04rows\x12\x12\n" + + "\x04cols\x18\x02 \x01(\rR\x04cols\"m\n" + + "\fExecResponse\x12\x18\n" + + "\x06stdout\x18\x01 \x01(\fH\x00R\x06stdout\x12\x18\n" + + "\x06stderr\x18\x02 \x01(\fH\x00R\x06stderr\x12\x1d\n" + + "\texit_code\x18\x03 \x01(\x05H\x00R\bexitCodeB\n" + + "\n" + + "\bresponse\"\x91\x01\n" + + "\x12CopyToGuestRequest\x12/\n" + + "\x05start\x18\x01 \x01(\v2\x17.guest.CopyToGuestStartH\x00R\x05start\x12\x14\n" + + "\x04data\x18\x02 \x01(\fH\x00R\x04data\x12)\n" + + "\x03end\x18\x03 \x01(\v2\x15.guest.CopyToGuestEndH\x00R\x03endB\t\n" + + "\arequest\"\x9f\x01\n" + + "\x10CopyToGuestStart\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" + + "\x04mode\x18\x02 \x01(\rR\x04mode\x12\x15\n" + + "\x06is_dir\x18\x03 \x01(\bR\x05isDir\x12\x12\n" + + "\x04size\x18\x04 \x01(\x03R\x04size\x12\x14\n" + + "\x05mtime\x18\x05 \x01(\x03R\x05mtime\x12\x10\n" + + "\x03uid\x18\x06 \x01(\rR\x03uid\x12\x10\n" + + "\x03gid\x18\a \x01(\rR\x03gid\"\x10\n" + + "\x0eCopyToGuestEnd\"j\n" + + "\x13CopyToGuestResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x14\n" + + "\x05error\x18\x02 \x01(\tR\x05error\x12#\n" + + "\rbytes_written\x18\x03 \x01(\x03R\fbytesWritten\"M\n" + + "\x14CopyFromGuestRequest\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12!\n" + + "\ffollow_links\x18\x02 \x01(\bR\vfollowLinks\"\xcf\x01\n" + + "\x15CopyFromGuestResponse\x124\n" + + "\x06header\x18\x01 \x01(\v2\x1a.guest.CopyFromGuestHeaderH\x00R\x06header\x12\x14\n" + + "\x04data\x18\x02 \x01(\fH\x00R\x04data\x12+\n" + + "\x03end\x18\x03 \x01(\v2\x17.guest.CopyFromGuestEndH\x00R\x03end\x121\n" + + "\x05error\x18\x04 \x01(\v2\x19.guest.CopyFromGuestErrorH\x00R\x05errorB\n" + + "\n" + + "\bresponse\"\xe2\x01\n" + + "\x13CopyFromGuestHeader\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" + + "\x04mode\x18\x02 \x01(\rR\x04mode\x12\x15\n" + + "\x06is_dir\x18\x03 \x01(\bR\x05isDir\x12\x1d\n" + + "\n" + + "is_symlink\x18\x04 \x01(\bR\tisSymlink\x12\x1f\n" + + "\vlink_target\x18\x05 \x01(\tR\n" + + "linkTarget\x12\x12\n" + + "\x04size\x18\x06 \x01(\x03R\x04size\x12\x14\n" + + "\x05mtime\x18\a \x01(\x03R\x05mtime\x12\x10\n" + + "\x03uid\x18\b \x01(\rR\x03uid\x12\x10\n" + + "\x03gid\x18\t \x01(\rR\x03gid\"(\n" + + "\x10CopyFromGuestEnd\x12\x14\n" + + "\x05final\x18\x01 \x01(\bR\x05final\"B\n" + + "\x12CopyFromGuestError\x12\x18\n" + + "\amessage\x18\x01 \x01(\tR\amessage\x12\x12\n" + + "\x04path\x18\x02 \x01(\tR\x04path\"H\n" + + "\x0fStatPathRequest\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12!\n" + + "\ffollow_links\x18\x02 \x01(\bR\vfollowLinks\"\xd8\x01\n" + + "\x10StatPathResponse\x12\x16\n" + + "\x06exists\x18\x01 \x01(\bR\x06exists\x12\x15\n" + + "\x06is_dir\x18\x02 \x01(\bR\x05isDir\x12\x17\n" + + "\ais_file\x18\x03 \x01(\bR\x06isFile\x12\x1d\n" + + "\n" + + "is_symlink\x18\x04 \x01(\bR\tisSymlink\x12\x1f\n" + + "\vlink_target\x18\x05 \x01(\tR\n" + + "linkTarget\x12\x12\n" + + "\x04mode\x18\x06 \x01(\rR\x04mode\x12\x12\n" + + "\x04size\x18\a \x01(\x03R\x04size\x12\x14\n" + + "\x05error\x18\b \x01(\tR\x05error2\x96\x02\n" + + "\fGuestService\x123\n" + + "\x04Exec\x12\x12.guest.ExecRequest\x1a\x13.guest.ExecResponse(\x010\x01\x12F\n" + + "\vCopyToGuest\x12\x19.guest.CopyToGuestRequest\x1a\x1a.guest.CopyToGuestResponse(\x01\x12L\n" + + "\rCopyFromGuest\x12\x1b.guest.CopyFromGuestRequest\x1a\x1c.guest.CopyFromGuestResponse0\x01\x12;\n" + + "\bStatPath\x12\x16.guest.StatPathRequest\x1a\x17.guest.StatPathResponseB'Z%github.com/onkernel/hypeman/lib/guestb\x06proto3" + +var ( + file_lib_guest_guest_proto_rawDescOnce sync.Once + file_lib_guest_guest_proto_rawDescData []byte +) + +func file_lib_guest_guest_proto_rawDescGZIP() []byte { + file_lib_guest_guest_proto_rawDescOnce.Do(func() { + file_lib_guest_guest_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_lib_guest_guest_proto_rawDesc), len(file_lib_guest_guest_proto_rawDesc))) + }) + return file_lib_guest_guest_proto_rawDescData +} + +var file_lib_guest_guest_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_lib_guest_guest_proto_goTypes = []any{ + (*ExecRequest)(nil), // 0: guest.ExecRequest + (*ExecStart)(nil), // 1: guest.ExecStart + (*WindowSize)(nil), // 2: guest.WindowSize + (*ExecResponse)(nil), // 3: guest.ExecResponse + (*CopyToGuestRequest)(nil), // 4: guest.CopyToGuestRequest + (*CopyToGuestStart)(nil), // 5: guest.CopyToGuestStart + (*CopyToGuestEnd)(nil), // 6: guest.CopyToGuestEnd + (*CopyToGuestResponse)(nil), // 7: guest.CopyToGuestResponse + (*CopyFromGuestRequest)(nil), // 8: guest.CopyFromGuestRequest + (*CopyFromGuestResponse)(nil), // 9: guest.CopyFromGuestResponse + (*CopyFromGuestHeader)(nil), // 10: guest.CopyFromGuestHeader + (*CopyFromGuestEnd)(nil), // 11: guest.CopyFromGuestEnd + (*CopyFromGuestError)(nil), // 12: guest.CopyFromGuestError + (*StatPathRequest)(nil), // 13: guest.StatPathRequest + (*StatPathResponse)(nil), // 14: guest.StatPathResponse + nil, // 15: guest.ExecStart.EnvEntry +} +var file_lib_guest_guest_proto_depIdxs = []int32{ + 1, // 0: guest.ExecRequest.start:type_name -> guest.ExecStart + 2, // 1: guest.ExecRequest.resize:type_name -> guest.WindowSize + 15, // 2: guest.ExecStart.env:type_name -> guest.ExecStart.EnvEntry + 5, // 3: guest.CopyToGuestRequest.start:type_name -> guest.CopyToGuestStart + 6, // 4: guest.CopyToGuestRequest.end:type_name -> guest.CopyToGuestEnd + 10, // 5: guest.CopyFromGuestResponse.header:type_name -> guest.CopyFromGuestHeader + 11, // 6: guest.CopyFromGuestResponse.end:type_name -> guest.CopyFromGuestEnd + 12, // 7: guest.CopyFromGuestResponse.error:type_name -> guest.CopyFromGuestError + 0, // 8: guest.GuestService.Exec:input_type -> guest.ExecRequest + 4, // 9: guest.GuestService.CopyToGuest:input_type -> guest.CopyToGuestRequest + 8, // 10: guest.GuestService.CopyFromGuest:input_type -> guest.CopyFromGuestRequest + 13, // 11: guest.GuestService.StatPath:input_type -> guest.StatPathRequest + 3, // 12: guest.GuestService.Exec:output_type -> guest.ExecResponse + 7, // 13: guest.GuestService.CopyToGuest:output_type -> guest.CopyToGuestResponse + 9, // 14: guest.GuestService.CopyFromGuest:output_type -> guest.CopyFromGuestResponse + 14, // 15: guest.GuestService.StatPath:output_type -> guest.StatPathResponse + 12, // [12:16] is the sub-list for method output_type + 8, // [8:12] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_lib_guest_guest_proto_init() } +func file_lib_guest_guest_proto_init() { + if File_lib_guest_guest_proto != nil { + return + } + file_lib_guest_guest_proto_msgTypes[0].OneofWrappers = []any{ + (*ExecRequest_Start)(nil), + (*ExecRequest_Stdin)(nil), + (*ExecRequest_Resize)(nil), + } + file_lib_guest_guest_proto_msgTypes[3].OneofWrappers = []any{ + (*ExecResponse_Stdout)(nil), + (*ExecResponse_Stderr)(nil), + (*ExecResponse_ExitCode)(nil), + } + file_lib_guest_guest_proto_msgTypes[4].OneofWrappers = []any{ + (*CopyToGuestRequest_Start)(nil), + (*CopyToGuestRequest_Data)(nil), + (*CopyToGuestRequest_End)(nil), + } + file_lib_guest_guest_proto_msgTypes[9].OneofWrappers = []any{ + (*CopyFromGuestResponse_Header)(nil), + (*CopyFromGuestResponse_Data)(nil), + (*CopyFromGuestResponse_End)(nil), + (*CopyFromGuestResponse_Error)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_lib_guest_guest_proto_rawDesc), len(file_lib_guest_guest_proto_rawDesc)), + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_lib_guest_guest_proto_goTypes, + DependencyIndexes: file_lib_guest_guest_proto_depIdxs, + MessageInfos: file_lib_guest_guest_proto_msgTypes, + }.Build() + File_lib_guest_guest_proto = out.File + file_lib_guest_guest_proto_goTypes = nil + file_lib_guest_guest_proto_depIdxs = nil } diff --git a/lib/guest/guest.proto b/lib/guest/guest.proto index 7c9e549..db08b31 100644 --- a/lib/guest/guest.proto +++ b/lib/guest/guest.proto @@ -24,6 +24,7 @@ message ExecRequest { oneof request { ExecStart start = 1; // Initial exec request bytes stdin = 2; // Stdin data + WindowSize resize = 3; // Window resize event } } @@ -34,6 +35,14 @@ message ExecStart { map env = 3; // Environment variables string cwd = 4; // Working directory (optional) int32 timeout_seconds = 5; // Execution timeout in seconds (0 = no timeout) + uint32 rows = 6; // Initial terminal rows (0 = default 24) + uint32 cols = 7; // Initial terminal cols (0 = default 80) +} + +// WindowSize represents terminal window dimensions for resize events +message WindowSize { + uint32 rows = 1; + uint32 cols = 2; } // ExecResponse represents messages from server to client diff --git a/lib/system/guest_agent/exec.go b/lib/system/guest_agent/exec.go index 8f6c4fc..409754c 100644 --- a/lib/system/guest_agent/exec.go +++ b/lib/system/guest_agent/exec.go @@ -7,6 +7,7 @@ import ( "log" "os" "os/exec" + "strings" "sync" "time" @@ -60,8 +61,8 @@ func (s *guestServer) executeNoTTY(ctx context.Context, stream pb.GuestService_E cmd := exec.CommandContext(ctx, start.Command[0], start.Command[1:]...) - // Set up environment - cmd.Env = s.buildEnv(start.Env) + // Set up environment (no TTY defaults for non-TTY mode) + cmd.Env = s.buildEnv(start.Env, false) // Set up working directory if start.Cwd != "" { @@ -169,16 +170,28 @@ func (s *guestServer) executeTTY(ctx context.Context, stream pb.GuestService_Exe cmd := exec.CommandContext(ctx, start.Command[0], start.Command[1:]...) - // Set up environment - cmd.Env = s.buildEnv(start.Env) + // Set up environment (TTY mode adds TERM default) + cmd.Env = s.buildEnv(start.Env, true) // Set up working directory if start.Cwd != "" { cmd.Dir = start.Cwd } - // Start with PTY - ptmx, err := pty.Start(cmd) + // Set up initial window size (use defaults if not specified) + ws := &pty.Winsize{ + Rows: uint16(start.Rows), + Cols: uint16(start.Cols), + } + if ws.Rows == 0 { + ws.Rows = 24 + } + if ws.Cols == 0 { + ws.Cols = 80 + } + + // Start with PTY and initial window size + ptmx, err := pty.StartWithSize(cmd, ws) if err != nil { return fmt.Errorf("start pty: %w", err) } @@ -190,7 +203,7 @@ func (s *guestServer) executeTTY(ctx context.Context, stream pb.GuestService_Exe // Use WaitGroup to ensure all output is sent before exit code var wg sync.WaitGroup - // Handle stdin in background + // Handle stdin and resize in background go func() { for { req, err := stream.Recv() @@ -201,6 +214,14 @@ func (s *guestServer) executeTTY(ctx context.Context, stream pb.GuestService_Exe if data := req.GetStdin(); data != nil { ptmx.Write(data) } + + // Handle window resize + if resize := req.GetResize(); resize != nil { + pty.Setsize(ptmx, &pty.Winsize{ + Rows: uint16(resize.Rows), + Cols: uint16(resize.Cols), + }) + } } }() @@ -246,16 +267,42 @@ func (s *guestServer) executeTTY(ctx context.Context, stream pb.GuestService_Exe }) } -// buildEnv constructs environment variables by merging provided env with defaults -func (s *guestServer) buildEnv(envMap map[string]string) []string { - // Start with current environment as base - env := os.Environ() +// buildEnv constructs environment variables by merging provided env with defaults. +// When tty is true, adds sensible defaults for interactive terminal sessions. +// User-provided env vars override both base environment and defaults. +func (s *guestServer) buildEnv(envMap map[string]string, tty bool) []string { + // Build map of keys to override (user-provided + TTY defaults) + overrides := make(map[string]string) + + // Add defaults for TTY sessions + if tty { + overrides["TERM"] = "xterm-256color" + overrides["LANG"] = "C.UTF-8" + overrides["LC_ALL"] = "C.UTF-8" + overrides["COLORTERM"] = "truecolor" + } - // Merge in provided environment variables + // User-provided env vars override defaults for k, v := range envMap { + overrides[k] = v + } + + // Start with current environment, filtering out keys we'll override + var env []string + for _, e := range os.Environ() { + parts := strings.SplitN(e, "=", 2) + if len(parts) == 2 { + if _, override := overrides[parts[0]]; override { + continue // Skip - we'll add our value + } + } + env = append(env, e) + } + + // Add overrides + for k, v := range overrides { env = append(env, fmt.Sprintf("%s=%s", k, v)) } return env } - diff --git a/lib/system/guest_agent/exec_test.go b/lib/system/guest_agent/exec_test.go new file mode 100644 index 0000000..ca34405 --- /dev/null +++ b/lib/system/guest_agent/exec_test.go @@ -0,0 +1,36 @@ +package main + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestBuildEnv(t *testing.T) { + s := &guestServer{} + + t.Run("TTY session gets TERM default", func(t *testing.T) { + env := s.buildEnv(nil, true) + assert.Contains(t, env, "TERM=xterm-256color") + }) + + t.Run("non-TTY session does not add xterm-256color", func(t *testing.T) { + env := s.buildEnv(nil, false) + // Non-TTY should not add our default TERM + // (host environment TERM may still be present, that's fine) + assert.NotContains(t, env, "TERM=xterm-256color", "non-TTY should not add xterm-256color default") + }) + + t.Run("user TERM overrides default", func(t *testing.T) { + env := s.buildEnv(map[string]string{"TERM": "dumb"}, true) + termCount := 0 + for _, e := range env { + if strings.HasPrefix(e, "TERM=") { + assert.Equal(t, "TERM=dumb", e) + termCount++ + } + } + assert.Equal(t, 1, termCount, "should have exactly one TERM") + }) +} diff --git a/tools.go b/tools.go new file mode 100644 index 0000000..087a31a --- /dev/null +++ b/tools.go @@ -0,0 +1,14 @@ +//go:build tools + +package tools + +// This file declares tool dependencies so they are tracked in go.mod. +// It uses a build constraint to prevent it from being compiled. +// +// To regenerate proto files, use: make generate-grpc +// The generators will use the versions pinned in go.mod. + +import ( + _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" + _ "google.golang.org/protobuf/cmd/protoc-gen-go" +)