diff --git a/src/runtime/virtcontainers/acrn.go b/src/runtime/virtcontainers/acrn.go index 8103d5e8fe..e9005f183d 100644 --- a/src/runtime/virtcontainers/acrn.go +++ b/src/runtime/virtcontainers/acrn.go @@ -25,10 +25,10 @@ import ( "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/config" persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api" + vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/uuid" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils" - vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" ) // Since ACRN is using the store in a quite abnormal way, let's first draw it back from store to here diff --git a/src/runtime/virtcontainers/agent.go b/src/runtime/virtcontainers/agent.go index 426413c58b..87e061204d 100644 --- a/src/runtime/virtcontainers/agent.go +++ b/src/runtime/virtcontainers/agent.go @@ -206,7 +206,7 @@ type agent interface { // getOOMEvent will wait on OOM events that occur in the sandbox. // Will return the ID of the container where the event occurred. - getOOMEvent(ctx context.Context, ) (string, error) + getOOMEvent(ctx context.Context) (string, error) // getAgentMetrics get metrics of agent and guest through agent getAgentMetrics(context.Context, *grpc.GetMetricsRequest) (*grpc.Metrics, error) diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index e5de04afe0..f321765304 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -30,9 +30,9 @@ import ( otelTrace "go.opentelemetry.io/otel/trace" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/config" + vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils" - vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" ) // diff --git a/src/runtime/virtcontainers/device/config/config.go b/src/runtime/virtcontainers/device/config/config.go index 4faf24d7f9..5c866623de 100644 --- a/src/runtime/virtcontainers/device/config/config.go +++ b/src/runtime/virtcontainers/device/config/config.go @@ -15,8 +15,8 @@ import ( "strings" "github.com/go-ini/ini" - "golang.org/x/sys/unix" vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" + "golang.org/x/sys/unix" ) // DeviceType indicates device type diff --git a/src/runtime/virtcontainers/factory/factory.go b/src/runtime/virtcontainers/factory/factory.go index c677fd16ae..6b6e99d2d2 100644 --- a/src/runtime/virtcontainers/factory/factory.go +++ b/src/runtime/virtcontainers/factory/factory.go @@ -191,7 +191,7 @@ func (f *factory) GetVM(ctx context.Context, config vc.VMConfig) (*vc.VM, error) online := false baseConfig := f.base.Config().HypervisorConfig if baseConfig.NumVCPUs < hypervisorConfig.NumVCPUs { - err = vm.AddCPUs(ctx, hypervisorConfig.NumVCPUs - baseConfig.NumVCPUs) + err = vm.AddCPUs(ctx, hypervisorConfig.NumVCPUs-baseConfig.NumVCPUs) if err != nil { return nil, err } @@ -199,7 +199,7 @@ func (f *factory) GetVM(ctx context.Context, config vc.VMConfig) (*vc.VM, error) } if baseConfig.MemorySize < hypervisorConfig.MemorySize { - err = vm.AddMemory(ctx, hypervisorConfig.MemorySize - baseConfig.MemorySize) + err = vm.AddMemory(ctx, hypervisorConfig.MemorySize-baseConfig.MemorySize) if err != nil { return nil, err } diff --git a/src/runtime/virtcontainers/kata_agent_test.go b/src/runtime/virtcontainers/kata_agent_test.go index 5bbfbd0b89..bf3acf7205 100644 --- a/src/runtime/virtcontainers/kata_agent_test.go +++ b/src/runtime/virtcontainers/kata_agent_test.go @@ -31,8 +31,8 @@ import ( vcAnnotations "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/annotations" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/mock" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/rootless" - "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" + "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" ) var ( diff --git a/src/runtime/virtcontainers/persist/api/device.go b/src/runtime/virtcontainers/persist/api/device.go index 204ea7cfa7..5e6c6e6f73 100644 --- a/src/runtime/virtcontainers/persist/api/device.go +++ b/src/runtime/virtcontainers/persist/api/device.go @@ -6,7 +6,7 @@ package persistapi -import vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" +import vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" // ============= sandbox level resources ============= diff --git a/src/runtime/virtcontainers/physical_endpoint.go b/src/runtime/virtcontainers/physical_endpoint.go index 8ec1401bf8..cdc57910e7 100644 --- a/src/runtime/virtcontainers/physical_endpoint.go +++ b/src/runtime/virtcontainers/physical_endpoint.go @@ -17,8 +17,8 @@ import ( "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/drivers" persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/cgroups" - "github.com/safchain/ethtool" vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" + "github.com/safchain/ethtool" ) // PhysicalEndpoint gathers a physical network interface and its properties diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/agent.pb.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/agent.pb.go index ac1a0ded7f..b277d40d9d 100644 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/agent.pb.go +++ b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/agent.pb.go @@ -7248,7 +7248,7 @@ func (this *MemoryStats) String() string { return "nil" } keysForStats := make([]string, 0, len(this.Stats)) - for k, _ := range this.Stats { + for k := range this.Stats { keysForStats = append(keysForStats, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForStats) @@ -7359,7 +7359,7 @@ func (this *CgroupStats) String() string { return "nil" } keysForHugetlbStats := make([]string, 0, len(this.HugetlbStats)) - for k, _ := range this.HugetlbStats { + for k := range this.HugetlbStats { keysForHugetlbStats = append(keysForHugetlbStats, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForHugetlbStats) diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go index 851a1ac0b8..f14e7d49ae 100644 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go +++ b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go @@ -6653,7 +6653,7 @@ func (this *Spec) String() string { } repeatedStringForMounts += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k, _ := range this.Annotations { + for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) @@ -6852,7 +6852,7 @@ func (this *Linux) String() string { } repeatedStringForDevices += "}" keysForSysctl := make([]string, 0, len(this.Sysctl)) - for k, _ := range this.Sysctl { + for k := range this.Sysctl { keysForSysctl = append(keysForSysctl, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForSysctl) diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/client.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/client.go index b435e963f2..ece0784d89 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/client.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/client.go @@ -157,13 +157,12 @@ func parameterToJson(obj interface{}) (string, error) { return string(jsonBuf), err } - // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) + dump, err := httputil.DumpRequestOut(request, true) if err != nil { - return nil, err + return nil, err } log.Printf("\n%s\n", string(dump)) } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/configuration.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/configuration.go index 57ccf85697..4dd597fcc5 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/configuration.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/configuration.go @@ -37,7 +37,6 @@ var ( // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") - ) // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth @@ -52,7 +51,6 @@ type APIKey struct { Prefix string } - // ServerVariable stores the information about a server variable type ServerVariable struct { Description string @@ -62,9 +60,9 @@ type ServerVariable struct { // ServerConfiguration stores the information about a server type ServerConfiguration struct { - Url string + Url string Description string - Variables map[string]ServerVariable + Variables map[string]ServerVariable } // Configuration stores the configuration of the API client @@ -86,9 +84,9 @@ func NewConfiguration() *Configuration { DefaultHeader: make(map[string]string), UserAgent: "OpenAPI-Generator/1.0.0/go", Debug: false, - Servers: []ServerConfiguration{ + Servers: []ServerConfiguration{ { - Url: "http://localhost/api/v1", + Url: "http://localhost/api/v1", Description: "No description provided", }, }, @@ -104,7 +102,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // ServerUrl returns URL based on server settings func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error) { if index < 0 || len(c.Servers) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers) - 1) + return "", fmt.Errorf("Index %v out of range %v", index, len(c.Servers)-1) } server := c.Servers[index] url := server.Url diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_balloon_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_balloon_config.go index 999f669de4..96de345d35 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_balloon_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_balloon_config.go @@ -8,6 +8,7 @@ */ package openapi + // BalloonConfig struct for BalloonConfig type BalloonConfig struct { Size int64 `json:"size"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cmd_line_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cmd_line_config.go index 62d23ce3fb..e924de7118 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cmd_line_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cmd_line_config.go @@ -8,6 +8,7 @@ */ package openapi + // CmdLineConfig struct for CmdLineConfig type CmdLineConfig struct { Args string `json:"args"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_console_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_console_config.go index af23bcf48e..6de0c247a3 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_console_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_console_config.go @@ -8,9 +8,10 @@ */ package openapi + // ConsoleConfig struct for ConsoleConfig type ConsoleConfig struct { - File string `json:"file,omitempty"` - Mode string `json:"mode"` - Iommu bool `json:"iommu,omitempty"` + File string `json:"file,omitempty"` + Mode string `json:"mode"` + Iommu bool `json:"iommu,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_topology.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_topology.go index 3c8bf4b0d3..110801dbdc 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_topology.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpu_topology.go @@ -8,10 +8,11 @@ */ package openapi + // CpuTopology struct for CpuTopology type CpuTopology struct { ThreadsPerCore int32 `json:"threads_per_core,omitempty"` - CoresPerDie int32 `json:"cores_per_die,omitempty"` + CoresPerDie int32 `json:"cores_per_die,omitempty"` DiesPerPackage int32 `json:"dies_per_package,omitempty"` - Packages int32 `json:"packages,omitempty"` + Packages int32 `json:"packages,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpus_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpus_config.go index 6bf2245cf7..b67daeec04 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpus_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_cpus_config.go @@ -8,10 +8,11 @@ */ package openapi + // CpusConfig struct for CpusConfig type CpusConfig struct { - BootVcpus int32 `json:"boot_vcpus"` - MaxVcpus int32 `json:"max_vcpus"` - Topology CpuTopology `json:"topology,omitempty"` - MaxPhysBits int32 `json:"max_phys_bits,omitempty"` + BootVcpus int32 `json:"boot_vcpus"` + MaxVcpus int32 `json:"max_vcpus"` + Topology CpuTopology `json:"topology,omitempty"` + MaxPhysBits int32 `json:"max_phys_bits,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_config.go index d0fa7d6e1a..a1e2836331 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_config.go @@ -8,9 +8,10 @@ */ package openapi + // DeviceConfig struct for DeviceConfig type DeviceConfig struct { - Path string `json:"path"` - Iommu bool `json:"iommu,omitempty"` - Id string `json:"id,omitempty"` + Path string `json:"path"` + Iommu bool `json:"iommu,omitempty"` + Id string `json:"id,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_node.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_node.go index f584d9a3f9..bb49a9fcc0 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_node.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_device_node.go @@ -8,10 +8,11 @@ */ package openapi + // DeviceNode struct for DeviceNode type DeviceNode struct { - Id string `json:"id,omitempty"` + Id string `json:"id,omitempty"` Resources []map[string]interface{} `json:"resources,omitempty"` - Children []string `json:"children,omitempty"` - PciBdf int32 `json:"pci_bdf,omitempty"` + Children []string `json:"children,omitempty"` + PciBdf int32 `json:"pci_bdf,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go index 24bf8c11e7..7c1da3ce54 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go @@ -8,16 +8,17 @@ */ package openapi + // DiskConfig struct for DiskConfig type DiskConfig struct { - Path string `json:"path"` - Readonly bool `json:"readonly,omitempty"` - Direct bool `json:"direct,omitempty"` - Iommu bool `json:"iommu,omitempty"` - NumQueues int32 `json:"num_queues,omitempty"` - QueueSize int32 `json:"queue_size,omitempty"` - VhostUser bool `json:"vhost_user,omitempty"` + Path string `json:"path"` + Readonly bool `json:"readonly,omitempty"` + Direct bool `json:"direct,omitempty"` + Iommu bool `json:"iommu,omitempty"` + NumQueues int32 `json:"num_queues,omitempty"` + QueueSize int32 `json:"queue_size,omitempty"` + VhostUser bool `json:"vhost_user,omitempty"` VhostSocket string `json:"vhost_socket,omitempty"` - PollQueue bool `json:"poll_queue,omitempty"` - Id string `json:"id,omitempty"` + PollQueue bool `json:"poll_queue,omitempty"` + Id string `json:"id,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_fs_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_fs_config.go index 6b1ccb8644..a5ea4f446d 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_fs_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_fs_config.go @@ -8,13 +8,14 @@ */ package openapi + // FsConfig struct for FsConfig type FsConfig struct { - Tag string `json:"tag"` - Socket string `json:"socket"` - NumQueues int32 `json:"num_queues"` - QueueSize int32 `json:"queue_size"` - Dax bool `json:"dax"` - CacheSize int64 `json:"cache_size"` - Id string `json:"id,omitempty"` + Tag string `json:"tag"` + Socket string `json:"socket"` + NumQueues int32 `json:"num_queues"` + QueueSize int32 `json:"queue_size"` + Dax bool `json:"dax"` + CacheSize int64 `json:"cache_size"` + Id string `json:"id,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_initramfs_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_initramfs_config.go index 3b361c1268..9b335569ba 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_initramfs_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_initramfs_config.go @@ -8,6 +8,7 @@ */ package openapi + // InitramfsConfig struct for InitramfsConfig type InitramfsConfig struct { Path string `json:"path"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_kernel_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_kernel_config.go index ce35f47f6b..fe12852142 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_kernel_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_kernel_config.go @@ -8,6 +8,7 @@ */ package openapi + // KernelConfig struct for KernelConfig type KernelConfig struct { Path string `json:"path"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go index 126a8ea6a4..86408200b8 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go @@ -8,14 +8,15 @@ */ package openapi + // MemoryConfig struct for MemoryConfig type MemoryConfig struct { - Size int64 `json:"size"` - HotplugSize int64 `json:"hotplug_size,omitempty"` - HotpluggedSize int64 `json:"hotplugged_size,omitempty"` - Mergeable bool `json:"mergeable,omitempty"` - HotplugMethod string `json:"hotplug_method,omitempty"` - Shared bool `json:"shared,omitempty"` - Hugepages bool `json:"hugepages,omitempty"` - Zones []MemoryZoneConfig `json:"zones,omitempty"` + Size int64 `json:"size"` + HotplugSize int64 `json:"hotplug_size,omitempty"` + HotpluggedSize int64 `json:"hotplugged_size,omitempty"` + Mergeable bool `json:"mergeable,omitempty"` + HotplugMethod string `json:"hotplug_method,omitempty"` + Shared bool `json:"shared,omitempty"` + Hugepages bool `json:"hugepages,omitempty"` + Zones []MemoryZoneConfig `json:"zones,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_zone_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_zone_config.go index aacd718330..8ded3360be 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_zone_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_memory_zone_config.go @@ -8,15 +8,16 @@ */ package openapi + // MemoryZoneConfig struct for MemoryZoneConfig type MemoryZoneConfig struct { - Id string `json:"id"` - Size int64 `json:"size"` - File string `json:"file,omitempty"` - Mergeable bool `json:"mergeable,omitempty"` - Shared bool `json:"shared,omitempty"` - Hugepages bool `json:"hugepages,omitempty"` - HostNumaNode int32 `json:"host_numa_node,omitempty"` - HotplugSize int64 `json:"hotplug_size,omitempty"` - HotpluggedSize int64 `json:"hotplugged_size,omitempty"` + Id string `json:"id"` + Size int64 `json:"size"` + File string `json:"file,omitempty"` + Mergeable bool `json:"mergeable,omitempty"` + Shared bool `json:"shared,omitempty"` + Hugepages bool `json:"hugepages,omitempty"` + HostNumaNode int32 `json:"host_numa_node,omitempty"` + HotplugSize int64 `json:"hotplug_size,omitempty"` + HotpluggedSize int64 `json:"hotplugged_size,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go index aea3efe7f8..c9d2da688c 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go @@ -8,16 +8,17 @@ */ package openapi + // NetConfig struct for NetConfig type NetConfig struct { - Tap string `json:"tap,omitempty"` - Ip string `json:"ip,omitempty"` - Mask string `json:"mask,omitempty"` - Mac string `json:"mac,omitempty"` - Iommu bool `json:"iommu,omitempty"` - NumQueues int32 `json:"num_queues,omitempty"` - QueueSize int32 `json:"queue_size,omitempty"` - VhostUser bool `json:"vhost_user,omitempty"` + Tap string `json:"tap,omitempty"` + Ip string `json:"ip,omitempty"` + Mask string `json:"mask,omitempty"` + Mac string `json:"mac,omitempty"` + Iommu bool `json:"iommu,omitempty"` + NumQueues int32 `json:"num_queues,omitempty"` + QueueSize int32 `json:"queue_size,omitempty"` + VhostUser bool `json:"vhost_user,omitempty"` VhostSocket string `json:"vhost_socket,omitempty"` - Id string `json:"id,omitempty"` + Id string `json:"id,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_config.go index 378b92fd44..e4e247d629 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_config.go @@ -8,10 +8,11 @@ */ package openapi + // NumaConfig struct for NumaConfig type NumaConfig struct { - GuestNumaId int32 `json:"guest_numa_id"` - Cpus []int32 `json:"cpus,omitempty"` - Distances []NumaDistance `json:"distances,omitempty"` - MemoryZones []string `json:"memory_zones,omitempty"` + GuestNumaId int32 `json:"guest_numa_id"` + Cpus []int32 `json:"cpus,omitempty"` + Distances []NumaDistance `json:"distances,omitempty"` + MemoryZones []string `json:"memory_zones,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_distance.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_distance.go index 4b96816970..1f4f3560ce 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_distance.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_numa_distance.go @@ -8,8 +8,9 @@ */ package openapi + // NumaDistance struct for NumaDistance type NumaDistance struct { Destination int32 `json:"destination"` - Distance int32 `json:"distance"` + Distance int32 `json:"distance"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pci_device_info.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pci_device_info.go index 308386207d..47b3302e63 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pci_device_info.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pci_device_info.go @@ -8,8 +8,9 @@ */ package openapi + // PciDeviceInfo Information about a PCI device type PciDeviceInfo struct { - Id string `json:"id"` + Id string `json:"id"` Bdf string `json:"bdf"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go index 600238f836..85cac5564f 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go @@ -8,12 +8,13 @@ */ package openapi + // PmemConfig struct for PmemConfig type PmemConfig struct { - File string `json:"file"` - Size int64 `json:"size,omitempty"` - Iommu bool `json:"iommu,omitempty"` - Mergeable bool `json:"mergeable,omitempty"` - DiscardWrites bool `json:"discard_writes,omitempty"` - Id string `json:"id,omitempty"` + File string `json:"file"` + Size int64 `json:"size,omitempty"` + Iommu bool `json:"iommu,omitempty"` + Mergeable bool `json:"mergeable,omitempty"` + DiscardWrites bool `json:"discard_writes,omitempty"` + Id string `json:"id,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_restore_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_restore_config.go index 713cf1b3c3..490a34d60f 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_restore_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_restore_config.go @@ -8,8 +8,9 @@ */ package openapi + // RestoreConfig struct for RestoreConfig type RestoreConfig struct { SourceUrl string `json:"source_url"` - Prefault bool `json:"prefault,omitempty"` + Prefault bool `json:"prefault,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_rng_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_rng_config.go index 3a928cd2a8..2bd1c15875 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_rng_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_rng_config.go @@ -8,8 +8,9 @@ */ package openapi + // RngConfig struct for RngConfig type RngConfig struct { - Src string `json:"src"` - Iommu bool `json:"iommu,omitempty"` + Src string `json:"src"` + Iommu bool `json:"iommu,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_sgx_epc_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_sgx_epc_config.go index 692122c387..a0562558f9 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_sgx_epc_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_sgx_epc_config.go @@ -8,8 +8,9 @@ */ package openapi + // SgxEpcConfig struct for SgxEpcConfig type SgxEpcConfig struct { - Size int64 `json:"size"` - Prefault bool `json:"prefault,omitempty"` + Size int64 `json:"size"` + Prefault bool `json:"prefault,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_add_device.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_add_device.go index f644fa60a2..749bbf139c 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_add_device.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_add_device.go @@ -8,9 +8,10 @@ */ package openapi + // VmAddDevice struct for VmAddDevice type VmAddDevice struct { - Path string `json:"path,omitempty"` - Iommu bool `json:"iommu,omitempty"` - Id string `json:"id,omitempty"` + Path string `json:"path,omitempty"` + Iommu bool `json:"iommu,omitempty"` + Id string `json:"id,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go index 158ef3b2fe..7c8f09b396 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_config.go @@ -8,25 +8,26 @@ */ package openapi + // VmConfig Virtual machine configuration type VmConfig struct { - Cpus CpusConfig `json:"cpus,omitempty"` - Memory MemoryConfig `json:"memory,omitempty"` - Kernel KernelConfig `json:"kernel"` + Cpus CpusConfig `json:"cpus,omitempty"` + Memory MemoryConfig `json:"memory,omitempty"` + Kernel KernelConfig `json:"kernel"` Initramfs *InitramfsConfig `json:"initramfs,omitempty"` - Cmdline CmdLineConfig `json:"cmdline,omitempty"` - Disks []DiskConfig `json:"disks,omitempty"` - Net []NetConfig `json:"net,omitempty"` - Rng RngConfig `json:"rng,omitempty"` - Balloon BalloonConfig `json:"balloon,omitempty"` - Fs []FsConfig `json:"fs,omitempty"` - Pmem []PmemConfig `json:"pmem,omitempty"` - Serial ConsoleConfig `json:"serial,omitempty"` - Console ConsoleConfig `json:"console,omitempty"` - Devices []DeviceConfig `json:"devices,omitempty"` - Vsock VsockConfig `json:"vsock,omitempty"` - SgxEpc []SgxEpcConfig `json:"sgx_epc,omitempty"` - Numa []NumaConfig `json:"numa,omitempty"` - Iommu bool `json:"iommu,omitempty"` - Watchdog bool `json:"watchdog,omitempty"` + Cmdline CmdLineConfig `json:"cmdline,omitempty"` + Disks []DiskConfig `json:"disks,omitempty"` + Net []NetConfig `json:"net,omitempty"` + Rng RngConfig `json:"rng,omitempty"` + Balloon BalloonConfig `json:"balloon,omitempty"` + Fs []FsConfig `json:"fs,omitempty"` + Pmem []PmemConfig `json:"pmem,omitempty"` + Serial ConsoleConfig `json:"serial,omitempty"` + Console ConsoleConfig `json:"console,omitempty"` + Devices []DeviceConfig `json:"devices,omitempty"` + Vsock VsockConfig `json:"vsock,omitempty"` + SgxEpc []SgxEpcConfig `json:"sgx_epc,omitempty"` + Numa []NumaConfig `json:"numa,omitempty"` + Iommu bool `json:"iommu,omitempty"` + Watchdog bool `json:"watchdog,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_info.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_info.go index 0f1597286b..83a0159c87 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_info.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_info.go @@ -8,10 +8,11 @@ */ package openapi + // VmInfo Virtual Machine information type VmInfo struct { - Config VmConfig `json:"config"` - State string `json:"state"` - MemoryActualSize int64 `json:"memory_actual_size,omitempty"` - DeviceTree map[string]DeviceNode `json:"device_tree,omitempty"` + Config VmConfig `json:"config"` + State string `json:"state"` + MemoryActualSize int64 `json:"memory_actual_size,omitempty"` + DeviceTree map[string]DeviceNode `json:"device_tree,omitempty"` } diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_remove_device.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_remove_device.go index 4a0cb6cf2c..65bab16fc3 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_remove_device.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_remove_device.go @@ -8,6 +8,7 @@ */ package openapi + // VmRemoveDevice struct for VmRemoveDevice type VmRemoveDevice struct { Id string `json:"id,omitempty"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go index 492b00a500..4e60fbfa4a 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go @@ -8,6 +8,7 @@ */ package openapi + // VmResize struct for VmResize type VmResize struct { DesiredVcpus int32 `json:"desired_vcpus,omitempty"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize_zone.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize_zone.go index c86e02f0ff..aac1207604 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize_zone.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize_zone.go @@ -8,6 +8,7 @@ */ package openapi + // VmResizeZone struct for VmResizeZone type VmResizeZone struct { Id string `json:"id,omitempty"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_snapshot_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_snapshot_config.go index b029fff392..58d848792c 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_snapshot_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vm_snapshot_config.go @@ -8,6 +8,7 @@ */ package openapi + // VmSnapshotConfig struct for VmSnapshotConfig type VmSnapshotConfig struct { DestinationUrl string `json:"destination_url,omitempty"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vmm_ping_response.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vmm_ping_response.go index 4ab8cf1c1b..abbcf03464 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vmm_ping_response.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vmm_ping_response.go @@ -8,6 +8,7 @@ */ package openapi + // VmmPingResponse Virtual Machine Monitor information type VmmPingResponse struct { Version string `json:"version"` diff --git a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vsock_config.go b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vsock_config.go index 2fed17461a..98745fa77b 100644 --- a/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vsock_config.go +++ b/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_vsock_config.go @@ -8,12 +8,13 @@ */ package openapi + // VsockConfig struct for VsockConfig type VsockConfig struct { // Guest Vsock CID Cid int64 `json:"cid"` // Path to UNIX domain socket, used to proxy vsock connections. Socket string `json:"socket"` - Iommu bool `json:"iommu,omitempty"` - Id string `json:"id,omitempty"` + Iommu bool `json:"iommu,omitempty"` + Id string `json:"id,omitempty"` } diff --git a/src/runtime/virtcontainers/qemu.go b/src/runtime/virtcontainers/qemu.go index 9c67bd805b..192ce53d91 100644 --- a/src/runtime/virtcontainers/qemu.go +++ b/src/runtime/virtcontainers/qemu.go @@ -36,10 +36,10 @@ import ( pkgUtils "github.com/kata-containers/kata-containers/src/runtime/pkg/utils" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/config" persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api" + vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/uuid" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/types" "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils" - vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" ) // romFile is the file name of the ROM that can be used for virtio-pci devices. diff --git a/src/runtime/virtcontainers/qemu_arch_base.go b/src/runtime/virtcontainers/qemu_arch_base.go index 8770164e1c..303b4b5880 100644 --- a/src/runtime/virtcontainers/qemu_arch_base.go +++ b/src/runtime/virtcontainers/qemu_arch_base.go @@ -157,7 +157,7 @@ type qemuArchBase struct { kernelParamsDebug []Param kernelParams []Param Bridges []types.Bridge - PFlash []string + PFlash []string } const ( diff --git a/src/runtime/virtcontainers/tap_endpoint.go b/src/runtime/virtcontainers/tap_endpoint.go index 344652b2f3..9617945814 100644 --- a/src/runtime/virtcontainers/tap_endpoint.go +++ b/src/runtime/virtcontainers/tap_endpoint.go @@ -13,8 +13,8 @@ import ( "github.com/vishvananda/netlink" persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api" - "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/uuid" vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" + "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/uuid" ) // TapEndpoint represents just a tap endpoint diff --git a/src/runtime/virtcontainers/vhostuser_endpoint.go b/src/runtime/virtcontainers/vhostuser_endpoint.go index 7c8a1f9f8b..7f3c9efe43 100644 --- a/src/runtime/virtcontainers/vhostuser_endpoint.go +++ b/src/runtime/virtcontainers/vhostuser_endpoint.go @@ -13,8 +13,8 @@ import ( "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/device/config" persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api" - "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils" vcTypes "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/types" + "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/utils" ) // Long term, this should be made more configurable. For now matching path