diff --git a/versions.yaml b/versions.yaml index d25f83719..bacfb0749 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: "df794993f8abe20f829275c77fb2a52ed485f70a" + version: "c1e6d0022b220ecba25a10f61d0025a408d90a94" firecracker: description: "Firecracker micro-VMM" diff --git a/virtcontainers/pkg/cloud-hypervisor/client/README.md b/virtcontainers/pkg/cloud-hypervisor/client/README.md index 8872c9ecd..c6b967cd2 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/README.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/README.md @@ -42,6 +42,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**ShutdownVMM**](docs/DefaultApi.md#shutdownvmm) | **Put** /vmm.shutdown | Shuts the cloud-hypervisor VMM. *DefaultApi* | [**VmAddDevicePut**](docs/DefaultApi.md#vmadddeviceput) | **Put** /vm.add-device | Add a new device to the VM *DefaultApi* | [**VmInfoGet**](docs/DefaultApi.md#vminfoget) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance. +*DefaultApi* | [**VmRemoveDevicePut**](docs/DefaultApi.md#vmremovedeviceput) | **Put** /vm.remove-device | Remove a device from the VM *DefaultApi* | [**VmResizePut**](docs/DefaultApi.md#vmresizeput) | **Put** /vm.resize | Resize the VM *DefaultApi* | [**VmmPingGet**](docs/DefaultApi.md#vmmpingget) | **Get** /vmm.ping | Ping the VMM to check for API server availability @@ -62,6 +63,7 @@ Class | Method | HTTP request | Description - [VmAddDevice](docs/VmAddDevice.md) - [VmConfig](docs/VmConfig.md) - [VmInfo](docs/VmInfo.md) + - [VmRemoveDevice](docs/VmRemoveDevice.md) - [VmResize](docs/VmResize.md) - [VmmPingResponse](docs/VmmPingResponse.md) - [VsockConfig](docs/VsockConfig.md) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml b/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml index d9da94bc9..5dcc8f25a 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml +++ b/virtcontainers/pkg/cloud-hypervisor/client/api/openapi.yaml @@ -143,6 +143,21 @@ paths: "404": description: The new device could not be added to the VM instance. summary: Add a new device to the VM + /vm.remove-device: + put: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VmRemoveDevice' + description: The identifier of the device + required: true + responses: + "204": + description: The device was successfully removed from the VM instance. + "404": + description: The device could not be removed from the VM instance. + summary: Remove a device from the VM components: schemas: VmmPingResponse: @@ -168,12 +183,13 @@ components: mergeable: false file: file size: 1 + hotplug_size: 5 disks: - path: path num_queues: 5 readonly: false iommu: false - queue_size: 5 + queue_size: 2 vhost_socket: vhost_socket vhost_user: false direct: false @@ -183,7 +199,7 @@ components: num_queues: 5 readonly: false iommu: false - queue_size: 5 + queue_size: 2 vhost_socket: vhost_socket vhost_user: false direct: false @@ -195,8 +211,10 @@ components: devices: - path: path iommu: false + id: id - path: path iommu: false + id: id kernel: path: path rng: @@ -204,15 +222,15 @@ components: src: /dev/urandom fs: - sock: sock - num_queues: 9 - queue_size: 3 - cache_size: 2 + num_queues: 3 + queue_size: 2 + cache_size: 4 dax: true tag: tag - sock: sock - num_queues: 9 - queue_size: 3 - cache_size: 2 + num_queues: 3 + queue_size: 2 + cache_size: 4 dax: true tag: tag vsock: @@ -225,12 +243,14 @@ components: pmem: - mergeable: false file: file - size: 4 + size: 7 iommu: false + discard_writes: false - mergeable: false file: file - size: 4 + size: 7 iommu: false + discard_writes: false cmdline: args: args iommu: false @@ -240,18 +260,18 @@ components: iommu: false net: - tap: tap - num_queues: 2 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 9 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 mac: mac mask: 255.255.255.0 - tap: tap - num_queues: 2 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 9 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -282,12 +302,13 @@ components: mergeable: false file: file size: 1 + hotplug_size: 5 disks: - path: path num_queues: 5 readonly: false iommu: false - queue_size: 5 + queue_size: 2 vhost_socket: vhost_socket vhost_user: false direct: false @@ -297,7 +318,7 @@ components: num_queues: 5 readonly: false iommu: false - queue_size: 5 + queue_size: 2 vhost_socket: vhost_socket vhost_user: false direct: false @@ -309,8 +330,10 @@ components: devices: - path: path iommu: false + id: id - path: path iommu: false + id: id kernel: path: path rng: @@ -318,15 +341,15 @@ components: src: /dev/urandom fs: - sock: sock - num_queues: 9 - queue_size: 3 - cache_size: 2 + num_queues: 3 + queue_size: 2 + cache_size: 4 dax: true tag: tag - sock: sock - num_queues: 9 - queue_size: 3 - cache_size: 2 + num_queues: 3 + queue_size: 2 + cache_size: 4 dax: true tag: tag vsock: @@ -339,12 +362,14 @@ components: pmem: - mergeable: false file: file - size: 4 + size: 7 iommu: false + discard_writes: false - mergeable: false file: file - size: 4 + size: 7 iommu: false + discard_writes: false cmdline: args: args iommu: false @@ -354,18 +379,18 @@ components: iommu: false net: - tap: tap - num_queues: 2 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 9 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 mac: mac mask: 255.255.255.0 - tap: tap - num_queues: 2 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 9 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -439,10 +464,14 @@ components: mergeable: false file: file size: 1 + hotplug_size: 5 properties: size: format: int64 type: integer + hotplug_size: + format: int64 + type: integer file: type: string mergeable: @@ -475,7 +504,7 @@ components: num_queues: 5 readonly: false iommu: false - queue_size: 5 + queue_size: 2 vhost_socket: vhost_socket vhost_user: false direct: false @@ -516,9 +545,9 @@ components: NetConfig: example: tap: tap - num_queues: 2 + num_queues: 7 iommu: false - queue_size: 7 + queue_size: 9 vhost_socket: vhost_socket vhost_user: false ip: 192.168.249.1 @@ -568,9 +597,9 @@ components: FsConfig: example: sock: sock - num_queues: 9 - queue_size: 3 - cache_size: 2 + num_queues: 3 + queue_size: 2 + cache_size: 4 dax: true tag: tag properties: @@ -598,8 +627,9 @@ components: example: mergeable: false file: file - size: 4 + size: 7 iommu: false + discard_writes: false properties: file: type: string @@ -612,6 +642,9 @@ components: mergeable: default: false type: boolean + discard_writes: + default: false + type: boolean required: - file - size @@ -641,12 +674,15 @@ components: example: path: path iommu: false + id: id properties: path: type: string iommu: default: false type: boolean + id: + type: string required: - path type: object @@ -680,6 +716,8 @@ components: minimum: 1 type: integer desired_ram: + description: desired memory ram in bytes + format: int64 type: integer type: object VmAddDevice: @@ -689,3 +727,10 @@ components: path: type: string type: object + VmRemoveDevice: + example: + id: id + properties: + id: + type: string + type: object diff --git a/virtcontainers/pkg/cloud-hypervisor/client/api_default.go b/virtcontainers/pkg/cloud-hypervisor/client/api_default.go index c73202bf7..87da4ded9 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/api_default.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/api_default.go @@ -680,6 +680,72 @@ func (a *DefaultApiService) VmInfoGet(ctx _context.Context) (VmInfo, *_nethttp.R return localVarReturnValue, localVarHTTPResponse, nil } +/* +VmRemoveDevicePut Remove a device from the VM + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param vmRemoveDevice The identifier of the device +*/ +func (a *DefaultApiService) VmRemoveDevicePut(ctx _context.Context, vmRemoveDevice VmRemoveDevice) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/vm.remove-device" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &vmRemoveDevice + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + /* VmResizePut Resize the VM * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md index 74c9e3a3f..3aafd1396 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/DefaultApi.md @@ -14,6 +14,7 @@ Method | HTTP request | Description [**ShutdownVMM**](DefaultApi.md#ShutdownVMM) | **Put** /vmm.shutdown | Shuts the cloud-hypervisor VMM. [**VmAddDevicePut**](DefaultApi.md#VmAddDevicePut) | **Put** /vm.add-device | Add a new device to the VM [**VmInfoGet**](DefaultApi.md#VmInfoGet) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance. +[**VmRemoveDevicePut**](DefaultApi.md#VmRemoveDevicePut) | **Put** /vm.remove-device | Remove a device from the VM [**VmResizePut**](DefaultApi.md#VmResizePut) | **Put** /vm.resize | Resize the VM [**VmmPingGet**](DefaultApi.md#VmmPingGet) | **Get** /vmm.ping | Ping the VMM to check for API server availability @@ -307,6 +308,38 @@ No authorization required [[Back to README]](../README.md) +## VmRemoveDevicePut + +> VmRemoveDevicePut(ctx, vmRemoveDevice) + +Remove a device from the VM + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vmRemoveDevice** | [**VmRemoveDevice**](VmRemoveDevice.md)| The identifier of the device | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## VmResizePut > VmResizePut(ctx, vmResize) diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/DeviceConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/DeviceConfig.md index 8408a8d56..b3fd114bd 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/DeviceConfig.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/DeviceConfig.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Path** | **string** | | **Iommu** | **bool** | | [optional] [default to false] +**Id** | **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/MemoryConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md index caf872056..493419008 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/MemoryConfig.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Size** | **int64** | | +**HotplugSize** | **int64** | | [optional] **File** | **string** | | [optional] **Mergeable** | **bool** | | [optional] [default to false] diff --git a/virtcontainers/pkg/cloud-hypervisor/client/docs/PmemConfig.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/PmemConfig.md index 62d7164e9..a84de72ae 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/PmemConfig.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/PmemConfig.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Size** | **int64** | | **Iommu** | **bool** | | [optional] [default to false] **Mergeable** | **bool** | | [optional] [default to false] +**DiscardWrites** | **bool** | | [optional] [default to false] [[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/VmRemoveDevice.md b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmRemoveDevice.md new file mode 100644 index 000000000..07c5a78f1 --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmRemoveDevice.md @@ -0,0 +1,11 @@ +# VmRemoveDevice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **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 252a74bbf..0adf6f716 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResize.md +++ b/virtcontainers/pkg/cloud-hypervisor/client/docs/VmResize.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **DesiredVcpus** | **int32** | | [optional] -**DesiredRam** | **int32** | | [optional] +**DesiredRam** | **int64** | desired memory ram in bytes | [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/model_device_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_device_config.go index 4f2ab08ec..d0fa7d6e1 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_device_config.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_device_config.go @@ -12,4 +12,5 @@ package openapi type DeviceConfig struct { Path string `json:"path"` Iommu bool `json:"iommu,omitempty"` + Id string `json:"id,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go index ad1a88881..e96e90320 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_memory_config.go @@ -11,6 +11,7 @@ package openapi // MemoryConfig struct for MemoryConfig type MemoryConfig struct { Size int64 `json:"size"` + HotplugSize int64 `json:"hotplug_size,omitempty"` File string `json:"file,omitempty"` Mergeable bool `json:"mergeable,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go b/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go index 4732ce997..a1a26ff77 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_pmem_config.go @@ -14,4 +14,5 @@ type PmemConfig struct { Size int64 `json:"size"` Iommu bool `json:"iommu,omitempty"` Mergeable bool `json:"mergeable,omitempty"` + DiscardWrites bool `json:"discard_writes,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_remove_device.go b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_remove_device.go new file mode 100644 index 000000000..4a0cb6cf2 --- /dev/null +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_remove_device.go @@ -0,0 +1,14 @@ +/* + * Cloud Hypervisor API + * + * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine. + * + * API version: 0.3.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi +// VmRemoveDevice struct for VmRemoveDevice +type VmRemoveDevice struct { + Id string `json:"id,omitempty"` +} diff --git a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go index 0747108e3..ec0e4e9db 100644 --- a/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go +++ b/virtcontainers/pkg/cloud-hypervisor/client/model_vm_resize.go @@ -11,5 +11,6 @@ package openapi // VmResize struct for VmResize type VmResize struct { DesiredVcpus int32 `json:"desired_vcpus,omitempty"` - DesiredRam int32 `json:"desired_ram,omitempty"` + // desired memory ram in bytes + DesiredRam int64 `json:"desired_ram,omitempty"` } diff --git a/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml b/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml index fdbc08867..fb3ec6dc6 100644 --- a/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml +++ b/virtcontainers/pkg/cloud-hypervisor/cloud-hypervisor.yaml @@ -155,6 +155,22 @@ paths: 404: description: The new device could not be added to the VM instance. + /vm.remove-device: + put: + summary: Remove a device from the VM + requestBody: + description: The identifier of the device + content: + application/json: + schema: + $ref: '#/components/schemas/VmRemoveDevice' + required: true + responses: + 204: + description: The device was successfully removed from the VM instance. + 404: + description: The device could not be removed from the VM instance. + components: schemas: @@ -253,6 +269,9 @@ components: type: integer format: int64 default: 512 MB + hotplug_size: + type: integer + format: int64 file: type: string mergeable: @@ -391,6 +410,9 @@ components: mergeable: type: boolean default: false + discard_writes: + type: boolean + default: false ConsoleConfig: required: @@ -416,6 +438,8 @@ components: iommu: type: boolean default: false + id: + type: string VsockConfig: required: @@ -442,10 +466,18 @@ components: minimum: 1 type: integer desired_ram: + description: desired memory ram in bytes type: integer + format: int64 VmAddDevice: type: object properties: path: type: string + + VmRemoveDevice: + type: object + properties: + id: + type: string