diff --git a/versions.yaml b/versions.yaml index e2e6c8e8f0..c87c8d61b9 100644 --- a/versions.yaml +++ b/versions.yaml @@ -75,7 +75,7 @@ assets: url: "https://github.com/cloud-hypervisor/cloud-hypervisor" uscan-url: >- https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz - version: "v0.4.0" + version: "v0.5.0" firecracker: description: "Firecracker micro-VMM" diff --git a/virtcontainers/pkg/cloud-hypervisor/client/README.md b/virtcontainers/pkg/cloud-hypervisor/client/README.md index 57e775f839..b3affe8b71 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/README.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/README.md @@ -72,6 +72,7 @@ Class | Method | HTTP request | Description Endpoints do not require authorization. + ## Author diff --git a/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml b/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml index 2c734abd89..ff93543b6e 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml +++ b/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml @@ -13,7 +13,7 @@ paths: /vmm.ping: get: responses: - 200: + "200": content: application/json: schema: @@ -24,13 +24,13 @@ paths: put: operationId: shutdownVMM responses: - 204: + "204": description: The VMM successfully shutdown. summary: Shuts the cloud-hypervisor VMM. /vm.info: get: responses: - 200: + "200": content: application/json: schema: @@ -49,7 +49,7 @@ paths: description: The VM configuration required: true responses: - 204: + "204": description: The VM instance was successfully created. summary: Create the cloud-hypervisor Virtual Machine (VM) instance. The instance is not booted, only created. @@ -57,60 +57,60 @@ paths: put: operationId: deleteVM responses: - 204: + "204": description: The VM instance was successfully deleted. summary: Delete the cloud-hypervisor Virtual Machine (VM) instance. /vm.boot: put: operationId: bootVM responses: - 204: + "204": description: The VM instance successfully booted. - 404: + "404": description: The VM instance could not boot because it is not created yet summary: Boot the previously created VM instance. /vm.pause: put: operationId: pauseVM responses: - 204: + "204": description: The VM instance successfully paused. - 404: + "404": description: The VM instance could not pause because it is not created yet - 405: + "405": description: The VM instance could not pause because it is not booted. summary: Pause a previously booted VM instance. /vm.resume: put: operationId: resumeVM responses: - 204: + "204": description: The VM instance successfully paused. - 404: + "404": description: The VM instance could not resume because it is not booted yet - 405: + "405": description: The VM instance could not resume because it is not paused. summary: Resume a previously paused VM instance. /vm.shutdown: put: operationId: shutdownVM responses: - 204: + "204": description: The VM instance successfully shut down. - 404: + "404": description: The VM instance could not shut down because is not created. - 405: + "405": description: The VM instance could not shut down because it is not started. summary: Shut the VM instance down. /vm.reboot: put: operationId: rebootVM responses: - 204: + "204": description: The VM instance successfully rebooted. - 404: + "404": description: The VM instance could not reboot because it is not created. - 405: + "405": description: The VM instance could not reboot because it is not booted. summary: Reboot the VM instance. /vm.resize: @@ -123,9 +123,9 @@ paths: description: The target size for the VM required: true responses: - 204: + "204": description: The VM instance was successfully resized. - 404: + "404": description: The VM instance could not be resized because it is not created. summary: Resize the VM components: @@ -155,9 +155,13 @@ components: size: 1 disks: - path: path + num_queues: 5 iommu: false + queue_size: 5 - path: path + num_queues: 5 iommu: false + queue_size: 5 cpus: boot_vcpus: 1 max_vcpus: 1 @@ -170,37 +174,37 @@ components: path: path vhost_user_blk: - sock: sock - num_queues: 2 - queue_size: 4 + num_queues: 1 + queue_size: 1 wce: true - sock: sock - num_queues: 2 - queue_size: 4 + num_queues: 1 + queue_size: 1 wce: true rng: iommu: false src: /dev/urandom fs: - sock: sock - num_queues: 5 - queue_size: 5 + num_queues: 9 + queue_size: 3 cache_size: 2 dax: true tag: tag - sock: sock - num_queues: 5 - queue_size: 5 + num_queues: 9 + queue_size: 3 cache_size: 2 dax: true tag: tag vhost_user_net: - sock: sock - num_queues: 9 - queue_size: 3 + num_queues: 7 + queue_size: 1 mac: mac - sock: sock - num_queues: 9 - queue_size: 3 + num_queues: 7 + queue_size: 1 mac: mac vsock: - sock: sock @@ -212,11 +216,11 @@ components: pmem: - mergeable: false file: file - size: 7 + size: 4 iommu: false - mergeable: false file: file - size: 7 + size: 4 iommu: false cmdline: args: args @@ -227,12 +231,20 @@ components: iommu: false net: - tap: tap + num_queues: 2 iommu: false + queue_size: 7 + vhost_socket: vhost_socket + vhost_user: false ip: 192.168.249.1 mac: mac mask: 255.255.255.0 - tap: tap + num_queues: 2 iommu: false + queue_size: 7 + vhost_socket: vhost_socket + vhost_user: false ip: 192.168.249.1 mac: mac mask: 255.255.255.0 @@ -262,9 +274,13 @@ components: size: 1 disks: - path: path + num_queues: 5 iommu: false + queue_size: 5 - path: path + num_queues: 5 iommu: false + queue_size: 5 cpus: boot_vcpus: 1 max_vcpus: 1 @@ -277,37 +293,37 @@ components: path: path vhost_user_blk: - sock: sock - num_queues: 2 - queue_size: 4 + num_queues: 1 + queue_size: 1 wce: true - sock: sock - num_queues: 2 - queue_size: 4 + num_queues: 1 + queue_size: 1 wce: true rng: iommu: false src: /dev/urandom fs: - sock: sock - num_queues: 5 - queue_size: 5 + num_queues: 9 + queue_size: 3 cache_size: 2 dax: true tag: tag - sock: sock - num_queues: 5 - queue_size: 5 + num_queues: 9 + queue_size: 3 cache_size: 2 dax: true tag: tag vhost_user_net: - sock: sock - num_queues: 9 - queue_size: 3 + num_queues: 7 + queue_size: 1 mac: mac - sock: sock - num_queues: 9 - queue_size: 3 + num_queues: 7 + queue_size: 1 mac: mac vsock: - sock: sock @@ -319,11 +335,11 @@ components: pmem: - mergeable: false file: file - size: 7 + size: 4 iommu: false - mergeable: false file: file - size: 7 + size: 4 iommu: false cmdline: args: args @@ -334,12 +350,20 @@ components: iommu: false net: - tap: tap + num_queues: 2 iommu: false + queue_size: 7 + vhost_socket: vhost_socket + vhost_user: false ip: 192.168.249.1 mac: mac mask: 255.255.255.0 - tap: tap + num_queues: 2 iommu: false + queue_size: 7 + vhost_socket: vhost_socket + vhost_user: false ip: 192.168.249.1 mac: mac mask: 255.255.255.0 @@ -452,20 +476,32 @@ components: DiskConfig: example: path: path + num_queues: 5 iommu: false + queue_size: 5 properties: path: type: string iommu: default: false type: boolean + num_queues: + default: 1 + type: integer + queue_size: + default: 128 + type: integer required: - path type: object NetConfig: example: tap: tap + num_queues: 2 iommu: false + queue_size: 7 + vhost_socket: vhost_socket + vhost_user: false ip: 192.168.249.1 mac: mac mask: 255.255.255.0 @@ -484,6 +520,17 @@ components: iommu: default: false type: boolean + num_queues: + default: 2 + type: integer + queue_size: + default: 256 + type: integer + vhost_user: + default: false + type: boolean + vhost_socket: + type: string type: object RngConfig: example: @@ -502,8 +549,8 @@ components: FsConfig: example: sock: sock - num_queues: 5 - queue_size: 5 + num_queues: 9 + queue_size: 3 cache_size: 2 dax: true tag: tag @@ -532,7 +579,7 @@ components: example: mergeable: false file: file - size: 7 + size: 4 iommu: false properties: file: @@ -587,8 +634,8 @@ components: VhostUserNetConfig: example: sock: sock - num_queues: 9 - queue_size: 3 + num_queues: 7 + queue_size: 1 mac: mac properties: sock: @@ -607,8 +654,8 @@ components: VhostUserBlkConfig: example: sock: sock - num_queues: 2 - queue_size: 4 + num_queues: 1 + queue_size: 1 wce: true properties: sock: @@ -649,11 +696,11 @@ components: VmResize: example: desired_vcpus: 1 + desired_ram: 6 properties: desired_vcpus: - default: 1 minimum: 1 type: integer - required: - - desired_vcpus + desired_ram: + type: integer type: object diff --git a/virtcontainers/pkg/cloud-hypervisor/client/api_default.go b/virtcontainers/pkg/cloud-hypervisor/client/api_default.go index 853dde5320..53e0c516be 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/api_default.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/api_default.go @@ -39,7 +39,6 @@ func (a *DefaultApiService) BootVM(ctx _context.Context) (*_nethttp.Response, er // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.boot" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -104,7 +103,6 @@ func (a *DefaultApiService) CreateVM(ctx _context.Context, vmConfig VmConfig) (* // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.create" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -170,7 +168,6 @@ func (a *DefaultApiService) DeleteVM(ctx _context.Context) (*_nethttp.Response, // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.delete" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -234,7 +231,6 @@ func (a *DefaultApiService) PauseVM(ctx _context.Context) (*_nethttp.Response, e // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.pause" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -298,7 +294,6 @@ func (a *DefaultApiService) RebootVM(ctx _context.Context) (*_nethttp.Response, // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.reboot" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -362,7 +357,6 @@ func (a *DefaultApiService) ResumeVM(ctx _context.Context) (*_nethttp.Response, // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.resume" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -426,7 +420,6 @@ func (a *DefaultApiService) ShutdownVM(ctx _context.Context) (*_nethttp.Response // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.shutdown" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -490,7 +483,6 @@ func (a *DefaultApiService) ShutdownVMM(ctx _context.Context) (*_nethttp.Respons // create path and map variables localVarPath := a.client.cfg.BasePath + "/vmm.shutdown" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -556,7 +548,6 @@ func (a *DefaultApiService) VmInfoGet(ctx _context.Context) (VmInfo, *_nethttp.R // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.info" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -639,7 +630,6 @@ func (a *DefaultApiService) VmResizePut(ctx _context.Context, vmResize VmResize) // create path and map variables localVarPath := a.client.cfg.BasePath + "/vm.resize" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} @@ -707,7 +697,6 @@ func (a *DefaultApiService) VmmPingGet(ctx _context.Context) (VmmPingResponse, * // create path and map variables localVarPath := a.client.cfg.BasePath + "/vmm.ping" - localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} diff --git a/virtcontainers/pkg/cloud-hypervisor/client/client.go b/virtcontainers/pkg/cloud-hypervisor/client/client.go index 96f94180d3..d59e15f8d6 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/client.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/client.go @@ -348,6 +348,7 @@ func (c *APIClient) prepareRequest( if auth, ok := ctx.Value(ContextAccessToken).(string); ok { localVarRequest.Header.Add("Authorization", "Bearer "+auth) } + } for header, value := range c.cfg.DefaultHeader { diff --git a/virtcontainers/pkg/cloud-hypervisor/client/configuration.go b/virtcontainers/pkg/cloud-hypervisor/client/configuration.go index 3b215aff70..57ccf85697 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/configuration.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/configuration.go @@ -37,6 +37,7 @@ 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 @@ -51,6 +52,7 @@ type APIKey struct { Prefix string } + // ServerVariable stores the information about a server variable type ServerVariable struct { Description string @@ -84,10 +86,11 @@ func NewConfiguration() *Configuration { DefaultHeader: make(map[string]string), UserAgent: "OpenAPI-Generator/1.0.0/go", Debug: false, - Servers: []ServerConfiguration{{ - Url: "http://localhost/api/v1", - Description: "No description provided", - }, + Servers: []ServerConfiguration{ + { + Url: "http://localhost/api/v1", + Description: "No description provided", + }, }, } return cfg diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md index ed63e161f6..25930b1299 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/DiskConfig.md @@ -6,6 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Path** | **string** | | **Iommu** | **bool** | | [optional] [default to false] +**NumQueues** | **int32** | | [optional] [default to 1] +**QueueSize** | **int32** | | [optional] [default to 128] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md index 7198667688..2caba398a7 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/NetConfig.md @@ -9,6 +9,10 @@ Name | Type | Description | Notes **Mask** | **string** | | [optional] [default to 255.255.255.0] **Mac** | **string** | | [optional] **Iommu** | **bool** | | [optional] [default to false] +**NumQueues** | **int32** | | [optional] [default to 2] +**QueueSize** | **int32** | | [optional] [default to 256] +**VhostUser** | **bool** | | [optional] [default to false] +**VhostSocket** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResize.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResize.md index 240d8fe81e..252a74bbff 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResize.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResize.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DesiredVcpus** | **int32** | | [default to 1] +**DesiredVcpus** | **int32** | | [optional] +**DesiredRam** | **int32** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/go.mod b/virtcontainers/pkg/cloud-hypervisor/client/go.mod index 1af1846f98..f55c1461f8 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/go.mod +++ b/virtcontainers/pkg/cloud-hypervisor/client/go.mod @@ -3,4 +3,5 @@ module github.com/GIT_USER_ID/GIT_REPO_ID require ( github.com/antihax/optional v1.0.0 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + ) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/go.sum b/virtcontainers/pkg/cloud-hypervisor/client/go.sum index ce55b3c6a0..ee69520229 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/go.sum +++ b/virtcontainers/pkg/cloud-hypervisor/client/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= +github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go index f578ac4e0a..7a34362203 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_disk_config.go @@ -12,4 +12,6 @@ package openapi type DiskConfig struct { Path string `json:"path"` Iommu bool `json:"iommu,omitempty"` + NumQueues int32 `json:"num_queues,omitempty"` + QueueSize int32 `json:"queue_size,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go index e4c0c08b08..04626ce978 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go @@ -15,4 +15,8 @@ type NetConfig struct { 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"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go index 3139da6405..0747108e3c 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go @@ -10,5 +10,6 @@ package openapi // VmResize struct for VmResize type VmResize struct { - DesiredVcpus int32 `json:"desired_vcpus"` + DesiredVcpus int32 `json:"desired_vcpus,omitempty"` + DesiredRam int32 `json:"desired_ram,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml b/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml index b23bfff630..c9a1192a0e 100644 --- a/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml +++ b/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml @@ -277,6 +277,12 @@ components: iommu: type: boolean default: false + num_queues: + type: integer + default: 1 + queue_size: + type: integer + default: 128 NetConfig: type: object @@ -295,6 +301,17 @@ components: iommu: type: boolean default: false + num_queues: + type: integer + default: 2 + queue_size: + type: integer + default: 256 + vhost_user: + type: boolean + default: false + vhost_socket: + type: string RngConfig: required: @@ -427,11 +444,10 @@ components: default: false VmResize: - required: - - desired_vcpus type: object properties: desired_vcpus: minimum: 1 - default: 1 + type: integer + desired_ram: type: integer