From 5ecae60568bf5cf6da4295666f389695eb2e095e Mon Sep 17 00:00:00 2001 From: Harsh Rawat Date: Wed, 28 Jan 2026 03:17:05 +0530 Subject: [PATCH 1/2] remove remotevm implementation This implementation was added for hcsshim + HvLite (OpenHCL). The idea was that we could use different virt stacks, as long as they implement the remotevm APIs. That initiative is dormant as of present and this codepath is no-op/dead code. We can likely re-use and re-purpose the interfaces created in the package. But keeping the obsolete code demand maintenance cost too when we make changes to the interface. If we need to support this functionality in the future, this commit can be reverted. Signed-off-by: Harsh Rawat --- internal/vm/remotevm/boot.go | 29 - internal/vm/remotevm/builder.go | 111 - internal/vm/remotevm/doc.go | 1 - internal/vm/remotevm/memory.go | 38 - internal/vm/remotevm/network.go | 122 - internal/vm/remotevm/processor.go | 17 - internal/vm/remotevm/remotevm.go | 108 - internal/vm/remotevm/scsi.go | 106 - internal/vm/remotevm/serial.go | 16 - internal/vm/remotevm/stats.go | 14 - internal/vm/remotevm/storage.go | 20 - internal/vm/remotevm/vmsocket.go | 94 - internal/vm/remotevm/windows.go | 23 - internal/vm/vm.go | 5 - internal/vmservice/doc.go | 1 - internal/vmservice/vmservice.pb.go | 2496 ----------------- internal/vmservice/vmservice.proto | 276 -- internal/vmservice/vmservice_ttrpc.pb.go | 205 -- .../types/known/structpb/struct.pb.go | 767 ----- vendor/modules.txt | 1 - 20 files changed, 4450 deletions(-) delete mode 100644 internal/vm/remotevm/boot.go delete mode 100644 internal/vm/remotevm/builder.go delete mode 100644 internal/vm/remotevm/doc.go delete mode 100644 internal/vm/remotevm/memory.go delete mode 100644 internal/vm/remotevm/network.go delete mode 100644 internal/vm/remotevm/processor.go delete mode 100644 internal/vm/remotevm/remotevm.go delete mode 100644 internal/vm/remotevm/scsi.go delete mode 100644 internal/vm/remotevm/serial.go delete mode 100644 internal/vm/remotevm/stats.go delete mode 100644 internal/vm/remotevm/storage.go delete mode 100644 internal/vm/remotevm/vmsocket.go delete mode 100644 internal/vm/remotevm/windows.go delete mode 100644 internal/vmservice/doc.go delete mode 100644 internal/vmservice/vmservice.pb.go delete mode 100644 internal/vmservice/vmservice.proto delete mode 100644 internal/vmservice/vmservice_ttrpc.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go diff --git a/internal/vm/remotevm/boot.go b/internal/vm/remotevm/boot.go deleted file mode 100644 index 91e42ae748..0000000000 --- a/internal/vm/remotevm/boot.go +++ /dev/null @@ -1,29 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "github.com/Microsoft/hcsshim/internal/vmservice" -) - -func (uvmb *utilityVMBuilder) SetLinuxKernelDirectBoot(kernel, initRD, cmd string) error { - uvmb.config.BootConfig = &vmservice.VMConfig_DirectBoot{ - DirectBoot: &vmservice.DirectBoot{ - KernelPath: kernel, - InitrdPath: initRD, - KernelCmdline: cmd, - }, - } - return nil -} - -func (uvmb *utilityVMBuilder) SetUEFIBoot(firmware, devPath, args string) error { - uvmb.config.BootConfig = &vmservice.VMConfig_Uefi{ - Uefi: &vmservice.UEFI{ - FirmwarePath: firmware, - DevicePath: devPath, - OptionalData: args, - }, - } - return nil -} diff --git a/internal/vm/remotevm/builder.go b/internal/vm/remotevm/builder.go deleted file mode 100644 index ed41d751a2..0000000000 --- a/internal/vm/remotevm/builder.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - "io" - "net" - "os/exec" - - "github.com/containerd/ttrpc" - "github.com/pkg/errors" - "github.com/sirupsen/logrus" - "google.golang.org/protobuf/types/known/emptypb" - - "github.com/Microsoft/hcsshim/internal/jobobject" - "github.com/Microsoft/hcsshim/internal/log" - "github.com/Microsoft/hcsshim/internal/vm" - "github.com/Microsoft/hcsshim/internal/vmservice" -) - -var _ vm.UVMBuilder = &utilityVMBuilder{} - -type utilityVMBuilder struct { - id string - guestOS vm.GuestOS - job *jobobject.JobObject - config *vmservice.VMConfig - client vmservice.VMService -} - -func NewUVMBuilder(ctx context.Context, id, owner, binPath, addr string, guestOS vm.GuestOS) (_ vm.UVMBuilder, err error) { - var job *jobobject.JobObject - if binPath != "" { - log.G(ctx).WithFields(logrus.Fields{ - "binary": binPath, - "address": addr, - }).Debug("starting remotevm server process") - - opts := &jobobject.Options{ - Name: id, - } - job, err = jobobject.Create(ctx, opts) - if err != nil { - return nil, errors.Wrap(err, "failed to create job object for remotevm process") - } - - cmd := exec.Command(binPath, "--ttrpc", addr) - p, err := cmd.StdoutPipe() - if err != nil { - return nil, errors.Wrap(err, "failed to create stdout pipe") - } - - if err := cmd.Start(); err != nil { - return nil, errors.Wrap(err, "failed to start remotevm server process") - } - - if err := job.Assign(uint32(cmd.Process.Pid)); err != nil { - return nil, errors.Wrap(err, "failed to assign remotevm process to job") - } - - if err := job.SetTerminateOnLastHandleClose(); err != nil { - return nil, errors.Wrap(err, "failed to set terminate on last handle closed for remotevm job object") - } - - // Wait for stdout to close. This is our signal that the server is successfully up and running. - _, _ = io.Copy(io.Discard, p) - } - - conn, err := net.Dial("unix", addr) - if err != nil { - return nil, errors.Wrapf(err, "failed to dial remotevm address %q", addr) - } - - c := ttrpc.NewClient(conn, ttrpc.WithOnClose(func() { conn.Close() })) - vmClient := vmservice.NewVMClient(c) - - return &utilityVMBuilder{ - id: id, - guestOS: guestOS, - config: &vmservice.VMConfig{ - MemoryConfig: &vmservice.MemoryConfig{}, - DevicesConfig: &vmservice.DevicesConfig{}, - ProcessorConfig: &vmservice.ProcessorConfig{}, - SerialConfig: &vmservice.SerialConfig{}, - ExtraData: make(map[string]string), - }, - job: job, - client: vmClient, - }, nil -} - -func (uvmb *utilityVMBuilder) Create(ctx context.Context) (vm.UVM, error) { - // Grab what capabilities the virtstack supports up front. - capabilities, err := uvmb.client.CapabilitiesVM(ctx, &emptypb.Empty{}) - if err != nil { - return nil, errors.Wrap(err, "failed to get virtstack capabilities from vmservice") - } - - if _, err := uvmb.client.CreateVM(ctx, &vmservice.CreateVMRequest{Config: uvmb.config, LogID: uvmb.id}); err != nil { - return nil, errors.Wrap(err, "failed to create remote VM") - } - - return &utilityVM{ - id: uvmb.id, - job: uvmb.job, - config: uvmb.config, - client: uvmb.client, - capabilities: capabilities, - }, nil -} diff --git a/internal/vm/remotevm/doc.go b/internal/vm/remotevm/doc.go deleted file mode 100644 index 651278471e..0000000000 --- a/internal/vm/remotevm/doc.go +++ /dev/null @@ -1 +0,0 @@ -package remotevm diff --git a/internal/vm/remotevm/memory.go b/internal/vm/remotevm/memory.go deleted file mode 100644 index 9f7b3ce8cb..0000000000 --- a/internal/vm/remotevm/memory.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "github.com/Microsoft/hcsshim/internal/vm" - "github.com/Microsoft/hcsshim/internal/vmservice" -) - -func (uvmb *utilityVMBuilder) SetMemoryLimit(memoryMB uint64) error { - if uvmb.config.MemoryConfig == nil { - uvmb.config.MemoryConfig = &vmservice.MemoryConfig{} - } - uvmb.config.MemoryConfig.MemoryMb = memoryMB - return nil -} - -func (uvmb *utilityVMBuilder) SetMemoryConfig(config *vm.MemoryConfig) error { - if uvmb.config.MemoryConfig == nil { - uvmb.config.MemoryConfig = &vmservice.MemoryConfig{} - } - uvmb.config.MemoryConfig.AllowOvercommit = config.BackingType == vm.MemoryBackingTypeVirtual - uvmb.config.MemoryConfig.ColdHint = config.ColdHint - uvmb.config.MemoryConfig.ColdDiscardHint = config.ColdDiscardHint - uvmb.config.MemoryConfig.DeferredCommit = config.DeferredCommit - uvmb.config.MemoryConfig.HotHint = config.HotHint - return vm.ErrNotSupported -} - -func (uvmb *utilityVMBuilder) SetMMIOConfig(lowGapMB uint64, highBaseMB uint64, highGapMB uint64) error { - if uvmb.config.MemoryConfig == nil { - uvmb.config.MemoryConfig = &vmservice.MemoryConfig{} - } - uvmb.config.MemoryConfig.HighMmioBaseInMb = highBaseMB - uvmb.config.MemoryConfig.LowMmioGapInMb = lowGapMB - uvmb.config.MemoryConfig.HighMmioGapInMb = highGapMB - return nil -} diff --git a/internal/vm/remotevm/network.go b/internal/vm/remotevm/network.go deleted file mode 100644 index d44f41c6a4..0000000000 --- a/internal/vm/remotevm/network.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - "encoding/json" - "fmt" - "strings" - - "github.com/Microsoft/go-winio/pkg/guid" - "github.com/Microsoft/hcsshim/hcn" - "github.com/Microsoft/hcsshim/internal/vmservice" - "github.com/pkg/errors" -) - -func getSwitchID(endpointID, portID string) (string, error) { - // Get updated endpoint with new fields (need switch ID) - ep, err := hcn.GetEndpointByID(endpointID) - if err != nil { - return "", errors.Wrapf(err, "failed to get endpoint %q", endpointID) - } - - type ExtraInfo struct { - Allocators []struct { - SwitchID string `json:"SwitchId"` - EndpointPortGUID string `json:"EndpointPortGuid"` - } - } - - var exi ExtraInfo - if err := json.Unmarshal(ep.Health.Extra.Resources, &exi); err != nil { - return "", errors.Wrapf(err, "failed to unmarshal resource data from endpoint %q", endpointID) - } - - if len(exi.Allocators) == 0 { - return "", errors.New("no resource data found for endpoint") - } - - // NIC should only ever belong to one switch but there are cases where there's more than one allocator - // in the returned data. It seems they only ever contain empty strings so search for the first entry - // that actually contains a switch ID and that has the matching port GUID we made earlier. - var switchID string - for _, allocator := range exi.Allocators { - if allocator.SwitchID != "" && strings.ToLower(allocator.EndpointPortGUID) == portID { - switchID = allocator.SwitchID - break - } - } - return switchID, nil -} - -func (uvm *utilityVM) AddNIC(ctx context.Context, nicID, endpointID, macAddr string) error { - portID, err := guid.NewV4() - if err != nil { - return errors.Wrap(err, "failed to generate guid for port") - } - - vmEndpointRequest := hcn.VmEndpointRequest{ - PortId: portID, - VirtualNicName: fmt.Sprintf("%s--%s", nicID, portID), - VirtualMachineId: guid.GUID{}, - } - - m, err := json.Marshal(vmEndpointRequest) - if err != nil { - return errors.Wrap(err, "failed to marshal endpoint request json") - } - - if err := hcn.ModifyEndpointSettings(endpointID, &hcn.ModifyEndpointSettingRequest{ - ResourceType: hcn.EndpointResourceTypePort, - RequestType: hcn.RequestTypeAdd, - Settings: json.RawMessage(m), - }); err != nil { - return errors.Wrap(err, "failed to configure switch port") - } - - switchID, err := getSwitchID(endpointID, portID.String()) - if err != nil { - return err - } - - nic := &vmservice.NICConfig{ - NicID: nicID, - MacAddress: macAddr, - PortID: portID.String(), - SwitchID: switchID, - } - - if _, err := uvm.client.ModifyResource(ctx, - &vmservice.ModifyResourceRequest{ - Type: vmservice.ModifyType_ADD, - Resource: &vmservice.ModifyResourceRequest_NicConfig{ - NicConfig: nic, - }, - }, - ); err != nil { - return errors.Wrap(err, "failed to add network adapter") - } - - return nil -} - -func (uvm *utilityVM) RemoveNIC(ctx context.Context, nicID, endpointID, macAddr string) error { - nic := &vmservice.NICConfig{ - NicID: nicID, - MacAddress: macAddr, - } - - if _, err := uvm.client.ModifyResource(ctx, - &vmservice.ModifyResourceRequest{ - Type: vmservice.ModifyType_REMOVE, - Resource: &vmservice.ModifyResourceRequest_NicConfig{ - NicConfig: nic, - }, - }, - ); err != nil { - return errors.Wrap(err, "failed to remove network adapter") - } - - return nil -} diff --git a/internal/vm/remotevm/processor.go b/internal/vm/remotevm/processor.go deleted file mode 100644 index da8aa276ff..0000000000 --- a/internal/vm/remotevm/processor.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - - "github.com/Microsoft/hcsshim/internal/vmservice" -) - -func (uvmb *utilityVMBuilder) SetProcessorCount(ctx context.Context, count uint32) error { - if uvmb.config.ProcessorConfig == nil { - uvmb.config.ProcessorConfig = &vmservice.ProcessorConfig{} - } - uvmb.config.ProcessorConfig.ProcessorCount = count - return nil -} diff --git a/internal/vm/remotevm/remotevm.go b/internal/vm/remotevm/remotevm.go deleted file mode 100644 index f02327c6c4..0000000000 --- a/internal/vm/remotevm/remotevm.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - - "github.com/pkg/errors" - "google.golang.org/protobuf/types/known/emptypb" - - "github.com/Microsoft/hcsshim/internal/jobobject" - "github.com/Microsoft/hcsshim/internal/vm" - "github.com/Microsoft/hcsshim/internal/vmservice" -) - -var _ vm.UVM = &utilityVM{} - -type utilityVM struct { - id string - waitError error - job *jobobject.JobObject - config *vmservice.VMConfig - client vmservice.VMService - capabilities *vmservice.CapabilitiesVMResponse -} - -var vmSupportedResourceToVMService = map[vm.Resource]vmservice.CapabilitiesVMResponse_Resource{ - vm.VPMem: vmservice.CapabilitiesVMResponse_Vpmem, - vm.SCSI: vmservice.CapabilitiesVMResponse_Scsi, - vm.PCI: vmservice.CapabilitiesVMResponse_Vpci, - vm.Plan9: vmservice.CapabilitiesVMResponse_Plan9, - vm.Network: vmservice.CapabilitiesVMResponse_VMNic, - vm.Memory: vmservice.CapabilitiesVMResponse_Memory, - vm.Processor: vmservice.CapabilitiesVMResponse_Processor, -} - -func (uvm *utilityVM) ID() string { - return uvm.id -} - -func (uvm *utilityVM) Start(ctx context.Context) error { - // The expectation is the VM should be in a paused state after creation. - if _, err := uvm.client.ResumeVM(ctx, &emptypb.Empty{}); err != nil { - return errors.Wrap(err, "failed to start remote VM") - } - return nil -} - -func (uvm *utilityVM) Stop(ctx context.Context) error { - if _, err := uvm.client.TeardownVM(ctx, &emptypb.Empty{}); err != nil { - return errors.Wrap(err, "failed to stop remote VM") - } - return nil -} - -func (uvm *utilityVM) Wait() error { - _, err := uvm.client.WaitVM(context.Background(), &emptypb.Empty{}) - if err != nil { - uvm.waitError = err - return errors.Wrap(err, "failed to wait on remote VM") - } - return nil -} - -func (uvm *utilityVM) Pause(ctx context.Context) error { - if _, err := uvm.client.PauseVM(ctx, &emptypb.Empty{}); err != nil { - return errors.Wrap(err, "failed to pause remote VM") - } - return nil -} - -func (uvm *utilityVM) Resume(ctx context.Context) error { - if _, err := uvm.client.ResumeVM(ctx, &emptypb.Empty{}); err != nil { - return errors.Wrap(err, "failed to resume remote VM") - } - return nil -} - -func (uvm *utilityVM) Save(ctx context.Context) error { - return vm.ErrNotSupported -} - -func (uvm *utilityVM) Supported(resource vm.Resource, operation vm.ResourceOperation) bool { - var foundResource *vmservice.CapabilitiesVMResponse_SupportedResource - for _, supportedResource := range uvm.capabilities.SupportedResources { - if vmSupportedResourceToVMService[resource] == supportedResource.Resource { - foundResource = supportedResource - } - } - - supported := false - switch operation { - case vm.Add: - supported = foundResource.Add - case vm.Remove: - supported = foundResource.Remove - case vm.Update: - supported = foundResource.Update - default: - return false - } - - return supported -} - -func (uvm *utilityVM) ExitError() error { - return uvm.waitError -} diff --git a/internal/vm/remotevm/scsi.go b/internal/vm/remotevm/scsi.go deleted file mode 100644 index fc7863669e..0000000000 --- a/internal/vm/remotevm/scsi.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - "fmt" - - "github.com/Microsoft/hcsshim/internal/vm" - "github.com/Microsoft/hcsshim/internal/vmservice" - "github.com/pkg/errors" -) - -func getSCSIDiskType(typ vm.SCSIDiskType) (vmservice.DiskType, error) { - var diskType vmservice.DiskType - switch typ { - case vm.SCSIDiskTypeVHD1: - diskType = vmservice.DiskType_SCSI_DISK_TYPE_VHD1 - case vm.SCSIDiskTypeVHDX: - diskType = vmservice.DiskType_SCSI_DISK_TYPE_VHDX - case vm.SCSIDiskTypePassThrough: - diskType = vmservice.DiskType_SCSI_DISK_TYPE_PHYSICAL - default: - return -1, fmt.Errorf("unsupported SCSI disk type: %d", typ) - } - return diskType, nil -} - -func (uvmb *utilityVMBuilder) AddSCSIController(id uint32) error { - return nil -} - -func (uvmb *utilityVMBuilder) AddSCSIDisk(ctx context.Context, controller, lun uint32, path string, typ vm.SCSIDiskType, readOnly bool) error { - diskType, err := getSCSIDiskType(typ) - if err != nil { - return err - } - - disk := &vmservice.SCSIDisk{ - Controller: controller, - Lun: lun, - HostPath: path, - Type: diskType, - ReadOnly: readOnly, - } - - uvmb.config.DevicesConfig.ScsiDisks = append(uvmb.config.DevicesConfig.ScsiDisks, disk) - return nil -} - -func (uvmb *utilityVMBuilder) RemoveSCSIDisk(ctx context.Context, controller, lun uint32, path string) error { - return vm.ErrNotSupported -} - -func (uvm *utilityVM) AddSCSIController(id uint32) error { - return vm.ErrNotSupported -} - -func (uvm *utilityVM) AddSCSIDisk(ctx context.Context, controller, lun uint32, path string, typ vm.SCSIDiskType, readOnly bool) error { - diskType, err := getSCSIDiskType(typ) - if err != nil { - return err - } - - disk := &vmservice.SCSIDisk{ - Controller: controller, - Lun: lun, - HostPath: path, - Type: diskType, - ReadOnly: readOnly, - } - - if _, err := uvm.client.ModifyResource(ctx, - &vmservice.ModifyResourceRequest{ - Type: vmservice.ModifyType_ADD, - Resource: &vmservice.ModifyResourceRequest_ScsiDisk{ - ScsiDisk: disk, - }, - }, - ); err != nil { - return errors.Wrap(err, "failed to add SCSI disk") - } - - return nil -} - -func (uvm *utilityVM) RemoveSCSIDisk(ctx context.Context, controller, lun uint32, path string) error { - disk := &vmservice.SCSIDisk{ - Controller: controller, - Lun: lun, - HostPath: path, - } - - if _, err := uvm.client.ModifyResource(ctx, - &vmservice.ModifyResourceRequest{ - Type: vmservice.ModifyType_REMOVE, - Resource: &vmservice.ModifyResourceRequest_ScsiDisk{ - ScsiDisk: disk, - }, - }, - ); err != nil { - return errors.Wrapf(err, "failed to remove SCSI disk %q", path) - } - - return nil -} diff --git a/internal/vm/remotevm/serial.go b/internal/vm/remotevm/serial.go deleted file mode 100644 index 8a60db0e24..0000000000 --- a/internal/vm/remotevm/serial.go +++ /dev/null @@ -1,16 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "github.com/Microsoft/hcsshim/internal/vmservice" -) - -func (uvmb *utilityVMBuilder) SetSerialConsole(port uint32, listenerPath string) error { - config := &vmservice.SerialConfig_Config{ - Port: port, - SocketPath: listenerPath, - } - uvmb.config.SerialConfig.Ports = []*vmservice.SerialConfig_Config{config} - return nil -} diff --git a/internal/vm/remotevm/stats.go b/internal/vm/remotevm/stats.go deleted file mode 100644 index bef8363f8a..0000000000 --- a/internal/vm/remotevm/stats.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - - "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats" - "github.com/Microsoft/hcsshim/internal/vm" -) - -func (uvm *utilityVM) Stats(ctx context.Context) (*stats.VirtualMachineStatistics, error) { - return nil, vm.ErrNotSupported -} diff --git a/internal/vm/remotevm/storage.go b/internal/vm/remotevm/storage.go deleted file mode 100644 index 13a8358193..0000000000 --- a/internal/vm/remotevm/storage.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "github.com/pkg/errors" -) - -func (uvmb *utilityVMBuilder) SetStorageQos(iopsMaximum int64, bandwidthMaximum int64) error { - // The way that HCS handles these options is a bit odd. They launch the vmworker process in a job object and - // set the bandwidth and iops limits on the worker process' job object. To keep parity with what we expose today - // in HCS we can do the same here as we launch the server process in a job object. - if uvmb.job != nil { - if err := uvmb.job.SetIOLimit(bandwidthMaximum, iopsMaximum); err != nil { - return errors.Wrap(err, "failed to set storage qos values on remotevm process") - } - } - - return nil -} diff --git a/internal/vm/remotevm/vmsocket.go b/internal/vm/remotevm/vmsocket.go deleted file mode 100644 index 30be2769b9..0000000000 --- a/internal/vm/remotevm/vmsocket.go +++ /dev/null @@ -1,94 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - "net" - "os" - - "github.com/Microsoft/go-winio/pkg/guid" - "github.com/Microsoft/hcsshim/internal/vm" - "github.com/Microsoft/hcsshim/internal/vmservice" - "github.com/pkg/errors" -) - -func (uvm *utilityVM) VMSocketListen(ctx context.Context, listenType vm.VMSocketType, connID interface{}) (_ net.Listener, err error) { - // Make a temp file and delete to "reserve" a unique name for the unix socket - f, err := os.CreateTemp("", "") - if err != nil { - return nil, errors.Wrap(err, "failed to create temp file for unix socket") - } - - if err := f.Close(); err != nil { - return nil, errors.Wrap(err, "failed to close temp file") - } - - if err := os.Remove(f.Name()); err != nil { - return nil, errors.Wrap(err, "failed to delete temp file to free up name") - } - - l, err := net.Listen("unix", f.Name()) - if err != nil { - return nil, errors.Wrapf(err, "failed to listen on unix socket %q", f.Name()) - } - - defer func() { - if err != nil { - _ = l.Close() - } - }() - - switch listenType { - case vm.HvSocket: - serviceGUID, ok := connID.(guid.GUID) - if !ok { - return nil, errors.New("parameter passed to hvsocketlisten is not a GUID") - } - if err := uvm.hvSocketListen(ctx, serviceGUID.String(), f.Name()); err != nil { - return nil, errors.Wrap(err, "failed to setup relay to hvsocket listener") - } - case vm.VSock: - port, ok := connID.(uint32) - if !ok { - return nil, errors.New("parameter passed to vsocklisten is not the right type") - } - if err := uvm.vsockListen(ctx, port, f.Name()); err != nil { - return nil, errors.Wrap(err, "failed to setup relay to vsock listener") - } - default: - return nil, errors.New("unknown vmsocket type requested") - } - - return l, nil -} - -func (uvm *utilityVM) hvSocketListen(ctx context.Context, serviceID string, listenerPath string) error { - if _, err := uvm.client.VMSocket(ctx, &vmservice.VMSocketRequest{ - Type: vmservice.ModifyType_ADD, - Config: &vmservice.VMSocketRequest_HvsocketList{ - HvsocketList: &vmservice.HVSocketListen{ - ServiceID: serviceID, - ListenerPath: listenerPath, - }, - }, - }); err != nil { - return err - } - return nil -} - -func (uvm *utilityVM) vsockListen(ctx context.Context, port uint32, listenerPath string) error { - if _, err := uvm.client.VMSocket(ctx, &vmservice.VMSocketRequest{ - Type: vmservice.ModifyType_ADD, - Config: &vmservice.VMSocketRequest_VsockListen{ - VsockListen: &vmservice.VSockListen{ - Port: port, - ListenerPath: listenerPath, - }, - }, - }); err != nil { - return err - } - return nil -} diff --git a/internal/vm/remotevm/windows.go b/internal/vm/remotevm/windows.go deleted file mode 100644 index 9e1ef7fb18..0000000000 --- a/internal/vm/remotevm/windows.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build windows - -package remotevm - -import ( - "context" - - "github.com/Microsoft/hcsshim/internal/cpugroup" - "github.com/Microsoft/hcsshim/internal/vmservice" -) - -func (uvmb *utilityVMBuilder) SetCPUGroup(ctx context.Context, id string) error { - if uvmb.config.WindowsOptions == nil { - uvmb.config.WindowsOptions = &vmservice.WindowsOptions{} - } - // Map from guid to the underlying hypervisor ID. - conf, err := cpugroup.GetCPUGroupConfig(ctx, id) - if err != nil { - return err - } - uvmb.config.WindowsOptions.CpuGroupID = conf.HypervisorGroupId - return nil -} diff --git a/internal/vm/vm.go b/internal/vm/vm.go index 4e0b31ca5f..b7bfd9e25c 100644 --- a/internal/vm/vm.go +++ b/internal/vm/vm.go @@ -15,11 +15,6 @@ var ( ErrUnknownGuestOS = errors.New("unknown guest operating system supplied") ) -const ( - HCS = "hcs" - RemoteVM = "remotevm" -) - // UVM is an abstraction around a lightweight virtual machine. It houses core lifecycle methods such as Create // Start, and Stop and also several optional nested interfaces that can be used to determine what the virtual machine // supports and to configure these resources. diff --git a/internal/vmservice/doc.go b/internal/vmservice/doc.go deleted file mode 100644 index 193ee8cc7a..0000000000 --- a/internal/vmservice/doc.go +++ /dev/null @@ -1 +0,0 @@ -package vmservice diff --git a/internal/vmservice/vmservice.pb.go b/internal/vmservice/vmservice.pb.go deleted file mode 100644 index bcc25a8180..0000000000 --- a/internal/vmservice/vmservice.pb.go +++ /dev/null @@ -1,2496 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.7 -// protoc v5.26.0 -// source: github.com/Microsoft/hcsshim/internal/vmservice/vmservice.proto - -package vmservice - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - structpb "google.golang.org/protobuf/types/known/structpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -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) -) - -type ModifyType int32 - -const ( - ModifyType_ADD ModifyType = 0 - ModifyType_REMOVE ModifyType = 1 - ModifyType_UPDATE ModifyType = 2 -) - -// Enum value maps for ModifyType. -var ( - ModifyType_name = map[int32]string{ - 0: "ADD", - 1: "REMOVE", - 2: "UPDATE", - } - ModifyType_value = map[string]int32{ - "ADD": 0, - "REMOVE": 1, - "UPDATE": 2, - } -) - -func (x ModifyType) Enum() *ModifyType { - p := new(ModifyType) - *p = x - return p -} - -func (x ModifyType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ModifyType) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[0].Descriptor() -} - -func (ModifyType) Type() protoreflect.EnumType { - return &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[0] -} - -func (x ModifyType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ModifyType.Descriptor instead. -func (ModifyType) EnumDescriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{0} -} - -type DiskType int32 - -const ( - DiskType_SCSI_DISK_TYPE_VHD1 DiskType = 0 - DiskType_SCSI_DISK_TYPE_VHDX DiskType = 1 - DiskType_SCSI_DISK_TYPE_PHYSICAL DiskType = 2 -) - -// Enum value maps for DiskType. -var ( - DiskType_name = map[int32]string{ - 0: "SCSI_DISK_TYPE_VHD1", - 1: "SCSI_DISK_TYPE_VHDX", - 2: "SCSI_DISK_TYPE_PHYSICAL", - } - DiskType_value = map[string]int32{ - "SCSI_DISK_TYPE_VHD1": 0, - "SCSI_DISK_TYPE_VHDX": 1, - "SCSI_DISK_TYPE_PHYSICAL": 2, - } -) - -func (x DiskType) Enum() *DiskType { - p := new(DiskType) - *p = x - return p -} - -func (x DiskType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DiskType) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[1].Descriptor() -} - -func (DiskType) Type() protoreflect.EnumType { - return &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[1] -} - -func (x DiskType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DiskType.Descriptor instead. -func (DiskType) EnumDescriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{1} -} - -type PropertiesVMRequest_PropertiesType int32 - -const ( - PropertiesVMRequest_Memory PropertiesVMRequest_PropertiesType = 0 - PropertiesVMRequest_Processor PropertiesVMRequest_PropertiesType = 1 -) - -// Enum value maps for PropertiesVMRequest_PropertiesType. -var ( - PropertiesVMRequest_PropertiesType_name = map[int32]string{ - 0: "Memory", - 1: "Processor", - } - PropertiesVMRequest_PropertiesType_value = map[string]int32{ - "Memory": 0, - "Processor": 1, - } -) - -func (x PropertiesVMRequest_PropertiesType) Enum() *PropertiesVMRequest_PropertiesType { - p := new(PropertiesVMRequest_PropertiesType) - *p = x - return p -} - -func (x PropertiesVMRequest_PropertiesType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PropertiesVMRequest_PropertiesType) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[2].Descriptor() -} - -func (PropertiesVMRequest_PropertiesType) Type() protoreflect.EnumType { - return &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[2] -} - -func (x PropertiesVMRequest_PropertiesType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PropertiesVMRequest_PropertiesType.Descriptor instead. -func (PropertiesVMRequest_PropertiesType) EnumDescriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{13, 0} -} - -type CapabilitiesVMResponse_Resource int32 - -const ( - CapabilitiesVMResponse_Vpmem CapabilitiesVMResponse_Resource = 0 - CapabilitiesVMResponse_Scsi CapabilitiesVMResponse_Resource = 1 - CapabilitiesVMResponse_Vpci CapabilitiesVMResponse_Resource = 2 - CapabilitiesVMResponse_Plan9 CapabilitiesVMResponse_Resource = 3 - CapabilitiesVMResponse_VMNic CapabilitiesVMResponse_Resource = 4 - CapabilitiesVMResponse_Memory CapabilitiesVMResponse_Resource = 5 - CapabilitiesVMResponse_Processor CapabilitiesVMResponse_Resource = 6 -) - -// Enum value maps for CapabilitiesVMResponse_Resource. -var ( - CapabilitiesVMResponse_Resource_name = map[int32]string{ - 0: "Vpmem", - 1: "Scsi", - 2: "Vpci", - 3: "Plan9", - 4: "VMNic", - 5: "Memory", - 6: "Processor", - } - CapabilitiesVMResponse_Resource_value = map[string]int32{ - "Vpmem": 0, - "Scsi": 1, - "Vpci": 2, - "Plan9": 3, - "VMNic": 4, - "Memory": 5, - "Processor": 6, - } -) - -func (x CapabilitiesVMResponse_Resource) Enum() *CapabilitiesVMResponse_Resource { - p := new(CapabilitiesVMResponse_Resource) - *p = x - return p -} - -func (x CapabilitiesVMResponse_Resource) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CapabilitiesVMResponse_Resource) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[3].Descriptor() -} - -func (CapabilitiesVMResponse_Resource) Type() protoreflect.EnumType { - return &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[3] -} - -func (x CapabilitiesVMResponse_Resource) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CapabilitiesVMResponse_Resource.Descriptor instead. -func (CapabilitiesVMResponse_Resource) EnumDescriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{15, 0} -} - -type CapabilitiesVMResponse_SupportedGuestOS int32 - -const ( - CapabilitiesVMResponse_Windows CapabilitiesVMResponse_SupportedGuestOS = 0 - CapabilitiesVMResponse_Linux CapabilitiesVMResponse_SupportedGuestOS = 1 -) - -// Enum value maps for CapabilitiesVMResponse_SupportedGuestOS. -var ( - CapabilitiesVMResponse_SupportedGuestOS_name = map[int32]string{ - 0: "Windows", - 1: "Linux", - } - CapabilitiesVMResponse_SupportedGuestOS_value = map[string]int32{ - "Windows": 0, - "Linux": 1, - } -) - -func (x CapabilitiesVMResponse_SupportedGuestOS) Enum() *CapabilitiesVMResponse_SupportedGuestOS { - p := new(CapabilitiesVMResponse_SupportedGuestOS) - *p = x - return p -} - -func (x CapabilitiesVMResponse_SupportedGuestOS) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CapabilitiesVMResponse_SupportedGuestOS) Descriptor() protoreflect.EnumDescriptor { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[4].Descriptor() -} - -func (CapabilitiesVMResponse_SupportedGuestOS) Type() protoreflect.EnumType { - return &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes[4] -} - -func (x CapabilitiesVMResponse_SupportedGuestOS) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CapabilitiesVMResponse_SupportedGuestOS.Descriptor instead. -func (CapabilitiesVMResponse_SupportedGuestOS) EnumDescriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{15, 1} -} - -type DirectBoot struct { - state protoimpl.MessageState `protogen:"open.v1"` - KernelPath string `protobuf:"bytes,1,opt,name=kernel_path,json=kernelPath,proto3" json:"kernel_path,omitempty"` - InitrdPath string `protobuf:"bytes,2,opt,name=initrd_path,json=initrdPath,proto3" json:"initrd_path,omitempty"` - KernelCmdline string `protobuf:"bytes,3,opt,name=kernel_cmdline,json=kernelCmdline,proto3" json:"kernel_cmdline,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DirectBoot) Reset() { - *x = DirectBoot{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DirectBoot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DirectBoot) ProtoMessage() {} - -func (x *DirectBoot) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use DirectBoot.ProtoReflect.Descriptor instead. -func (*DirectBoot) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{0} -} - -func (x *DirectBoot) GetKernelPath() string { - if x != nil { - return x.KernelPath - } - return "" -} - -func (x *DirectBoot) GetInitrdPath() string { - if x != nil { - return x.InitrdPath - } - return "" -} - -func (x *DirectBoot) GetKernelCmdline() string { - if x != nil { - return x.KernelCmdline - } - return "" -} - -type UEFI struct { - state protoimpl.MessageState `protogen:"open.v1"` - FirmwarePath string `protobuf:"bytes,1,opt,name=firmware_path,json=firmwarePath,proto3" json:"firmware_path,omitempty"` - DevicePath string `protobuf:"bytes,2,opt,name=device_path,json=devicePath,proto3" json:"device_path,omitempty"` - // Optional data to include for uefi boot. For Linux this could be used as the kernel - // commandline. - OptionalData string `protobuf:"bytes,3,opt,name=optional_data,json=optionalData,proto3" json:"optional_data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UEFI) Reset() { - *x = UEFI{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UEFI) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UEFI) ProtoMessage() {} - -func (x *UEFI) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UEFI.ProtoReflect.Descriptor instead. -func (*UEFI) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{1} -} - -func (x *UEFI) GetFirmwarePath() string { - if x != nil { - return x.FirmwarePath - } - return "" -} - -func (x *UEFI) GetDevicePath() string { - if x != nil { - return x.DevicePath - } - return "" -} - -func (x *UEFI) GetOptionalData() string { - if x != nil { - return x.OptionalData - } - return "" -} - -type MemoryConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - MemoryMb uint64 `protobuf:"varint,1,opt,name=memory_mb,json=memoryMb,proto3" json:"memory_mb,omitempty"` - AllowOvercommit bool `protobuf:"varint,2,opt,name=allow_overcommit,json=allowOvercommit,proto3" json:"allow_overcommit,omitempty"` - DeferredCommit bool `protobuf:"varint,3,opt,name=deferred_commit,json=deferredCommit,proto3" json:"deferred_commit,omitempty"` - HotHint bool `protobuf:"varint,4,opt,name=hot_hint,json=hotHint,proto3" json:"hot_hint,omitempty"` - ColdHint bool `protobuf:"varint,5,opt,name=cold_hint,json=coldHint,proto3" json:"cold_hint,omitempty"` - ColdDiscardHint bool `protobuf:"varint,6,opt,name=cold_discard_hint,json=coldDiscardHint,proto3" json:"cold_discard_hint,omitempty"` - LowMmioGapInMb uint64 `protobuf:"varint,7,opt,name=low_mmio_gap_in_mb,json=lowMmioGapInMb,proto3" json:"low_mmio_gap_in_mb,omitempty"` - HighMmioBaseInMb uint64 `protobuf:"varint,8,opt,name=high_mmio_base_in_mb,json=highMmioBaseInMb,proto3" json:"high_mmio_base_in_mb,omitempty"` - HighMmioGapInMb uint64 `protobuf:"varint,9,opt,name=high_mmio_gap_in_mb,json=highMmioGapInMb,proto3" json:"high_mmio_gap_in_mb,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MemoryConfig) Reset() { - *x = MemoryConfig{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MemoryConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MemoryConfig) ProtoMessage() {} - -func (x *MemoryConfig) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MemoryConfig.ProtoReflect.Descriptor instead. -func (*MemoryConfig) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{2} -} - -func (x *MemoryConfig) GetMemoryMb() uint64 { - if x != nil { - return x.MemoryMb - } - return 0 -} - -func (x *MemoryConfig) GetAllowOvercommit() bool { - if x != nil { - return x.AllowOvercommit - } - return false -} - -func (x *MemoryConfig) GetDeferredCommit() bool { - if x != nil { - return x.DeferredCommit - } - return false -} - -func (x *MemoryConfig) GetHotHint() bool { - if x != nil { - return x.HotHint - } - return false -} - -func (x *MemoryConfig) GetColdHint() bool { - if x != nil { - return x.ColdHint - } - return false -} - -func (x *MemoryConfig) GetColdDiscardHint() bool { - if x != nil { - return x.ColdDiscardHint - } - return false -} - -func (x *MemoryConfig) GetLowMmioGapInMb() uint64 { - if x != nil { - return x.LowMmioGapInMb - } - return 0 -} - -func (x *MemoryConfig) GetHighMmioBaseInMb() uint64 { - if x != nil { - return x.HighMmioBaseInMb - } - return 0 -} - -func (x *MemoryConfig) GetHighMmioGapInMb() uint64 { - if x != nil { - return x.HighMmioGapInMb - } - return 0 -} - -type ProcessorConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProcessorCount uint32 `protobuf:"varint,1,opt,name=processor_count,json=processorCount,proto3" json:"processor_count,omitempty"` - ProcessorWeight uint32 `protobuf:"varint,2,opt,name=processor_weight,json=processorWeight,proto3" json:"processor_weight,omitempty"` - ProcessorLimit uint32 `protobuf:"varint,3,opt,name=processor_limit,json=processorLimit,proto3" json:"processor_limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProcessorConfig) Reset() { - *x = ProcessorConfig{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProcessorConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProcessorConfig) ProtoMessage() {} - -func (x *ProcessorConfig) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use ProcessorConfig.ProtoReflect.Descriptor instead. -func (*ProcessorConfig) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{3} -} - -func (x *ProcessorConfig) GetProcessorCount() uint32 { - if x != nil { - return x.ProcessorCount - } - return 0 -} - -func (x *ProcessorConfig) GetProcessorWeight() uint32 { - if x != nil { - return x.ProcessorWeight - } - return 0 -} - -func (x *ProcessorConfig) GetProcessorLimit() uint32 { - if x != nil { - return x.ProcessorLimit - } - return 0 -} - -type DevicesConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - ScsiDisks []*SCSIDisk `protobuf:"bytes,1,rep,name=scsi_disks,json=scsiDisks,proto3" json:"scsi_disks,omitempty"` - VpmemDisks []*VPMEMDisk `protobuf:"bytes,2,rep,name=vpmem_disks,json=vpmemDisks,proto3" json:"vpmem_disks,omitempty"` - NicConfig []*NICConfig `protobuf:"bytes,3,rep,name=nic_config,json=nicConfig,proto3" json:"nic_config,omitempty"` - WindowsDevice []*WindowsPCIDevice `protobuf:"bytes,4,rep,name=windows_device,json=windowsDevice,proto3" json:"windows_device,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DevicesConfig) Reset() { - *x = DevicesConfig{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DevicesConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DevicesConfig) ProtoMessage() {} - -func (x *DevicesConfig) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use DevicesConfig.ProtoReflect.Descriptor instead. -func (*DevicesConfig) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{4} -} - -func (x *DevicesConfig) GetScsiDisks() []*SCSIDisk { - if x != nil { - return x.ScsiDisks - } - return nil -} - -func (x *DevicesConfig) GetVpmemDisks() []*VPMEMDisk { - if x != nil { - return x.VpmemDisks - } - return nil -} - -func (x *DevicesConfig) GetNicConfig() []*NICConfig { - if x != nil { - return x.NicConfig - } - return nil -} - -func (x *DevicesConfig) GetWindowsDevice() []*WindowsPCIDevice { - if x != nil { - return x.WindowsDevice - } - return nil -} - -type VMConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - MemoryConfig *MemoryConfig `protobuf:"bytes,1,opt,name=memory_config,json=memoryConfig,proto3" json:"memory_config,omitempty"` - ProcessorConfig *ProcessorConfig `protobuf:"bytes,2,opt,name=processor_config,json=processorConfig,proto3" json:"processor_config,omitempty"` - DevicesConfig *DevicesConfig `protobuf:"bytes,3,opt,name=devices_config,json=devicesConfig,proto3" json:"devices_config,omitempty"` - SerialConfig *SerialConfig `protobuf:"bytes,4,opt,name=serial_config,json=serialConfig,proto3" json:"serial_config,omitempty"` - // Types that are valid to be assigned to BootConfig: - // - // *VMConfig_DirectBoot - // *VMConfig_Uefi - BootConfig isVMConfig_BootConfig `protobuf_oneof:"BootConfig"` - WindowsOptions *WindowsOptions `protobuf:"bytes,7,opt,name=windows_options,json=windowsOptions,proto3" json:"windows_options,omitempty"` - // Optional k:v extra data. Up to the virtstack for how to interpret this. - ExtraData map[string]string `protobuf:"bytes,8,rep,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VMConfig) Reset() { - *x = VMConfig{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VMConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VMConfig) ProtoMessage() {} - -func (x *VMConfig) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use VMConfig.ProtoReflect.Descriptor instead. -func (*VMConfig) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{5} -} - -func (x *VMConfig) GetMemoryConfig() *MemoryConfig { - if x != nil { - return x.MemoryConfig - } - return nil -} - -func (x *VMConfig) GetProcessorConfig() *ProcessorConfig { - if x != nil { - return x.ProcessorConfig - } - return nil -} - -func (x *VMConfig) GetDevicesConfig() *DevicesConfig { - if x != nil { - return x.DevicesConfig - } - return nil -} - -func (x *VMConfig) GetSerialConfig() *SerialConfig { - if x != nil { - return x.SerialConfig - } - return nil -} - -func (x *VMConfig) GetBootConfig() isVMConfig_BootConfig { - if x != nil { - return x.BootConfig - } - return nil -} - -func (x *VMConfig) GetDirectBoot() *DirectBoot { - if x != nil { - if x, ok := x.BootConfig.(*VMConfig_DirectBoot); ok { - return x.DirectBoot - } - } - return nil -} - -func (x *VMConfig) GetUefi() *UEFI { - if x != nil { - if x, ok := x.BootConfig.(*VMConfig_Uefi); ok { - return x.Uefi - } - } - return nil -} - -func (x *VMConfig) GetWindowsOptions() *WindowsOptions { - if x != nil { - return x.WindowsOptions - } - return nil -} - -func (x *VMConfig) GetExtraData() map[string]string { - if x != nil { - return x.ExtraData - } - return nil -} - -type isVMConfig_BootConfig interface { - isVMConfig_BootConfig() -} - -type VMConfig_DirectBoot struct { - DirectBoot *DirectBoot `protobuf:"bytes,5,opt,name=direct_boot,json=directBoot,proto3,oneof"` -} - -type VMConfig_Uefi struct { - Uefi *UEFI `protobuf:"bytes,6,opt,name=uefi,proto3,oneof"` -} - -func (*VMConfig_DirectBoot) isVMConfig_BootConfig() {} - -func (*VMConfig_Uefi) isVMConfig_BootConfig() {} - -// WindowsOptions contains virtual machine configurations that are only present on a Windows host. -type WindowsOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - CpuGroupID uint64 `protobuf:"varint,1,opt,name=cpu_group_id,json=cpuGroupId,proto3" json:"cpu_group_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WindowsOptions) Reset() { - *x = WindowsOptions{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WindowsOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WindowsOptions) ProtoMessage() {} - -func (x *WindowsOptions) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use WindowsOptions.ProtoReflect.Descriptor instead. -func (*WindowsOptions) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{6} -} - -func (x *WindowsOptions) GetCpuGroupID() uint64 { - if x != nil { - return x.CpuGroupID - } - return 0 -} - -type SerialConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - Ports []*SerialConfig_Config `protobuf:"bytes,3,rep,name=ports,proto3" json:"ports,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SerialConfig) Reset() { - *x = SerialConfig{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SerialConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SerialConfig) ProtoMessage() {} - -func (x *SerialConfig) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use SerialConfig.ProtoReflect.Descriptor instead. -func (*SerialConfig) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{7} -} - -func (x *SerialConfig) GetPorts() []*SerialConfig_Config { - if x != nil { - return x.Ports - } - return nil -} - -type CreateVMRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Config *VMConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - // Optional ID to be used by the VM service in log messages. It's up to the - // virtstack to make use of this field. Useful for debugging to be able to - // correlate events for a given vm that the client launched. - LogID string `protobuf:"bytes,2,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateVMRequest) Reset() { - *x = CreateVMRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateVMRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateVMRequest) ProtoMessage() {} - -func (x *CreateVMRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use CreateVMRequest.ProtoReflect.Descriptor instead. -func (*CreateVMRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{8} -} - -func (x *CreateVMRequest) GetConfig() *VMConfig { - if x != nil { - return x.Config - } - return nil -} - -func (x *CreateVMRequest) GetLogID() string { - if x != nil { - return x.LogID - } - return "" -} - -type InspectVMRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - RecursionLimit uint32 `protobuf:"varint,2,opt,name=recursion_limit,json=recursionLimit,proto3" json:"recursion_limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InspectVMRequest) Reset() { - *x = InspectVMRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InspectVMRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InspectVMRequest) ProtoMessage() {} - -func (x *InspectVMRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use InspectVMRequest.ProtoReflect.Descriptor instead. -func (*InspectVMRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{9} -} - -func (x *InspectVMRequest) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *InspectVMRequest) GetRecursionLimit() uint32 { - if x != nil { - return x.RecursionLimit - } - return 0 -} - -type InspectVMResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Result *structpb.Value `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *InspectVMResponse) Reset() { - *x = InspectVMResponse{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *InspectVMResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InspectVMResponse) ProtoMessage() {} - -func (x *InspectVMResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use InspectVMResponse.ProtoReflect.Descriptor instead. -func (*InspectVMResponse) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{10} -} - -func (x *InspectVMResponse) GetResult() *structpb.Value { - if x != nil { - return x.Result - } - return nil -} - -type MemoryStats struct { - state protoimpl.MessageState `protogen:"open.v1"` - WorkingSetBytes uint64 `protobuf:"varint,1,opt,name=working_set_bytes,json=workingSetBytes,proto3" json:"working_set_bytes,omitempty"` - AvailableMemory uint64 `protobuf:"varint,2,opt,name=available_memory,json=availableMemory,proto3" json:"available_memory,omitempty"` - ReservedMemory uint64 `protobuf:"varint,3,opt,name=reserved_memory,json=reservedMemory,proto3" json:"reserved_memory,omitempty"` - AssignedMemory uint64 `protobuf:"varint,4,opt,name=assigned_memory,json=assignedMemory,proto3" json:"assigned_memory,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MemoryStats) Reset() { - *x = MemoryStats{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MemoryStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MemoryStats) ProtoMessage() {} - -func (x *MemoryStats) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use MemoryStats.ProtoReflect.Descriptor instead. -func (*MemoryStats) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{11} -} - -func (x *MemoryStats) GetWorkingSetBytes() uint64 { - if x != nil { - return x.WorkingSetBytes - } - return 0 -} - -func (x *MemoryStats) GetAvailableMemory() uint64 { - if x != nil { - return x.AvailableMemory - } - return 0 -} - -func (x *MemoryStats) GetReservedMemory() uint64 { - if x != nil { - return x.ReservedMemory - } - return 0 -} - -func (x *MemoryStats) GetAssignedMemory() uint64 { - if x != nil { - return x.AssignedMemory - } - return 0 -} - -type ProcessorStats struct { - state protoimpl.MessageState `protogen:"open.v1"` - TotalRuntimeNs uint64 `protobuf:"varint,1,opt,name=total_runtime_ns,json=totalRuntimeNs,proto3" json:"total_runtime_ns,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProcessorStats) Reset() { - *x = ProcessorStats{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProcessorStats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProcessorStats) ProtoMessage() {} - -func (x *ProcessorStats) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use ProcessorStats.ProtoReflect.Descriptor instead. -func (*ProcessorStats) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{12} -} - -func (x *ProcessorStats) GetTotalRuntimeNs() uint64 { - if x != nil { - return x.TotalRuntimeNs - } - return 0 -} - -type PropertiesVMRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Types []PropertiesVMRequest_PropertiesType `protobuf:"varint,1,rep,packed,name=types,proto3,enum=vmservice.PropertiesVMRequest_PropertiesType" json:"types,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PropertiesVMRequest) Reset() { - *x = PropertiesVMRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PropertiesVMRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PropertiesVMRequest) ProtoMessage() {} - -func (x *PropertiesVMRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use PropertiesVMRequest.ProtoReflect.Descriptor instead. -func (*PropertiesVMRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{13} -} - -func (x *PropertiesVMRequest) GetTypes() []PropertiesVMRequest_PropertiesType { - if x != nil { - return x.Types - } - return nil -} - -type PropertiesVMResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - MemoryStats *MemoryStats `protobuf:"bytes,1,opt,name=memory_stats,json=memoryStats,proto3" json:"memory_stats,omitempty"` - ProcessorStats *ProcessorStats `protobuf:"bytes,2,opt,name=processor_stats,json=processorStats,proto3" json:"processor_stats,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PropertiesVMResponse) Reset() { - *x = PropertiesVMResponse{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PropertiesVMResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PropertiesVMResponse) ProtoMessage() {} - -func (x *PropertiesVMResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_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) -} - -// Deprecated: Use PropertiesVMResponse.ProtoReflect.Descriptor instead. -func (*PropertiesVMResponse) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{14} -} - -func (x *PropertiesVMResponse) GetMemoryStats() *MemoryStats { - if x != nil { - return x.MemoryStats - } - return nil -} - -func (x *PropertiesVMResponse) GetProcessorStats() *ProcessorStats { - if x != nil { - return x.ProcessorStats - } - return nil -} - -type CapabilitiesVMResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - SupportedResources []*CapabilitiesVMResponse_SupportedResource `protobuf:"bytes,1,rep,name=supported_resources,json=supportedResources,proto3" json:"supported_resources,omitempty"` - SupportedGuestOS []CapabilitiesVMResponse_SupportedGuestOS `protobuf:"varint,2,rep,packed,name=supported_guest_os,json=supportedGuestOs,proto3,enum=vmservice.CapabilitiesVMResponse_SupportedGuestOS" json:"supported_guest_os,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CapabilitiesVMResponse) Reset() { - *x = CapabilitiesVMResponse{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CapabilitiesVMResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CapabilitiesVMResponse) ProtoMessage() {} - -func (x *CapabilitiesVMResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CapabilitiesVMResponse.ProtoReflect.Descriptor instead. -func (*CapabilitiesVMResponse) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{15} -} - -func (x *CapabilitiesVMResponse) GetSupportedResources() []*CapabilitiesVMResponse_SupportedResource { - if x != nil { - return x.SupportedResources - } - return nil -} - -func (x *CapabilitiesVMResponse) GetSupportedGuestOS() []CapabilitiesVMResponse_SupportedGuestOS { - if x != nil { - return x.SupportedGuestOS - } - return nil -} - -type HVSocketListen struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` - // Expected that the listener is a unix domain socket. These - // are supported on Windows as of 1809/RS5. - ListenerPath string `protobuf:"bytes,2,opt,name=listener_path,json=listenerPath,proto3" json:"listener_path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *HVSocketListen) Reset() { - *x = HVSocketListen{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *HVSocketListen) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HVSocketListen) ProtoMessage() {} - -func (x *HVSocketListen) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HVSocketListen.ProtoReflect.Descriptor instead. -func (*HVSocketListen) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{16} -} - -func (x *HVSocketListen) GetServiceID() string { - if x != nil { - return x.ServiceID - } - return "" -} - -func (x *HVSocketListen) GetListenerPath() string { - if x != nil { - return x.ListenerPath - } - return "" -} - -type VSockListen struct { - state protoimpl.MessageState `protogen:"open.v1"` - Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` - ListenerPath string `protobuf:"bytes,2,opt,name=listener_path,json=listenerPath,proto3" json:"listener_path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VSockListen) Reset() { - *x = VSockListen{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VSockListen) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VSockListen) ProtoMessage() {} - -func (x *VSockListen) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VSockListen.ProtoReflect.Descriptor instead. -func (*VSockListen) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{17} -} - -func (x *VSockListen) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *VSockListen) GetListenerPath() string { - if x != nil { - return x.ListenerPath - } - return "" -} - -type VMSocketRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type ModifyType `protobuf:"varint,1,opt,name=type,proto3,enum=vmservice.ModifyType" json:"type,omitempty"` - // Types that are valid to be assigned to Config: - // - // *VMSocketRequest_HvsocketList - // *VMSocketRequest_VsockListen - Config isVMSocketRequest_Config `protobuf_oneof:"Config"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VMSocketRequest) Reset() { - *x = VMSocketRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VMSocketRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VMSocketRequest) ProtoMessage() {} - -func (x *VMSocketRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VMSocketRequest.ProtoReflect.Descriptor instead. -func (*VMSocketRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{18} -} - -func (x *VMSocketRequest) GetType() ModifyType { - if x != nil { - return x.Type - } - return ModifyType_ADD -} - -func (x *VMSocketRequest) GetConfig() isVMSocketRequest_Config { - if x != nil { - return x.Config - } - return nil -} - -func (x *VMSocketRequest) GetHvsocketList() *HVSocketListen { - if x != nil { - if x, ok := x.Config.(*VMSocketRequest_HvsocketList); ok { - return x.HvsocketList - } - } - return nil -} - -func (x *VMSocketRequest) GetVsockListen() *VSockListen { - if x != nil { - if x, ok := x.Config.(*VMSocketRequest_VsockListen); ok { - return x.VsockListen - } - } - return nil -} - -type isVMSocketRequest_Config interface { - isVMSocketRequest_Config() -} - -type VMSocketRequest_HvsocketList struct { - HvsocketList *HVSocketListen `protobuf:"bytes,2,opt,name=hvsocket_list,json=hvsocketList,proto3,oneof"` -} - -type VMSocketRequest_VsockListen struct { - VsockListen *VSockListen `protobuf:"bytes,3,opt,name=vsock_listen,json=vsockListen,proto3,oneof"` -} - -func (*VMSocketRequest_HvsocketList) isVMSocketRequest_Config() {} - -func (*VMSocketRequest_VsockListen) isVMSocketRequest_Config() {} - -type SCSIDisk struct { - state protoimpl.MessageState `protogen:"open.v1"` - Controller uint32 `protobuf:"varint,1,opt,name=controller,proto3" json:"controller,omitempty"` - Lun uint32 `protobuf:"varint,2,opt,name=lun,proto3" json:"lun,omitempty"` - HostPath string `protobuf:"bytes,3,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` - Type DiskType `protobuf:"varint,4,opt,name=type,proto3,enum=vmservice.DiskType" json:"type,omitempty"` - ReadOnly bool `protobuf:"varint,5,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SCSIDisk) Reset() { - *x = SCSIDisk{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SCSIDisk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SCSIDisk) ProtoMessage() {} - -func (x *SCSIDisk) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[19] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SCSIDisk.ProtoReflect.Descriptor instead. -func (*SCSIDisk) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{19} -} - -func (x *SCSIDisk) GetController() uint32 { - if x != nil { - return x.Controller - } - return 0 -} - -func (x *SCSIDisk) GetLun() uint32 { - if x != nil { - return x.Lun - } - return 0 -} - -func (x *SCSIDisk) GetHostPath() string { - if x != nil { - return x.HostPath - } - return "" -} - -func (x *SCSIDisk) GetType() DiskType { - if x != nil { - return x.Type - } - return DiskType_SCSI_DISK_TYPE_VHD1 -} - -func (x *SCSIDisk) GetReadOnly() bool { - if x != nil { - return x.ReadOnly - } - return false -} - -type VPMEMDisk struct { - state protoimpl.MessageState `protogen:"open.v1"` - HostPath string `protobuf:"bytes,1,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` - Type DiskType `protobuf:"varint,2,opt,name=type,proto3,enum=vmservice.DiskType" json:"type,omitempty"` - ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *VPMEMDisk) Reset() { - *x = VPMEMDisk{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VPMEMDisk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VPMEMDisk) ProtoMessage() {} - -func (x *VPMEMDisk) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VPMEMDisk.ProtoReflect.Descriptor instead. -func (*VPMEMDisk) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{20} -} - -func (x *VPMEMDisk) GetHostPath() string { - if x != nil { - return x.HostPath - } - return "" -} - -func (x *VPMEMDisk) GetType() DiskType { - if x != nil { - return x.Type - } - return DiskType_SCSI_DISK_TYPE_VHD1 -} - -func (x *VPMEMDisk) GetReadOnly() bool { - if x != nil { - return x.ReadOnly - } - return false -} - -type NICConfig struct { - state protoimpl.MessageState `protogen:"open.v1"` - NicID string `protobuf:"bytes,1,opt,name=nic_id,json=nicId,proto3" json:"nic_id,omitempty"` // GUID - PortID string `protobuf:"bytes,2,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` // GUID - MacAddress string `protobuf:"bytes,3,opt,name=mac_address,json=macAddress,proto3" json:"mac_address,omitempty"` // 12-34-56-78-9A-BC - SwitchID string `protobuf:"bytes,4,opt,name=switch_id,json=switchId,proto3" json:"switch_id,omitempty"` // GUID - // Optional friendly name for the adapter. Might be useful to show up in logs. - NicName string `protobuf:"bytes,5,opt,name=nic_name,json=nicName,proto3" json:"nic_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NICConfig) Reset() { - *x = NICConfig{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NICConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NICConfig) ProtoMessage() {} - -func (x *NICConfig) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NICConfig.ProtoReflect.Descriptor instead. -func (*NICConfig) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{21} -} - -func (x *NICConfig) GetNicID() string { - if x != nil { - return x.NicID - } - return "" -} - -func (x *NICConfig) GetPortID() string { - if x != nil { - return x.PortID - } - return "" -} - -func (x *NICConfig) GetMacAddress() string { - if x != nil { - return x.MacAddress - } - return "" -} - -func (x *NICConfig) GetSwitchID() string { - if x != nil { - return x.SwitchID - } - return "" -} - -func (x *NICConfig) GetNicName() string { - if x != nil { - return x.NicName - } - return "" -} - -type WindowsPCIDevice struct { - state protoimpl.MessageState `protogen:"open.v1"` - // e.g. PCIP\\VEN_10DE&DEV_13F2&SUBSYS_115E10DE&REV_A1\\6&17F903&0&00400000 - InstanceID string `protobuf:"bytes,1,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WindowsPCIDevice) Reset() { - *x = WindowsPCIDevice{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WindowsPCIDevice) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WindowsPCIDevice) ProtoMessage() {} - -func (x *WindowsPCIDevice) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WindowsPCIDevice.ProtoReflect.Descriptor instead. -func (*WindowsPCIDevice) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{22} -} - -func (x *WindowsPCIDevice) GetInstanceID() string { - if x != nil { - return x.InstanceID - } - return "" -} - -type ModifyMemoryRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - MemoryMb uint64 `protobuf:"varint,1,opt,name=memory_mb,json=memoryMb,proto3" json:"memory_mb,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ModifyMemoryRequest) Reset() { - *x = ModifyMemoryRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ModifyMemoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModifyMemoryRequest) ProtoMessage() {} - -func (x *ModifyMemoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModifyMemoryRequest.ProtoReflect.Descriptor instead. -func (*ModifyMemoryRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{23} -} - -func (x *ModifyMemoryRequest) GetMemoryMb() uint64 { - if x != nil { - return x.MemoryMb - } - return 0 -} - -type ModifyProcessorRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Index of the processor to add/remove - ProcessorIndex uint32 `protobuf:"varint,1,opt,name=processor_index,json=processorIndex,proto3" json:"processor_index,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ModifyProcessorRequest) Reset() { - *x = ModifyProcessorRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ModifyProcessorRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModifyProcessorRequest) ProtoMessage() {} - -func (x *ModifyProcessorRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[24] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModifyProcessorRequest.ProtoReflect.Descriptor instead. -func (*ModifyProcessorRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{24} -} - -func (x *ModifyProcessorRequest) GetProcessorIndex() uint32 { - if x != nil { - return x.ProcessorIndex - } - return 0 -} - -type ModifyProcessorConfigRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProcessorWeight uint32 `protobuf:"varint,1,opt,name=processor_weight,json=processorWeight,proto3" json:"processor_weight,omitempty"` - ProcessorLimit uint32 `protobuf:"varint,2,opt,name=processor_limit,json=processorLimit,proto3" json:"processor_limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ModifyProcessorConfigRequest) Reset() { - *x = ModifyProcessorConfigRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ModifyProcessorConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModifyProcessorConfigRequest) ProtoMessage() {} - -func (x *ModifyProcessorConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[25] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModifyProcessorConfigRequest.ProtoReflect.Descriptor instead. -func (*ModifyProcessorConfigRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{25} -} - -func (x *ModifyProcessorConfigRequest) GetProcessorWeight() uint32 { - if x != nil { - return x.ProcessorWeight - } - return 0 -} - -func (x *ModifyProcessorConfigRequest) GetProcessorLimit() uint32 { - if x != nil { - return x.ProcessorLimit - } - return 0 -} - -type ModifyResourceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type ModifyType `protobuf:"varint,1,opt,name=type,proto3,enum=vmservice.ModifyType" json:"type,omitempty"` - // Types that are valid to be assigned to Resource: - // - // *ModifyResourceRequest_Processor - // *ModifyResourceRequest_ProcessorConfig - // *ModifyResourceRequest_Memory - // *ModifyResourceRequest_ScsiDisk - // *ModifyResourceRequest_VpmemDisk - // *ModifyResourceRequest_NicConfig - // *ModifyResourceRequest_WindowsDevice - Resource isModifyResourceRequest_Resource `protobuf_oneof:"resource"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ModifyResourceRequest) Reset() { - *x = ModifyResourceRequest{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ModifyResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModifyResourceRequest) ProtoMessage() {} - -func (x *ModifyResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[26] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModifyResourceRequest.ProtoReflect.Descriptor instead. -func (*ModifyResourceRequest) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{26} -} - -func (x *ModifyResourceRequest) GetType() ModifyType { - if x != nil { - return x.Type - } - return ModifyType_ADD -} - -func (x *ModifyResourceRequest) GetResource() isModifyResourceRequest_Resource { - if x != nil { - return x.Resource - } - return nil -} - -func (x *ModifyResourceRequest) GetProcessor() *ModifyProcessorRequest { - if x != nil { - if x, ok := x.Resource.(*ModifyResourceRequest_Processor); ok { - return x.Processor - } - } - return nil -} - -func (x *ModifyResourceRequest) GetProcessorConfig() *ModifyProcessorConfigRequest { - if x != nil { - if x, ok := x.Resource.(*ModifyResourceRequest_ProcessorConfig); ok { - return x.ProcessorConfig - } - } - return nil -} - -func (x *ModifyResourceRequest) GetMemory() *ModifyMemoryRequest { - if x != nil { - if x, ok := x.Resource.(*ModifyResourceRequest_Memory); ok { - return x.Memory - } - } - return nil -} - -func (x *ModifyResourceRequest) GetScsiDisk() *SCSIDisk { - if x != nil { - if x, ok := x.Resource.(*ModifyResourceRequest_ScsiDisk); ok { - return x.ScsiDisk - } - } - return nil -} - -func (x *ModifyResourceRequest) GetVpmemDisk() *VPMEMDisk { - if x != nil { - if x, ok := x.Resource.(*ModifyResourceRequest_VpmemDisk); ok { - return x.VpmemDisk - } - } - return nil -} - -func (x *ModifyResourceRequest) GetNicConfig() *NICConfig { - if x != nil { - if x, ok := x.Resource.(*ModifyResourceRequest_NicConfig); ok { - return x.NicConfig - } - } - return nil -} - -func (x *ModifyResourceRequest) GetWindowsDevice() *WindowsPCIDevice { - if x != nil { - if x, ok := x.Resource.(*ModifyResourceRequest_WindowsDevice); ok { - return x.WindowsDevice - } - } - return nil -} - -type isModifyResourceRequest_Resource interface { - isModifyResourceRequest_Resource() -} - -type ModifyResourceRequest_Processor struct { - Processor *ModifyProcessorRequest `protobuf:"bytes,2,opt,name=processor,proto3,oneof"` -} - -type ModifyResourceRequest_ProcessorConfig struct { - ProcessorConfig *ModifyProcessorConfigRequest `protobuf:"bytes,3,opt,name=processor_config,json=processorConfig,proto3,oneof"` -} - -type ModifyResourceRequest_Memory struct { - Memory *ModifyMemoryRequest `protobuf:"bytes,4,opt,name=memory,proto3,oneof"` -} - -type ModifyResourceRequest_ScsiDisk struct { - ScsiDisk *SCSIDisk `protobuf:"bytes,5,opt,name=scsi_disk,json=scsiDisk,proto3,oneof"` -} - -type ModifyResourceRequest_VpmemDisk struct { - VpmemDisk *VPMEMDisk `protobuf:"bytes,6,opt,name=vpmem_disk,json=vpmemDisk,proto3,oneof"` -} - -type ModifyResourceRequest_NicConfig struct { - NicConfig *NICConfig `protobuf:"bytes,7,opt,name=nic_config,json=nicConfig,proto3,oneof"` -} - -type ModifyResourceRequest_WindowsDevice struct { - WindowsDevice *WindowsPCIDevice `protobuf:"bytes,8,opt,name=windows_device,json=windowsDevice,proto3,oneof"` -} - -func (*ModifyResourceRequest_Processor) isModifyResourceRequest_Resource() {} - -func (*ModifyResourceRequest_ProcessorConfig) isModifyResourceRequest_Resource() {} - -func (*ModifyResourceRequest_Memory) isModifyResourceRequest_Resource() {} - -func (*ModifyResourceRequest_ScsiDisk) isModifyResourceRequest_Resource() {} - -func (*ModifyResourceRequest_VpmemDisk) isModifyResourceRequest_Resource() {} - -func (*ModifyResourceRequest_NicConfig) isModifyResourceRequest_Resource() {} - -func (*ModifyResourceRequest_WindowsDevice) isModifyResourceRequest_Resource() {} - -type SerialConfig_Config struct { - state protoimpl.MessageState `protogen:"open.v1"` - Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` - // Unix domain socket to relay serial console output to. - SocketPath string `protobuf:"bytes,2,opt,name=socket_path,json=socketPath,proto3" json:"socket_path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SerialConfig_Config) Reset() { - *x = SerialConfig_Config{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SerialConfig_Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SerialConfig_Config) ProtoMessage() {} - -func (x *SerialConfig_Config) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[28] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SerialConfig_Config.ProtoReflect.Descriptor instead. -func (*SerialConfig_Config) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *SerialConfig_Config) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *SerialConfig_Config) GetSocketPath() string { - if x != nil { - return x.SocketPath - } - return "" -} - -type CapabilitiesVMResponse_SupportedResource struct { - state protoimpl.MessageState `protogen:"open.v1"` - Add bool `protobuf:"varint,1,opt,name=Add,proto3" json:"Add,omitempty"` - Remove bool `protobuf:"varint,2,opt,name=Remove,proto3" json:"Remove,omitempty"` - Update bool `protobuf:"varint,3,opt,name=Update,proto3" json:"Update,omitempty"` - Resource CapabilitiesVMResponse_Resource `protobuf:"varint,4,opt,name=resource,proto3,enum=vmservice.CapabilitiesVMResponse_Resource" json:"resource,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CapabilitiesVMResponse_SupportedResource) Reset() { - *x = CapabilitiesVMResponse_SupportedResource{} - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CapabilitiesVMResponse_SupportedResource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CapabilitiesVMResponse_SupportedResource) ProtoMessage() {} - -func (x *CapabilitiesVMResponse_SupportedResource) ProtoReflect() protoreflect.Message { - mi := &file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[29] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CapabilitiesVMResponse_SupportedResource.ProtoReflect.Descriptor instead. -func (*CapabilitiesVMResponse_SupportedResource) Descriptor() ([]byte, []int) { - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP(), []int{15, 0} -} - -func (x *CapabilitiesVMResponse_SupportedResource) GetAdd() bool { - if x != nil { - return x.Add - } - return false -} - -func (x *CapabilitiesVMResponse_SupportedResource) GetRemove() bool { - if x != nil { - return x.Remove - } - return false -} - -func (x *CapabilitiesVMResponse_SupportedResource) GetUpdate() bool { - if x != nil { - return x.Update - } - return false -} - -func (x *CapabilitiesVMResponse_SupportedResource) GetResource() CapabilitiesVMResponse_Resource { - if x != nil { - return x.Resource - } - return CapabilitiesVMResponse_Vpmem -} - -var File_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto protoreflect.FileDescriptor - -const file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDesc = "" + - "\n" + - "?github.com/Microsoft/hcsshim/internal/vmservice/vmservice.proto\x12\tvmservice\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1cgoogle/protobuf/struct.proto\"u\n" + - "\n" + - "DirectBoot\x12\x1f\n" + - "\vkernel_path\x18\x01 \x01(\tR\n" + - "kernelPath\x12\x1f\n" + - "\vinitrd_path\x18\x02 \x01(\tR\n" + - "initrdPath\x12%\n" + - "\x0ekernel_cmdline\x18\x03 \x01(\tR\rkernelCmdline\"q\n" + - "\x04UEFI\x12#\n" + - "\rfirmware_path\x18\x01 \x01(\tR\ffirmwarePath\x12\x1f\n" + - "\vdevice_path\x18\x02 \x01(\tR\n" + - "devicePath\x12#\n" + - "\roptional_data\x18\x03 \x01(\tR\foptionalData\"\xed\x02\n" + - "\fMemoryConfig\x12\x1b\n" + - "\tmemory_mb\x18\x01 \x01(\x04R\bmemoryMb\x12)\n" + - "\x10allow_overcommit\x18\x02 \x01(\bR\x0fallowOvercommit\x12'\n" + - "\x0fdeferred_commit\x18\x03 \x01(\bR\x0edeferredCommit\x12\x19\n" + - "\bhot_hint\x18\x04 \x01(\bR\ahotHint\x12\x1b\n" + - "\tcold_hint\x18\x05 \x01(\bR\bcoldHint\x12*\n" + - "\x11cold_discard_hint\x18\x06 \x01(\bR\x0fcoldDiscardHint\x12*\n" + - "\x12low_mmio_gap_in_mb\x18\a \x01(\x04R\x0elowMmioGapInMb\x12.\n" + - "\x14high_mmio_base_in_mb\x18\b \x01(\x04R\x10highMmioBaseInMb\x12,\n" + - "\x13high_mmio_gap_in_mb\x18\t \x01(\x04R\x0fhighMmioGapInMb\"\x8e\x01\n" + - "\x0fProcessorConfig\x12'\n" + - "\x0fprocessor_count\x18\x01 \x01(\rR\x0eprocessorCount\x12)\n" + - "\x10processor_weight\x18\x02 \x01(\rR\x0fprocessorWeight\x12'\n" + - "\x0fprocessor_limit\x18\x03 \x01(\rR\x0eprocessorLimit\"\xf3\x01\n" + - "\rDevicesConfig\x122\n" + - "\n" + - "scsi_disks\x18\x01 \x03(\v2\x13.vmservice.SCSIDiskR\tscsiDisks\x125\n" + - "\vvpmem_disks\x18\x02 \x03(\v2\x14.vmservice.VPMEMDiskR\n" + - "vpmemDisks\x123\n" + - "\n" + - "nic_config\x18\x03 \x03(\v2\x14.vmservice.NICConfigR\tnicConfig\x12B\n" + - "\x0ewindows_device\x18\x04 \x03(\v2\x1b.vmservice.WindowsPCIDeviceR\rwindowsDevice\"\xc2\x04\n" + - "\bVMConfig\x12<\n" + - "\rmemory_config\x18\x01 \x01(\v2\x17.vmservice.MemoryConfigR\fmemoryConfig\x12E\n" + - "\x10processor_config\x18\x02 \x01(\v2\x1a.vmservice.ProcessorConfigR\x0fprocessorConfig\x12?\n" + - "\x0edevices_config\x18\x03 \x01(\v2\x18.vmservice.DevicesConfigR\rdevicesConfig\x12<\n" + - "\rserial_config\x18\x04 \x01(\v2\x17.vmservice.SerialConfigR\fserialConfig\x128\n" + - "\vdirect_boot\x18\x05 \x01(\v2\x15.vmservice.DirectBootH\x00R\n" + - "directBoot\x12%\n" + - "\x04uefi\x18\x06 \x01(\v2\x0f.vmservice.UEFIH\x00R\x04uefi\x12B\n" + - "\x0fwindows_options\x18\a \x01(\v2\x19.vmservice.WindowsOptionsR\x0ewindowsOptions\x12A\n" + - "\n" + - "extra_data\x18\b \x03(\v2\".vmservice.VMConfig.ExtraDataEntryR\textraData\x1a<\n" + - "\x0eExtraDataEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\f\n" + - "\n" + - "BootConfig\"2\n" + - "\x0eWindowsOptions\x12 \n" + - "\fcpu_group_id\x18\x01 \x01(\x04R\n" + - "cpuGroupId\"\x83\x01\n" + - "\fSerialConfig\x124\n" + - "\x05ports\x18\x03 \x03(\v2\x1e.vmservice.SerialConfig.ConfigR\x05ports\x1a=\n" + - "\x06Config\x12\x12\n" + - "\x04port\x18\x01 \x01(\rR\x04port\x12\x1f\n" + - "\vsocket_path\x18\x02 \x01(\tR\n" + - "socketPath\"U\n" + - "\x0fCreateVMRequest\x12+\n" + - "\x06config\x18\x01 \x01(\v2\x13.vmservice.VMConfigR\x06config\x12\x15\n" + - "\x06log_id\x18\x02 \x01(\tR\x05logId\"Q\n" + - "\x10InspectVMRequest\x12\x14\n" + - "\x05query\x18\x01 \x01(\tR\x05query\x12'\n" + - "\x0frecursion_limit\x18\x02 \x01(\rR\x0erecursionLimit\"C\n" + - "\x11InspectVMResponse\x12.\n" + - "\x06result\x18\x01 \x01(\v2\x16.google.protobuf.ValueR\x06result\"\xb6\x01\n" + - "\vMemoryStats\x12*\n" + - "\x11working_set_bytes\x18\x01 \x01(\x04R\x0fworkingSetBytes\x12)\n" + - "\x10available_memory\x18\x02 \x01(\x04R\x0favailableMemory\x12'\n" + - "\x0freserved_memory\x18\x03 \x01(\x04R\x0ereservedMemory\x12'\n" + - "\x0fassigned_memory\x18\x04 \x01(\x04R\x0eassignedMemory\":\n" + - "\x0eProcessorStats\x12(\n" + - "\x10total_runtime_ns\x18\x01 \x01(\x04R\x0etotalRuntimeNs\"\x87\x01\n" + - "\x13PropertiesVMRequest\x12C\n" + - "\x05types\x18\x01 \x03(\x0e2-.vmservice.PropertiesVMRequest.PropertiesTypeR\x05types\"+\n" + - "\x0ePropertiesType\x12\n" + - "\n" + - "\x06Memory\x10\x00\x12\r\n" + - "\tProcessor\x10\x01\"\x95\x01\n" + - "\x14PropertiesVMResponse\x129\n" + - "\fmemory_stats\x18\x01 \x01(\v2\x16.vmservice.MemoryStatsR\vmemoryStats\x12B\n" + - "\x0fprocessor_stats\x18\x02 \x01(\v2\x19.vmservice.ProcessorStatsR\x0eprocessorStats\"\x88\x04\n" + - "\x16CapabilitiesVMResponse\x12d\n" + - "\x13supported_resources\x18\x01 \x03(\v23.vmservice.CapabilitiesVMResponse.SupportedResourceR\x12supportedResources\x12`\n" + - "\x12supported_guest_os\x18\x02 \x03(\x0e22.vmservice.CapabilitiesVMResponse.SupportedGuestOSR\x10supportedGuestOs\x1a\x9d\x01\n" + - "\x11SupportedResource\x12\x10\n" + - "\x03Add\x18\x01 \x01(\bR\x03Add\x12\x16\n" + - "\x06Remove\x18\x02 \x01(\bR\x06Remove\x12\x16\n" + - "\x06Update\x18\x03 \x01(\bR\x06Update\x12F\n" + - "\bresource\x18\x04 \x01(\x0e2*.vmservice.CapabilitiesVMResponse.ResourceR\bresource\"Z\n" + - "\bResource\x12\t\n" + - "\x05Vpmem\x10\x00\x12\b\n" + - "\x04Scsi\x10\x01\x12\b\n" + - "\x04Vpci\x10\x02\x12\t\n" + - "\x05Plan9\x10\x03\x12\t\n" + - "\x05VMNic\x10\x04\x12\n" + - "\n" + - "\x06Memory\x10\x05\x12\r\n" + - "\tProcessor\x10\x06\"*\n" + - "\x10SupportedGuestOS\x12\v\n" + - "\aWindows\x10\x00\x12\t\n" + - "\x05Linux\x10\x01\"T\n" + - "\x0eHVSocketListen\x12\x1d\n" + - "\n" + - "service_id\x18\x01 \x01(\tR\tserviceId\x12#\n" + - "\rlistener_path\x18\x02 \x01(\tR\flistenerPath\"F\n" + - "\vVSockListen\x12\x12\n" + - "\x04port\x18\x01 \x01(\rR\x04port\x12#\n" + - "\rlistener_path\x18\x02 \x01(\tR\flistenerPath\"\xc5\x01\n" + - "\x0fVMSocketRequest\x12)\n" + - "\x04type\x18\x01 \x01(\x0e2\x15.vmservice.ModifyTypeR\x04type\x12@\n" + - "\rhvsocket_list\x18\x02 \x01(\v2\x19.vmservice.HVSocketListenH\x00R\fhvsocketList\x12;\n" + - "\fvsock_listen\x18\x03 \x01(\v2\x16.vmservice.VSockListenH\x00R\vvsockListenB\b\n" + - "\x06Config\"\x9f\x01\n" + - "\bSCSIDisk\x12\x1e\n" + - "\n" + - "controller\x18\x01 \x01(\rR\n" + - "controller\x12\x10\n" + - "\x03lun\x18\x02 \x01(\rR\x03lun\x12\x1b\n" + - "\thost_path\x18\x03 \x01(\tR\bhostPath\x12'\n" + - "\x04type\x18\x04 \x01(\x0e2\x13.vmservice.DiskTypeR\x04type\x12\x1b\n" + - "\tread_only\x18\x05 \x01(\bR\breadOnly\"n\n" + - "\tVPMEMDisk\x12\x1b\n" + - "\thost_path\x18\x01 \x01(\tR\bhostPath\x12'\n" + - "\x04type\x18\x02 \x01(\x0e2\x13.vmservice.DiskTypeR\x04type\x12\x1b\n" + - "\tread_only\x18\x03 \x01(\bR\breadOnly\"\x94\x01\n" + - "\tNICConfig\x12\x15\n" + - "\x06nic_id\x18\x01 \x01(\tR\x05nicId\x12\x17\n" + - "\aport_id\x18\x02 \x01(\tR\x06portId\x12\x1f\n" + - "\vmac_address\x18\x03 \x01(\tR\n" + - "macAddress\x12\x1b\n" + - "\tswitch_id\x18\x04 \x01(\tR\bswitchId\x12\x19\n" + - "\bnic_name\x18\x05 \x01(\tR\anicName\"3\n" + - "\x10WindowsPCIDevice\x12\x1f\n" + - "\vinstance_id\x18\x01 \x01(\tR\n" + - "instanceId\"2\n" + - "\x13ModifyMemoryRequest\x12\x1b\n" + - "\tmemory_mb\x18\x01 \x01(\x04R\bmemoryMb\"A\n" + - "\x16ModifyProcessorRequest\x12'\n" + - "\x0fprocessor_index\x18\x01 \x01(\rR\x0eprocessorIndex\"r\n" + - "\x1cModifyProcessorConfigRequest\x12)\n" + - "\x10processor_weight\x18\x01 \x01(\rR\x0fprocessorWeight\x12'\n" + - "\x0fprocessor_limit\x18\x02 \x01(\rR\x0eprocessorLimit\"\x89\x04\n" + - "\x15ModifyResourceRequest\x12)\n" + - "\x04type\x18\x01 \x01(\x0e2\x15.vmservice.ModifyTypeR\x04type\x12A\n" + - "\tprocessor\x18\x02 \x01(\v2!.vmservice.ModifyProcessorRequestH\x00R\tprocessor\x12T\n" + - "\x10processor_config\x18\x03 \x01(\v2'.vmservice.ModifyProcessorConfigRequestH\x00R\x0fprocessorConfig\x128\n" + - "\x06memory\x18\x04 \x01(\v2\x1e.vmservice.ModifyMemoryRequestH\x00R\x06memory\x122\n" + - "\tscsi_disk\x18\x05 \x01(\v2\x13.vmservice.SCSIDiskH\x00R\bscsiDisk\x125\n" + - "\n" + - "vpmem_disk\x18\x06 \x01(\v2\x14.vmservice.VPMEMDiskH\x00R\tvpmemDisk\x125\n" + - "\n" + - "nic_config\x18\a \x01(\v2\x14.vmservice.NICConfigH\x00R\tnicConfig\x12D\n" + - "\x0ewindows_device\x18\b \x01(\v2\x1b.vmservice.WindowsPCIDeviceH\x00R\rwindowsDeviceB\n" + - "\n" + - "\bresource*-\n" + - "\n" + - "ModifyType\x12\a\n" + - "\x03ADD\x10\x00\x12\n" + - "\n" + - "\x06REMOVE\x10\x01\x12\n" + - "\n" + - "\x06UPDATE\x10\x02*Y\n" + - "\bDiskType\x12\x17\n" + - "\x13SCSI_DISK_TYPE_VHD1\x10\x00\x12\x17\n" + - "\x13SCSI_DISK_TYPE_VHDX\x10\x01\x12\x1b\n" + - "\x17SCSI_DISK_TYPE_PHYSICAL\x10\x022\xdd\x05\n" + - "\x02VM\x12>\n" + - "\bCreateVM\x12\x1a.vmservice.CreateVMRequest\x1a\x16.google.protobuf.Empty\x12<\n" + - "\n" + - "TeardownVM\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\x129\n" + - "\aPauseVM\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\x12:\n" + - "\bResumeVM\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\x128\n" + - "\x06WaitVM\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\x12F\n" + - "\tInspectVM\x12\x1b.vmservice.InspectVMRequest\x1a\x1c.vmservice.InspectVMResponse\x12K\n" + - "\x0eCapabilitiesVM\x12\x16.google.protobuf.Empty\x1a!.vmservice.CapabilitiesVMResponse\x12O\n" + - "\fPropertiesVM\x12\x1e.vmservice.PropertiesVMRequest\x1a\x1f.vmservice.PropertiesVMResponse\x12J\n" + - "\x0eModifyResource\x12 .vmservice.ModifyResourceRequest\x1a\x16.google.protobuf.Empty\x12>\n" + - "\bVMSocket\x12\x1a.vmservice.VMSocketRequest\x1a\x16.google.protobuf.Empty\x126\n" + - "\x04Quit\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.EmptyB1Z/github.com/Microsoft/hcsshim/internal/vmserviceb\x06proto3" - -var ( - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescOnce sync.Once - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescData []byte -) - -func file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescGZIP() []byte { - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescOnce.Do(func() { - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDesc), len(file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDesc))) - }) - return file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDescData -} - -var file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes = make([]protoimpl.MessageInfo, 30) -var file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_goTypes = []any{ - (ModifyType)(0), // 0: vmservice.ModifyType - (DiskType)(0), // 1: vmservice.DiskType - (PropertiesVMRequest_PropertiesType)(0), // 2: vmservice.PropertiesVMRequest.PropertiesType - (CapabilitiesVMResponse_Resource)(0), // 3: vmservice.CapabilitiesVMResponse.Resource - (CapabilitiesVMResponse_SupportedGuestOS)(0), // 4: vmservice.CapabilitiesVMResponse.SupportedGuestOS - (*DirectBoot)(nil), // 5: vmservice.DirectBoot - (*UEFI)(nil), // 6: vmservice.UEFI - (*MemoryConfig)(nil), // 7: vmservice.MemoryConfig - (*ProcessorConfig)(nil), // 8: vmservice.ProcessorConfig - (*DevicesConfig)(nil), // 9: vmservice.DevicesConfig - (*VMConfig)(nil), // 10: vmservice.VMConfig - (*WindowsOptions)(nil), // 11: vmservice.WindowsOptions - (*SerialConfig)(nil), // 12: vmservice.SerialConfig - (*CreateVMRequest)(nil), // 13: vmservice.CreateVMRequest - (*InspectVMRequest)(nil), // 14: vmservice.InspectVMRequest - (*InspectVMResponse)(nil), // 15: vmservice.InspectVMResponse - (*MemoryStats)(nil), // 16: vmservice.MemoryStats - (*ProcessorStats)(nil), // 17: vmservice.ProcessorStats - (*PropertiesVMRequest)(nil), // 18: vmservice.PropertiesVMRequest - (*PropertiesVMResponse)(nil), // 19: vmservice.PropertiesVMResponse - (*CapabilitiesVMResponse)(nil), // 20: vmservice.CapabilitiesVMResponse - (*HVSocketListen)(nil), // 21: vmservice.HVSocketListen - (*VSockListen)(nil), // 22: vmservice.VSockListen - (*VMSocketRequest)(nil), // 23: vmservice.VMSocketRequest - (*SCSIDisk)(nil), // 24: vmservice.SCSIDisk - (*VPMEMDisk)(nil), // 25: vmservice.VPMEMDisk - (*NICConfig)(nil), // 26: vmservice.NICConfig - (*WindowsPCIDevice)(nil), // 27: vmservice.WindowsPCIDevice - (*ModifyMemoryRequest)(nil), // 28: vmservice.ModifyMemoryRequest - (*ModifyProcessorRequest)(nil), // 29: vmservice.ModifyProcessorRequest - (*ModifyProcessorConfigRequest)(nil), // 30: vmservice.ModifyProcessorConfigRequest - (*ModifyResourceRequest)(nil), // 31: vmservice.ModifyResourceRequest - nil, // 32: vmservice.VMConfig.ExtraDataEntry - (*SerialConfig_Config)(nil), // 33: vmservice.SerialConfig.Config - (*CapabilitiesVMResponse_SupportedResource)(nil), // 34: vmservice.CapabilitiesVMResponse.SupportedResource - (*structpb.Value)(nil), // 35: google.protobuf.Value - (*emptypb.Empty)(nil), // 36: google.protobuf.Empty -} -var file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_depIdxs = []int32{ - 24, // 0: vmservice.DevicesConfig.scsi_disks:type_name -> vmservice.SCSIDisk - 25, // 1: vmservice.DevicesConfig.vpmem_disks:type_name -> vmservice.VPMEMDisk - 26, // 2: vmservice.DevicesConfig.nic_config:type_name -> vmservice.NICConfig - 27, // 3: vmservice.DevicesConfig.windows_device:type_name -> vmservice.WindowsPCIDevice - 7, // 4: vmservice.VMConfig.memory_config:type_name -> vmservice.MemoryConfig - 8, // 5: vmservice.VMConfig.processor_config:type_name -> vmservice.ProcessorConfig - 9, // 6: vmservice.VMConfig.devices_config:type_name -> vmservice.DevicesConfig - 12, // 7: vmservice.VMConfig.serial_config:type_name -> vmservice.SerialConfig - 5, // 8: vmservice.VMConfig.direct_boot:type_name -> vmservice.DirectBoot - 6, // 9: vmservice.VMConfig.uefi:type_name -> vmservice.UEFI - 11, // 10: vmservice.VMConfig.windows_options:type_name -> vmservice.WindowsOptions - 32, // 11: vmservice.VMConfig.extra_data:type_name -> vmservice.VMConfig.ExtraDataEntry - 33, // 12: vmservice.SerialConfig.ports:type_name -> vmservice.SerialConfig.Config - 10, // 13: vmservice.CreateVMRequest.config:type_name -> vmservice.VMConfig - 35, // 14: vmservice.InspectVMResponse.result:type_name -> google.protobuf.Value - 2, // 15: vmservice.PropertiesVMRequest.types:type_name -> vmservice.PropertiesVMRequest.PropertiesType - 16, // 16: vmservice.PropertiesVMResponse.memory_stats:type_name -> vmservice.MemoryStats - 17, // 17: vmservice.PropertiesVMResponse.processor_stats:type_name -> vmservice.ProcessorStats - 34, // 18: vmservice.CapabilitiesVMResponse.supported_resources:type_name -> vmservice.CapabilitiesVMResponse.SupportedResource - 4, // 19: vmservice.CapabilitiesVMResponse.supported_guest_os:type_name -> vmservice.CapabilitiesVMResponse.SupportedGuestOS - 0, // 20: vmservice.VMSocketRequest.type:type_name -> vmservice.ModifyType - 21, // 21: vmservice.VMSocketRequest.hvsocket_list:type_name -> vmservice.HVSocketListen - 22, // 22: vmservice.VMSocketRequest.vsock_listen:type_name -> vmservice.VSockListen - 1, // 23: vmservice.SCSIDisk.type:type_name -> vmservice.DiskType - 1, // 24: vmservice.VPMEMDisk.type:type_name -> vmservice.DiskType - 0, // 25: vmservice.ModifyResourceRequest.type:type_name -> vmservice.ModifyType - 29, // 26: vmservice.ModifyResourceRequest.processor:type_name -> vmservice.ModifyProcessorRequest - 30, // 27: vmservice.ModifyResourceRequest.processor_config:type_name -> vmservice.ModifyProcessorConfigRequest - 28, // 28: vmservice.ModifyResourceRequest.memory:type_name -> vmservice.ModifyMemoryRequest - 24, // 29: vmservice.ModifyResourceRequest.scsi_disk:type_name -> vmservice.SCSIDisk - 25, // 30: vmservice.ModifyResourceRequest.vpmem_disk:type_name -> vmservice.VPMEMDisk - 26, // 31: vmservice.ModifyResourceRequest.nic_config:type_name -> vmservice.NICConfig - 27, // 32: vmservice.ModifyResourceRequest.windows_device:type_name -> vmservice.WindowsPCIDevice - 3, // 33: vmservice.CapabilitiesVMResponse.SupportedResource.resource:type_name -> vmservice.CapabilitiesVMResponse.Resource - 13, // 34: vmservice.VM.CreateVM:input_type -> vmservice.CreateVMRequest - 36, // 35: vmservice.VM.TeardownVM:input_type -> google.protobuf.Empty - 36, // 36: vmservice.VM.PauseVM:input_type -> google.protobuf.Empty - 36, // 37: vmservice.VM.ResumeVM:input_type -> google.protobuf.Empty - 36, // 38: vmservice.VM.WaitVM:input_type -> google.protobuf.Empty - 14, // 39: vmservice.VM.InspectVM:input_type -> vmservice.InspectVMRequest - 36, // 40: vmservice.VM.CapabilitiesVM:input_type -> google.protobuf.Empty - 18, // 41: vmservice.VM.PropertiesVM:input_type -> vmservice.PropertiesVMRequest - 31, // 42: vmservice.VM.ModifyResource:input_type -> vmservice.ModifyResourceRequest - 23, // 43: vmservice.VM.VMSocket:input_type -> vmservice.VMSocketRequest - 36, // 44: vmservice.VM.Quit:input_type -> google.protobuf.Empty - 36, // 45: vmservice.VM.CreateVM:output_type -> google.protobuf.Empty - 36, // 46: vmservice.VM.TeardownVM:output_type -> google.protobuf.Empty - 36, // 47: vmservice.VM.PauseVM:output_type -> google.protobuf.Empty - 36, // 48: vmservice.VM.ResumeVM:output_type -> google.protobuf.Empty - 36, // 49: vmservice.VM.WaitVM:output_type -> google.protobuf.Empty - 15, // 50: vmservice.VM.InspectVM:output_type -> vmservice.InspectVMResponse - 20, // 51: vmservice.VM.CapabilitiesVM:output_type -> vmservice.CapabilitiesVMResponse - 19, // 52: vmservice.VM.PropertiesVM:output_type -> vmservice.PropertiesVMResponse - 36, // 53: vmservice.VM.ModifyResource:output_type -> google.protobuf.Empty - 36, // 54: vmservice.VM.VMSocket:output_type -> google.protobuf.Empty - 36, // 55: vmservice.VM.Quit:output_type -> google.protobuf.Empty - 45, // [45:56] is the sub-list for method output_type - 34, // [34:45] is the sub-list for method input_type - 34, // [34:34] is the sub-list for extension type_name - 34, // [34:34] is the sub-list for extension extendee - 0, // [0:34] is the sub-list for field type_name -} - -func init() { file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_init() } -func file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_init() { - if File_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto != nil { - return - } - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[5].OneofWrappers = []any{ - (*VMConfig_DirectBoot)(nil), - (*VMConfig_Uefi)(nil), - } - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[18].OneofWrappers = []any{ - (*VMSocketRequest_HvsocketList)(nil), - (*VMSocketRequest_VsockListen)(nil), - } - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes[26].OneofWrappers = []any{ - (*ModifyResourceRequest_Processor)(nil), - (*ModifyResourceRequest_ProcessorConfig)(nil), - (*ModifyResourceRequest_Memory)(nil), - (*ModifyResourceRequest_ScsiDisk)(nil), - (*ModifyResourceRequest_VpmemDisk)(nil), - (*ModifyResourceRequest_NicConfig)(nil), - (*ModifyResourceRequest_WindowsDevice)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDesc), len(file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_rawDesc)), - NumEnums: 5, - NumMessages: 30, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_goTypes, - DependencyIndexes: file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_depIdxs, - EnumInfos: file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_enumTypes, - MessageInfos: file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_msgTypes, - }.Build() - File_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto = out.File - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_goTypes = nil - file_github_com_Microsoft_hcsshim_internal_vmservice_vmservice_proto_depIdxs = nil -} diff --git a/internal/vmservice/vmservice.proto b/internal/vmservice/vmservice.proto deleted file mode 100644 index 78f4174aba..0000000000 --- a/internal/vmservice/vmservice.proto +++ /dev/null @@ -1,276 +0,0 @@ -syntax = 'proto3'; - -package vmservice; -option go_package = "github.com/Microsoft/hcsshim/internal/vmservice"; - -import "google/protobuf/empty.proto"; -import "google/protobuf/struct.proto"; - -service VM { - // CreateVM will create the virtual machine with the configuration in the - // CreateVMRequest. The virtual machine will be in a paused state power wise - // after CreateVM. ResumeVM can be called to transition the VM into a running state. - rpc CreateVM(CreateVMRequest) returns (google.protobuf.Empty); - - // TeardownVM will release all associated resources from the VM and unblock the WaitVM call. - rpc TeardownVM(google.protobuf.Empty) returns (google.protobuf.Empty); - - // PauseVM will, if the virtual machine power state is in a running state, transition - // the state to paused. This is the same state power wise that the VM should be in after - // an initial CreateVM call. - rpc PauseVM(google.protobuf.Empty) returns (google.protobuf.Empty); - - // ResumeVM is used to transition a vm to a running state. This can be used to resume a VM that - // has had PauseVM called on it, or to start a VM that was created with CreateVM. - rpc ResumeVM(google.protobuf.Empty) returns (google.protobuf.Empty); - - // WaitVM will block until the VM is either in a halted state or has had all of it's resources freed - // via TeardownVM. - rpc WaitVM(google.protobuf.Empty) returns (google.protobuf.Empty); - - // InspectVM is used to inspect virtual machine state. The query of what to inspect - // is passed in as a string and the response can be of any form. - rpc InspectVM(InspectVMRequest) returns (InspectVMResponse); - - // CapabilitiesVM will return what capabilities the virtstack supports. This includes - // what guest operating systems are supported, what resources are supported, and if hot - // add/hot remove of a resource is supported. - rpc CapabilitiesVM(google.protobuf.Empty) returns (CapabilitiesVMResponse); - - // PropertiesVM will take in a list of properties that the virtstack will return - // statistics for (memory, processors). - rpc PropertiesVM(PropertiesVMRequest) returns (PropertiesVMResponse); - - // ModifyResource is a generic call to modify (add/remove/update) resources for a VM. - // This includes things such as block devices, network adapters, and pci devices. - rpc ModifyResource(ModifyResourceRequest) returns (google.protobuf.Empty); - - // VMSocket is an abstraction around a hypervisor socket transport to facilitate communication - // between virtual machines and the host they are running on. The supported transports are - // HvSocket and Vsock. - rpc VMSocket(VMSocketRequest) returns (google.protobuf.Empty); - - // Quit will shutdown the process hosting the ttrpc server. - rpc Quit(google.protobuf.Empty) returns (google.protobuf.Empty); -} - -message DirectBoot { - string kernel_path = 1; - string initrd_path = 2; - string kernel_cmdline = 3; -} - -message UEFI { - string firmware_path = 1; - string device_path = 2; - // Optional data to include for uefi boot. For Linux this could be used as the kernel - // commandline. - string optional_data = 3; -} - -message MemoryConfig { - uint64 memory_mb = 1; - bool allow_overcommit = 2; - bool deferred_commit = 3; - bool hot_hint = 4; - bool cold_hint = 5; - bool cold_discard_hint = 6; - uint64 low_mmio_gap_in_mb = 7; - uint64 high_mmio_base_in_mb = 8; - uint64 high_mmio_gap_in_mb = 9; -} - -message ProcessorConfig { - uint32 processor_count = 1; - uint32 processor_weight = 2; - uint32 processor_limit = 3; -} - -message DevicesConfig { - repeated SCSIDisk scsi_disks = 1; - repeated VPMEMDisk vpmem_disks = 2; - repeated NICConfig nic_config = 3; - repeated WindowsPCIDevice windows_device = 4; -} - -message VMConfig { - MemoryConfig memory_config = 1; - ProcessorConfig processor_config = 2; - DevicesConfig devices_config = 3; - SerialConfig serial_config = 4; - oneof BootConfig { - DirectBoot direct_boot = 5; - UEFI uefi = 6; - } - WindowsOptions windows_options = 7; - // Optional k:v extra data. Up to the virtstack for how to interpret this. - map extra_data = 8; -} - -// WindowsOptions contains virtual machine configurations that are only present on a Windows host. -message WindowsOptions { - uint64 cpu_group_id = 1; -} - -message SerialConfig { - message Config { - uint32 port = 1; - // Unix domain socket to relay serial console output to. - string socket_path = 2; - } - repeated Config ports = 3; -} - -message CreateVMRequest { - VMConfig config = 1; - // Optional ID to be used by the VM service in log messages. It's up to the - // virtstack to make use of this field. Useful for debugging to be able to - // correlate events for a given vm that the client launched. - string log_id = 2; -} -message InspectVMRequest { - string query = 1; - uint32 recursion_limit = 2; -} - -message InspectVMResponse { - google.protobuf.Value result = 1; -} - -message MemoryStats { - uint64 working_set_bytes = 1; - uint64 available_memory = 2; - uint64 reserved_memory = 3; - uint64 assigned_memory = 4; -} - -message ProcessorStats { - uint64 total_runtime_ns = 1; -} - -message PropertiesVMRequest { - enum PropertiesType { - Memory = 0; - Processor = 1; - } - repeated PropertiesType types = 1; -} - -message PropertiesVMResponse { - MemoryStats memory_stats = 1; - ProcessorStats processor_stats = 2; -} - -message CapabilitiesVMResponse { - enum Resource { - Vpmem = 0; - Scsi = 1; - Vpci = 2; - Plan9 = 3; - VMNic = 4; - Memory = 5; - Processor = 6; - } - - message SupportedResource { - bool Add = 1; - bool Remove = 2; - bool Update = 3; - Resource resource = 4; - } - - enum SupportedGuestOS { - Windows = 0; - Linux = 1; - } - repeated SupportedResource supported_resources = 1; - repeated SupportedGuestOS supported_guest_os = 2; -} - -message HVSocketListen { - string service_id = 1; - // Expected that the listener is a unix domain socket. These - // are supported on Windows as of 1809/RS5. - string listener_path = 2; -} - -message VSockListen { - uint32 port = 1; - string listener_path = 2; -} - -message VMSocketRequest { - ModifyType type = 1; - oneof Config { - HVSocketListen hvsocket_list = 2; - VSockListen vsock_listen = 3; - } -} - -enum ModifyType { - ADD = 0; - REMOVE = 1; - UPDATE = 2; -} - -enum DiskType { - SCSI_DISK_TYPE_VHD1 = 0; - SCSI_DISK_TYPE_VHDX = 1; - SCSI_DISK_TYPE_PHYSICAL = 2; -} - -message SCSIDisk { - uint32 controller = 1; - uint32 lun = 2; - string host_path = 3; - DiskType type = 4; - bool read_only = 5; -} - -message VPMEMDisk { - string host_path = 1; - DiskType type = 2; - bool read_only = 3; -} - - -message NICConfig { - string nic_id = 1; // GUID - string port_id = 2; // GUID - string mac_address = 3; // 12-34-56-78-9A-BC - string switch_id = 4; // GUID - // Optional friendly name for the adapter. Might be useful to show up in logs. - string nic_name = 5; -} - -message WindowsPCIDevice { - // e.g. PCIP\\VEN_10DE&DEV_13F2&SUBSYS_115E10DE&REV_A1\\6&17F903&0&00400000 - string instance_id = 1; -} - -message ModifyMemoryRequest { - uint64 memory_mb = 1; -} - -message ModifyProcessorRequest { - // Index of the processor to add/remove - uint32 processor_index = 1; -} - -message ModifyProcessorConfigRequest { - uint32 processor_weight = 1; - uint32 processor_limit = 2; -} - -message ModifyResourceRequest { - ModifyType type = 1; - oneof resource { - ModifyProcessorRequest processor = 2; - ModifyProcessorConfigRequest processor_config = 3; - ModifyMemoryRequest memory = 4; - SCSIDisk scsi_disk = 5; - VPMEMDisk vpmem_disk = 6; - NICConfig nic_config = 7; - WindowsPCIDevice windows_device = 8; - } -} \ No newline at end of file diff --git a/internal/vmservice/vmservice_ttrpc.pb.go b/internal/vmservice/vmservice_ttrpc.pb.go deleted file mode 100644 index bdce423ac3..0000000000 --- a/internal/vmservice/vmservice_ttrpc.pb.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/Microsoft/hcsshim/internal/vmservice/vmservice.proto -package vmservice - -import ( - context "context" - ttrpc "github.com/containerd/ttrpc" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -type VMService interface { - CreateVM(context.Context, *CreateVMRequest) (*emptypb.Empty, error) - TeardownVM(context.Context, *emptypb.Empty) (*emptypb.Empty, error) - PauseVM(context.Context, *emptypb.Empty) (*emptypb.Empty, error) - ResumeVM(context.Context, *emptypb.Empty) (*emptypb.Empty, error) - WaitVM(context.Context, *emptypb.Empty) (*emptypb.Empty, error) - InspectVM(context.Context, *InspectVMRequest) (*InspectVMResponse, error) - CapabilitiesVM(context.Context, *emptypb.Empty) (*CapabilitiesVMResponse, error) - PropertiesVM(context.Context, *PropertiesVMRequest) (*PropertiesVMResponse, error) - ModifyResource(context.Context, *ModifyResourceRequest) (*emptypb.Empty, error) - VMSocket(context.Context, *VMSocketRequest) (*emptypb.Empty, error) - Quit(context.Context, *emptypb.Empty) (*emptypb.Empty, error) -} - -func RegisterVMService(srv *ttrpc.Server, svc VMService) { - srv.RegisterService("vmservice.VM", &ttrpc.ServiceDesc{ - Methods: map[string]ttrpc.Method{ - "CreateVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req CreateVMRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.CreateVM(ctx, &req) - }, - "TeardownVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.TeardownVM(ctx, &req) - }, - "PauseVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.PauseVM(ctx, &req) - }, - "ResumeVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.ResumeVM(ctx, &req) - }, - "WaitVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.WaitVM(ctx, &req) - }, - "InspectVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req InspectVMRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.InspectVM(ctx, &req) - }, - "CapabilitiesVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.CapabilitiesVM(ctx, &req) - }, - "PropertiesVM": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req PropertiesVMRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.PropertiesVM(ctx, &req) - }, - "ModifyResource": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req ModifyResourceRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.ModifyResource(ctx, &req) - }, - "VMSocket": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req VMSocketRequest - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.VMSocket(ctx, &req) - }, - "Quit": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req emptypb.Empty - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Quit(ctx, &req) - }, - }, - }) -} - -type vmClient struct { - client *ttrpc.Client -} - -func NewVMClient(client *ttrpc.Client) VMService { - return &vmClient{ - client: client, - } -} - -func (c *vmClient) CreateVM(ctx context.Context, req *CreateVMRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "CreateVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) TeardownVM(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "TeardownVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) PauseVM(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "PauseVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) ResumeVM(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "ResumeVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) WaitVM(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "WaitVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) InspectVM(ctx context.Context, req *InspectVMRequest) (*InspectVMResponse, error) { - var resp InspectVMResponse - if err := c.client.Call(ctx, "vmservice.VM", "InspectVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) CapabilitiesVM(ctx context.Context, req *emptypb.Empty) (*CapabilitiesVMResponse, error) { - var resp CapabilitiesVMResponse - if err := c.client.Call(ctx, "vmservice.VM", "CapabilitiesVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) PropertiesVM(ctx context.Context, req *PropertiesVMRequest) (*PropertiesVMResponse, error) { - var resp PropertiesVMResponse - if err := c.client.Call(ctx, "vmservice.VM", "PropertiesVM", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) ModifyResource(ctx context.Context, req *ModifyResourceRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "ModifyResource", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) VMSocket(ctx context.Context, req *VMSocketRequest) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "VMSocket", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} - -func (c *vmClient) Quit(ctx context.Context, req *emptypb.Empty) (*emptypb.Empty, error) { - var resp emptypb.Empty - if err := c.client.Call(ctx, "vmservice.VM", "Quit", req, &resp); err != nil { - return nil, err - } - return &resp, nil -} diff --git a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go b/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go deleted file mode 100644 index 30411b7283..0000000000 --- a/vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go +++ /dev/null @@ -1,767 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/struct.proto - -// Package structpb contains generated types for google/protobuf/struct.proto. -// -// The messages (i.e., Value, Struct, and ListValue) defined in struct.proto are -// used to represent arbitrary JSON. The Value message represents a JSON value, -// the Struct message represents a JSON object, and the ListValue message -// represents a JSON array. See https://json.org for more information. -// -// The Value, Struct, and ListValue types have generated MarshalJSON and -// UnmarshalJSON methods such that they serialize JSON equivalent to what the -// messages themselves represent. Use of these types with the -// "google.golang.org/protobuf/encoding/protojson" package -// ensures that they will be serialized as their JSON equivalent. -// -// # Conversion to and from a Go interface -// -// The standard Go "encoding/json" package has functionality to serialize -// arbitrary types to a large degree. The Value.AsInterface, Struct.AsMap, and -// ListValue.AsSlice methods can convert the protobuf message representation into -// a form represented by any, map[string]any, and []any. -// This form can be used with other packages that operate on such data structures -// and also directly with the standard json package. -// -// In order to convert the any, map[string]any, and []any -// forms back as Value, Struct, and ListValue messages, use the NewStruct, -// NewList, and NewValue constructor functions. -// -// # Example usage -// -// Consider the following example JSON object: -// -// { -// "firstName": "John", -// "lastName": "Smith", -// "isAlive": true, -// "age": 27, -// "address": { -// "streetAddress": "21 2nd Street", -// "city": "New York", -// "state": "NY", -// "postalCode": "10021-3100" -// }, -// "phoneNumbers": [ -// { -// "type": "home", -// "number": "212 555-1234" -// }, -// { -// "type": "office", -// "number": "646 555-4567" -// } -// ], -// "children": [], -// "spouse": null -// } -// -// To construct a Value message representing the above JSON object: -// -// m, err := structpb.NewValue(map[string]any{ -// "firstName": "John", -// "lastName": "Smith", -// "isAlive": true, -// "age": 27, -// "address": map[string]any{ -// "streetAddress": "21 2nd Street", -// "city": "New York", -// "state": "NY", -// "postalCode": "10021-3100", -// }, -// "phoneNumbers": []any{ -// map[string]any{ -// "type": "home", -// "number": "212 555-1234", -// }, -// map[string]any{ -// "type": "office", -// "number": "646 555-4567", -// }, -// }, -// "children": []any{}, -// "spouse": nil, -// }) -// if err != nil { -// ... // handle error -// } -// ... // make use of m as a *structpb.Value -package structpb - -import ( - base64 "encoding/base64" - json "encoding/json" - protojson "google.golang.org/protobuf/encoding/protojson" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - math "math" - reflect "reflect" - sync "sync" - utf8 "unicode/utf8" - unsafe "unsafe" -) - -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. -// -// The JSON representation for `NullValue` is JSON `null`. -type NullValue int32 - -const ( - // Null value. - NullValue_NULL_VALUE NullValue = 0 -) - -// Enum value maps for NullValue. -var ( - NullValue_name = map[int32]string{ - 0: "NULL_VALUE", - } - NullValue_value = map[string]int32{ - "NULL_VALUE": 0, - } -) - -func (x NullValue) Enum() *NullValue { - p := new(NullValue) - *p = x - return p -} - -func (x NullValue) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NullValue) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_struct_proto_enumTypes[0].Descriptor() -} - -func (NullValue) Type() protoreflect.EnumType { - return &file_google_protobuf_struct_proto_enumTypes[0] -} - -func (x NullValue) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NullValue.Descriptor instead. -func (NullValue) EnumDescriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0} -} - -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. -// -// The JSON representation for `Struct` is JSON object. -type Struct struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Unordered map of dynamically typed values. - Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -// NewStruct constructs a Struct from a general-purpose Go map. -// The map keys must be valid UTF-8. -// The map values are converted using NewValue. -func NewStruct(v map[string]any) (*Struct, error) { - x := &Struct{Fields: make(map[string]*Value, len(v))} - for k, v := range v { - if !utf8.ValidString(k) { - return nil, protoimpl.X.NewError("invalid UTF-8 in string: %q", k) - } - var err error - x.Fields[k], err = NewValue(v) - if err != nil { - return nil, err - } - } - return x, nil -} - -// AsMap converts x to a general-purpose Go map. -// The map values are converted by calling Value.AsInterface. -func (x *Struct) AsMap() map[string]any { - f := x.GetFields() - vs := make(map[string]any, len(f)) - for k, v := range f { - vs[k] = v.AsInterface() - } - return vs -} - -func (x *Struct) MarshalJSON() ([]byte, error) { - return protojson.Marshal(x) -} - -func (x *Struct) UnmarshalJSON(b []byte) error { - return protojson.Unmarshal(b, x) -} - -func (x *Struct) Reset() { - *x = Struct{} - mi := &file_google_protobuf_struct_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Struct) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Struct) ProtoMessage() {} - -func (x *Struct) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_struct_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) -} - -// Deprecated: Use Struct.ProtoReflect.Descriptor instead. -func (*Struct) Descriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{0} -} - -func (x *Struct) GetFields() map[string]*Value { - if x != nil { - return x.Fields - } - return nil -} - -// `Value` represents a dynamically typed value which can be either -// null, a number, a string, a boolean, a recursive struct value, or a -// list of values. A producer of value is expected to set one of these -// variants. Absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. -type Value struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The kind of value. - // - // Types that are valid to be assigned to Kind: - // - // *Value_NullValue - // *Value_NumberValue - // *Value_StringValue - // *Value_BoolValue - // *Value_StructValue - // *Value_ListValue - Kind isValue_Kind `protobuf_oneof:"kind"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -// NewValue constructs a Value from a general-purpose Go interface. -// -// ╔═══════════════════════════════════════╤════════════════════════════════════════════╗ -// ║ Go type │ Conversion ║ -// ╠═══════════════════════════════════════╪════════════════════════════════════════════╣ -// ║ nil │ stored as NullValue ║ -// ║ bool │ stored as BoolValue ║ -// ║ int, int8, int16, int32, int64 │ stored as NumberValue ║ -// ║ uint, uint8, uint16, uint32, uint64 │ stored as NumberValue ║ -// ║ float32, float64 │ stored as NumberValue ║ -// ║ json.Number │ stored as NumberValue ║ -// ║ string │ stored as StringValue; must be valid UTF-8 ║ -// ║ []byte │ stored as StringValue; base64-encoded ║ -// ║ map[string]any │ stored as StructValue ║ -// ║ []any │ stored as ListValue ║ -// ╚═══════════════════════════════════════╧════════════════════════════════════════════╝ -// -// When converting an int64 or uint64 to a NumberValue, numeric precision loss -// is possible since they are stored as a float64. -func NewValue(v any) (*Value, error) { - switch v := v.(type) { - case nil: - return NewNullValue(), nil - case bool: - return NewBoolValue(v), nil - case int: - return NewNumberValue(float64(v)), nil - case int8: - return NewNumberValue(float64(v)), nil - case int16: - return NewNumberValue(float64(v)), nil - case int32: - return NewNumberValue(float64(v)), nil - case int64: - return NewNumberValue(float64(v)), nil - case uint: - return NewNumberValue(float64(v)), nil - case uint8: - return NewNumberValue(float64(v)), nil - case uint16: - return NewNumberValue(float64(v)), nil - case uint32: - return NewNumberValue(float64(v)), nil - case uint64: - return NewNumberValue(float64(v)), nil - case float32: - return NewNumberValue(float64(v)), nil - case float64: - return NewNumberValue(float64(v)), nil - case json.Number: - n, err := v.Float64() - if err != nil { - return nil, protoimpl.X.NewError("invalid number format %q, expected a float64: %v", v, err) - } - return NewNumberValue(n), nil - case string: - if !utf8.ValidString(v) { - return nil, protoimpl.X.NewError("invalid UTF-8 in string: %q", v) - } - return NewStringValue(v), nil - case []byte: - s := base64.StdEncoding.EncodeToString(v) - return NewStringValue(s), nil - case map[string]any: - v2, err := NewStruct(v) - if err != nil { - return nil, err - } - return NewStructValue(v2), nil - case []any: - v2, err := NewList(v) - if err != nil { - return nil, err - } - return NewListValue(v2), nil - default: - return nil, protoimpl.X.NewError("invalid type: %T", v) - } -} - -// NewNullValue constructs a new null Value. -func NewNullValue() *Value { - return &Value{Kind: &Value_NullValue{NullValue: NullValue_NULL_VALUE}} -} - -// NewBoolValue constructs a new boolean Value. -func NewBoolValue(v bool) *Value { - return &Value{Kind: &Value_BoolValue{BoolValue: v}} -} - -// NewNumberValue constructs a new number Value. -func NewNumberValue(v float64) *Value { - return &Value{Kind: &Value_NumberValue{NumberValue: v}} -} - -// NewStringValue constructs a new string Value. -func NewStringValue(v string) *Value { - return &Value{Kind: &Value_StringValue{StringValue: v}} -} - -// NewStructValue constructs a new struct Value. -func NewStructValue(v *Struct) *Value { - return &Value{Kind: &Value_StructValue{StructValue: v}} -} - -// NewListValue constructs a new list Value. -func NewListValue(v *ListValue) *Value { - return &Value{Kind: &Value_ListValue{ListValue: v}} -} - -// AsInterface converts x to a general-purpose Go interface. -// -// Calling Value.MarshalJSON and "encoding/json".Marshal on this output produce -// semantically equivalent JSON (assuming no errors occur). -// -// Floating-point values (i.e., "NaN", "Infinity", and "-Infinity") are -// converted as strings to remain compatible with MarshalJSON. -func (x *Value) AsInterface() any { - switch v := x.GetKind().(type) { - case *Value_NumberValue: - if v != nil { - switch { - case math.IsNaN(v.NumberValue): - return "NaN" - case math.IsInf(v.NumberValue, +1): - return "Infinity" - case math.IsInf(v.NumberValue, -1): - return "-Infinity" - default: - return v.NumberValue - } - } - case *Value_StringValue: - if v != nil { - return v.StringValue - } - case *Value_BoolValue: - if v != nil { - return v.BoolValue - } - case *Value_StructValue: - if v != nil { - return v.StructValue.AsMap() - } - case *Value_ListValue: - if v != nil { - return v.ListValue.AsSlice() - } - } - return nil -} - -func (x *Value) MarshalJSON() ([]byte, error) { - return protojson.Marshal(x) -} - -func (x *Value) UnmarshalJSON(b []byte) error { - return protojson.Unmarshal(b, x) -} - -func (x *Value) Reset() { - *x = Value{} - mi := &file_google_protobuf_struct_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Value) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Value) ProtoMessage() {} - -func (x *Value) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_struct_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Value.ProtoReflect.Descriptor instead. -func (*Value) Descriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{1} -} - -func (x *Value) GetKind() isValue_Kind { - if x != nil { - return x.Kind - } - return nil -} - -func (x *Value) GetNullValue() NullValue { - if x != nil { - if x, ok := x.Kind.(*Value_NullValue); ok { - return x.NullValue - } - } - return NullValue_NULL_VALUE -} - -func (x *Value) GetNumberValue() float64 { - if x != nil { - if x, ok := x.Kind.(*Value_NumberValue); ok { - return x.NumberValue - } - } - return 0 -} - -func (x *Value) GetStringValue() string { - if x != nil { - if x, ok := x.Kind.(*Value_StringValue); ok { - return x.StringValue - } - } - return "" -} - -func (x *Value) GetBoolValue() bool { - if x != nil { - if x, ok := x.Kind.(*Value_BoolValue); ok { - return x.BoolValue - } - } - return false -} - -func (x *Value) GetStructValue() *Struct { - if x != nil { - if x, ok := x.Kind.(*Value_StructValue); ok { - return x.StructValue - } - } - return nil -} - -func (x *Value) GetListValue() *ListValue { - if x != nil { - if x, ok := x.Kind.(*Value_ListValue); ok { - return x.ListValue - } - } - return nil -} - -type isValue_Kind interface { - isValue_Kind() -} - -type Value_NullValue struct { - // Represents a null value. - NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"` -} - -type Value_NumberValue struct { - // Represents a double value. - NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"` -} - -type Value_StringValue struct { - // Represents a string value. - StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"` -} - -type Value_BoolValue struct { - // Represents a boolean value. - BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Value_StructValue struct { - // Represents a structured value. - StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"` -} - -type Value_ListValue struct { - // Represents a repeated `Value`. - ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"` -} - -func (*Value_NullValue) isValue_Kind() {} - -func (*Value_NumberValue) isValue_Kind() {} - -func (*Value_StringValue) isValue_Kind() {} - -func (*Value_BoolValue) isValue_Kind() {} - -func (*Value_StructValue) isValue_Kind() {} - -func (*Value_ListValue) isValue_Kind() {} - -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. -type ListValue struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Repeated field of dynamically typed values. - Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -// NewList constructs a ListValue from a general-purpose Go slice. -// The slice elements are converted using NewValue. -func NewList(v []any) (*ListValue, error) { - x := &ListValue{Values: make([]*Value, len(v))} - for i, v := range v { - var err error - x.Values[i], err = NewValue(v) - if err != nil { - return nil, err - } - } - return x, nil -} - -// AsSlice converts x to a general-purpose Go slice. -// The slice elements are converted by calling Value.AsInterface. -func (x *ListValue) AsSlice() []any { - vals := x.GetValues() - vs := make([]any, len(vals)) - for i, v := range vals { - vs[i] = v.AsInterface() - } - return vs -} - -func (x *ListValue) MarshalJSON() ([]byte, error) { - return protojson.Marshal(x) -} - -func (x *ListValue) UnmarshalJSON(b []byte) error { - return protojson.Unmarshal(b, x) -} - -func (x *ListValue) Reset() { - *x = ListValue{} - mi := &file_google_protobuf_struct_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListValue) ProtoMessage() {} - -func (x *ListValue) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_struct_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListValue.ProtoReflect.Descriptor instead. -func (*ListValue) Descriptor() ([]byte, []int) { - return file_google_protobuf_struct_proto_rawDescGZIP(), []int{2} -} - -func (x *ListValue) GetValues() []*Value { - if x != nil { - return x.Values - } - return nil -} - -var File_google_protobuf_struct_proto protoreflect.FileDescriptor - -const file_google_protobuf_struct_proto_rawDesc = "" + - "\n" + - "\x1cgoogle/protobuf/struct.proto\x12\x0fgoogle.protobuf\"\x98\x01\n" + - "\x06Struct\x12;\n" + - "\x06fields\x18\x01 \x03(\v2#.google.protobuf.Struct.FieldsEntryR\x06fields\x1aQ\n" + - "\vFieldsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12,\n" + - "\x05value\x18\x02 \x01(\v2\x16.google.protobuf.ValueR\x05value:\x028\x01\"\xb2\x02\n" + - "\x05Value\x12;\n" + - "\n" + - "null_value\x18\x01 \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12#\n" + - "\fnumber_value\x18\x02 \x01(\x01H\x00R\vnumberValue\x12#\n" + - "\fstring_value\x18\x03 \x01(\tH\x00R\vstringValue\x12\x1f\n" + - "\n" + - "bool_value\x18\x04 \x01(\bH\x00R\tboolValue\x12<\n" + - "\fstruct_value\x18\x05 \x01(\v2\x17.google.protobuf.StructH\x00R\vstructValue\x12;\n" + - "\n" + - "list_value\x18\x06 \x01(\v2\x1a.google.protobuf.ListValueH\x00R\tlistValueB\x06\n" + - "\x04kind\";\n" + - "\tListValue\x12.\n" + - "\x06values\x18\x01 \x03(\v2\x16.google.protobuf.ValueR\x06values*\x1b\n" + - "\tNullValue\x12\x0e\n" + - "\n" + - "NULL_VALUE\x10\x00B\x7f\n" + - "\x13com.google.protobufB\vStructProtoP\x01Z/google.golang.org/protobuf/types/known/structpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3" - -var ( - file_google_protobuf_struct_proto_rawDescOnce sync.Once - file_google_protobuf_struct_proto_rawDescData []byte -) - -func file_google_protobuf_struct_proto_rawDescGZIP() []byte { - file_google_protobuf_struct_proto_rawDescOnce.Do(func() { - file_google_protobuf_struct_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_protobuf_struct_proto_rawDesc), len(file_google_protobuf_struct_proto_rawDesc))) - }) - return file_google_protobuf_struct_proto_rawDescData -} - -var file_google_protobuf_struct_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_protobuf_struct_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_google_protobuf_struct_proto_goTypes = []any{ - (NullValue)(0), // 0: google.protobuf.NullValue - (*Struct)(nil), // 1: google.protobuf.Struct - (*Value)(nil), // 2: google.protobuf.Value - (*ListValue)(nil), // 3: google.protobuf.ListValue - nil, // 4: google.protobuf.Struct.FieldsEntry -} -var file_google_protobuf_struct_proto_depIdxs = []int32{ - 4, // 0: google.protobuf.Struct.fields:type_name -> google.protobuf.Struct.FieldsEntry - 0, // 1: google.protobuf.Value.null_value:type_name -> google.protobuf.NullValue - 1, // 2: google.protobuf.Value.struct_value:type_name -> google.protobuf.Struct - 3, // 3: google.protobuf.Value.list_value:type_name -> google.protobuf.ListValue - 2, // 4: google.protobuf.ListValue.values:type_name -> google.protobuf.Value - 2, // 5: google.protobuf.Struct.FieldsEntry.value:type_name -> google.protobuf.Value - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_google_protobuf_struct_proto_init() } -func file_google_protobuf_struct_proto_init() { - if File_google_protobuf_struct_proto != nil { - return - } - file_google_protobuf_struct_proto_msgTypes[1].OneofWrappers = []any{ - (*Value_NullValue)(nil), - (*Value_NumberValue)(nil), - (*Value_StringValue)(nil), - (*Value_BoolValue)(nil), - (*Value_StructValue)(nil), - (*Value_ListValue)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_struct_proto_rawDesc), len(file_google_protobuf_struct_proto_rawDesc)), - NumEnums: 1, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_protobuf_struct_proto_goTypes, - DependencyIndexes: file_google_protobuf_struct_proto_depIdxs, - EnumInfos: file_google_protobuf_struct_proto_enumTypes, - MessageInfos: file_google_protobuf_struct_proto_msgTypes, - }.Build() - File_google_protobuf_struct_proto = out.File - file_google_protobuf_struct_proto_goTypes = nil - file_google_protobuf_struct_proto_depIdxs = nil -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 5adf43b5f2..d6a6f44c84 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -783,7 +783,6 @@ google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/fieldmaskpb -google.golang.org/protobuf/types/known/structpb google.golang.org/protobuf/types/known/timestamppb google.golang.org/protobuf/types/pluginpb # gopkg.in/yaml.v3 v3.0.1 From fd5c5e27542e72f527e2ae2f9b9eeec99564d2ff Mon Sep 17 00:00:00 2001 From: Harsh Rawat Date: Wed, 28 Jan 2026 15:10:01 +0530 Subject: [PATCH 2/2] replace k8s.gcr.io with registry.k8s.io The Kubernetes project has migrated all container images to a new community-owned registry: registry.k8s.io instead of k8s.gcr.io. This commit changes the same. Signed-off-by: Harsh Rawat --- .github/workflows/ci.yml | 4 ++-- test/pkg/images/images.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ca1df112b..c6a599ad20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -543,8 +543,8 @@ jobs: working-directory: src/github.com/containerd/containerd env: TEST_IMAGE_LIST: ${{github.workspace}}/repolist.toml - BUSYBOX_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/busybox:1.29-2" - RESOURCE_CONSUMER_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/resource-consumer:1.10" + BUSYBOX_TESTING_IMAGE_REF: "registry.k8s.io/e2e-test-images/busybox:1.29-2" + RESOURCE_CONSUMER_TESTING_IMAGE_REF: "registry.k8s.io/e2e-test-images/resource-consumer:1.10" CGO_ENABLED: 1 run: | cat > "${{ env.TEST_IMAGE_LIST }}" << EOF diff --git a/test/pkg/images/images.go b/test/pkg/images/images.go index adcc905cf7..c19de56766 100644 --- a/test/pkg/images/images.go +++ b/test/pkg/images/images.go @@ -14,7 +14,7 @@ const ( MCRWindowsImageRepo = "mcr.microsoft.com/windows" ImageLinuxAlpineLatest = "docker.io/library/alpine:latest" - ImageLinuxPause31 = "k8s.gcr.io/pause:3.1" + ImageLinuxPause31 = "registry.k8s.io/pause:3.1" ImageMCRLinuxPause = "mcr.microsoft.com/oss/kubernetes/pause:3.1" )