runtime: Update cloud-hypervisor client pkg to version v0.10.0

The latest release of cloud-hypervisor v0.10.0 contains the following
updates: 1) `virtio-block` Support for Multiple Descriptors; 2) Memory
Zones; 3) `Seccomp` Sandbox Improvements; 4) Preliminary KVM HyperV
Emulation Control; 5) various bug fixes and refactoring.

Note that this patch updates the client code of clh's HTTP API in kata,
while the 'versions.yaml' file was updated in an earlier PR.

Fixes: #789

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2020-09-23 17:05:05 -07:00
parent 952b9fe856
commit a34478ffa5
18 changed files with 647 additions and 58 deletions

View File

@ -17,7 +17,10 @@ docs/FsConfig.md
docs/InitramfsConfig.md docs/InitramfsConfig.md
docs/KernelConfig.md docs/KernelConfig.md
docs/MemoryConfig.md docs/MemoryConfig.md
docs/MemoryZoneConfig.md
docs/NetConfig.md docs/NetConfig.md
docs/NumaConfig.md
docs/NumaDistance.md
docs/PciDeviceInfo.md docs/PciDeviceInfo.md
docs/PmemConfig.md docs/PmemConfig.md
docs/RestoreConfig.md docs/RestoreConfig.md
@ -28,6 +31,7 @@ docs/VmConfig.md
docs/VmInfo.md docs/VmInfo.md
docs/VmRemoveDevice.md docs/VmRemoveDevice.md
docs/VmResize.md docs/VmResize.md
docs/VmResizeZone.md
docs/VmSnapshotConfig.md docs/VmSnapshotConfig.md
docs/VmmPingResponse.md docs/VmmPingResponse.md
docs/VsockConfig.md docs/VsockConfig.md
@ -44,7 +48,10 @@ model_fs_config.go
model_initramfs_config.go model_initramfs_config.go
model_kernel_config.go model_kernel_config.go
model_memory_config.go model_memory_config.go
model_memory_zone_config.go
model_net_config.go model_net_config.go
model_numa_config.go
model_numa_distance.go
model_pci_device_info.go model_pci_device_info.go
model_pmem_config.go model_pmem_config.go
model_restore_config.go model_restore_config.go
@ -55,6 +62,7 @@ model_vm_config.go
model_vm_info.go model_vm_info.go
model_vm_remove_device.go model_vm_remove_device.go
model_vm_resize.go model_vm_resize.go
model_vm_resize_zone.go
model_vm_snapshot_config.go model_vm_snapshot_config.go
model_vmm_ping_response.go model_vmm_ping_response.go
model_vsock_config.go model_vsock_config.go

View File

@ -50,6 +50,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**VmInfoGet**](docs/DefaultApi.md#vminfoget) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance. *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* | [**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* | [**VmResizePut**](docs/DefaultApi.md#vmresizeput) | **Put** /vm.resize | Resize the VM
*DefaultApi* | [**VmResizeZonePut**](docs/DefaultApi.md#vmresizezoneput) | **Put** /vm.resize-zone | Resize a memory zone
*DefaultApi* | [**VmRestorePut**](docs/DefaultApi.md#vmrestoreput) | **Put** /vm.restore | Restore a VM from a snapshot. *DefaultApi* | [**VmRestorePut**](docs/DefaultApi.md#vmrestoreput) | **Put** /vm.restore | Restore a VM from a snapshot.
*DefaultApi* | [**VmSnapshotPut**](docs/DefaultApi.md#vmsnapshotput) | **Put** /vm.snapshot | Returns a VM snapshot. *DefaultApi* | [**VmSnapshotPut**](docs/DefaultApi.md#vmsnapshotput) | **Put** /vm.snapshot | Returns a VM snapshot.
*DefaultApi* | [**VmmPingGet**](docs/DefaultApi.md#vmmpingget) | **Get** /vmm.ping | Ping the VMM to check for API server availability *DefaultApi* | [**VmmPingGet**](docs/DefaultApi.md#vmmpingget) | **Get** /vmm.ping | Ping the VMM to check for API server availability
@ -67,7 +68,10 @@ Class | Method | HTTP request | Description
- [InitramfsConfig](docs/InitramfsConfig.md) - [InitramfsConfig](docs/InitramfsConfig.md)
- [KernelConfig](docs/KernelConfig.md) - [KernelConfig](docs/KernelConfig.md)
- [MemoryConfig](docs/MemoryConfig.md) - [MemoryConfig](docs/MemoryConfig.md)
- [MemoryZoneConfig](docs/MemoryZoneConfig.md)
- [NetConfig](docs/NetConfig.md) - [NetConfig](docs/NetConfig.md)
- [NumaConfig](docs/NumaConfig.md)
- [NumaDistance](docs/NumaDistance.md)
- [PciDeviceInfo](docs/PciDeviceInfo.md) - [PciDeviceInfo](docs/PciDeviceInfo.md)
- [PmemConfig](docs/PmemConfig.md) - [PmemConfig](docs/PmemConfig.md)
- [RestoreConfig](docs/RestoreConfig.md) - [RestoreConfig](docs/RestoreConfig.md)
@ -78,6 +82,7 @@ Class | Method | HTTP request | Description
- [VmInfo](docs/VmInfo.md) - [VmInfo](docs/VmInfo.md)
- [VmRemoveDevice](docs/VmRemoveDevice.md) - [VmRemoveDevice](docs/VmRemoveDevice.md)
- [VmResize](docs/VmResize.md) - [VmResize](docs/VmResize.md)
- [VmResizeZone](docs/VmResizeZone.md)
- [VmSnapshotConfig](docs/VmSnapshotConfig.md) - [VmSnapshotConfig](docs/VmSnapshotConfig.md)
- [VmmPingResponse](docs/VmmPingResponse.md) - [VmmPingResponse](docs/VmmPingResponse.md)
- [VsockConfig](docs/VsockConfig.md) - [VsockConfig](docs/VsockConfig.md)

View File

@ -138,6 +138,21 @@ paths:
"404": "404":
description: The VM instance could not be resized because it is not created. description: The VM instance could not be resized because it is not created.
summary: Resize the VM summary: Resize the VM
/vm.resize-zone:
put:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/VmResizeZone'
description: The target size for the memory zone
required: true
responses:
"204":
description: The memory zone was successfully resized.
"500":
description: The memory zone could not be resized.
summary: Resize a memory zone
/vm.add-device: /vm.add-device:
put: put:
requestBody: requestBody:
@ -328,26 +343,46 @@ components:
shared: false shared: false
mergeable: false mergeable: false
balloon: false balloon: false
file: file
size: 7 size: 7
hotplugged_size: 3
zones:
- hugepages: false
shared: false
mergeable: false
file: file
size: 4
hotplugged_size: 1
host_numa_node: 7
id: id
hotplug_size: 1
- hugepages: false
shared: false
mergeable: false
file: file
size: 4
hotplugged_size: 1
host_numa_node: 7
id: id
hotplug_size: 1
hotplug_size: 9 hotplug_size: 9
hotplug_method: acpi hotplug_method: acpi
balloon_size: 2
disks: disks:
- path: path - path: path
num_queues: 3 num_queues: 1
readonly: false readonly: false
iommu: false iommu: false
queue_size: 2 queue_size: 6
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
direct: false direct: false
poll_queue: true poll_queue: true
id: id id: id
- path: path - path: path
num_queues: 3 num_queues: 1
readonly: false readonly: false
iommu: false iommu: false
queue_size: 2 queue_size: 6
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
direct: false direct: false
@ -370,25 +405,50 @@ components:
id: id id: id
kernel: kernel:
path: path path: path
numa:
- distances:
- distance: 6
destination: 3
- distance: 6
destination: 3
cpus:
- 6
- 6
memory_zones:
- memory_zones
- memory_zones
guest_numa_id: 9
- distances:
- distance: 6
destination: 3
- distance: 6
destination: 3
cpus:
- 6
- 6
memory_zones:
- memory_zones
- memory_zones
guest_numa_id: 9
rng: rng:
iommu: false iommu: false
src: /dev/urandom src: /dev/urandom
sgx_epc: sgx_epc:
- prefault: false - prefault: false
size: 1 size: 8
- prefault: false - prefault: false
size: 1 size: 8
fs: fs:
- num_queues: 1 - num_queues: 4
queue_size: 1 queue_size: 5
cache_size: 1 cache_size: 9
dax: true dax: true
tag: tag tag: tag
socket: socket socket: socket
id: id id: id
- num_queues: 1 - num_queues: 4
queue_size: 1 queue_size: 5
cache_size: 1 cache_size: 9
dax: true dax: true
tag: tag tag: tag
socket: socket socket: socket
@ -401,13 +461,13 @@ components:
pmem: pmem:
- mergeable: false - mergeable: false
file: file file: file
size: 6 size: 9
iommu: false iommu: false
id: id id: id
discard_writes: false discard_writes: false
- mergeable: false - mergeable: false
file: file file: file
size: 6 size: 9
iommu: false iommu: false
id: id id: id
discard_writes: false discard_writes: false
@ -422,9 +482,9 @@ components:
path: path path: path
net: net:
- tap: tap - tap: tap
num_queues: 4 num_queues: 7
iommu: false iommu: false
queue_size: 7 queue_size: 1
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
ip: 192.168.249.1 ip: 192.168.249.1
@ -432,9 +492,9 @@ components:
mac: mac mac: mac
mask: 255.255.255.0 mask: 255.255.255.0
- tap: tap - tap: tap
num_queues: 4 num_queues: 7
iommu: false iommu: false
queue_size: 7 queue_size: 1
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
ip: 192.168.249.1 ip: 192.168.249.1
@ -488,26 +548,46 @@ components:
shared: false shared: false
mergeable: false mergeable: false
balloon: false balloon: false
file: file
size: 7 size: 7
hotplugged_size: 3
zones:
- hugepages: false
shared: false
mergeable: false
file: file
size: 4
hotplugged_size: 1
host_numa_node: 7
id: id
hotplug_size: 1
- hugepages: false
shared: false
mergeable: false
file: file
size: 4
hotplugged_size: 1
host_numa_node: 7
id: id
hotplug_size: 1
hotplug_size: 9 hotplug_size: 9
hotplug_method: acpi hotplug_method: acpi
balloon_size: 2
disks: disks:
- path: path - path: path
num_queues: 3 num_queues: 1
readonly: false readonly: false
iommu: false iommu: false
queue_size: 2 queue_size: 6
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
direct: false direct: false
poll_queue: true poll_queue: true
id: id id: id
- path: path - path: path
num_queues: 3 num_queues: 1
readonly: false readonly: false
iommu: false iommu: false
queue_size: 2 queue_size: 6
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
direct: false direct: false
@ -530,25 +610,50 @@ components:
id: id id: id
kernel: kernel:
path: path path: path
numa:
- distances:
- distance: 6
destination: 3
- distance: 6
destination: 3
cpus:
- 6
- 6
memory_zones:
- memory_zones
- memory_zones
guest_numa_id: 9
- distances:
- distance: 6
destination: 3
- distance: 6
destination: 3
cpus:
- 6
- 6
memory_zones:
- memory_zones
- memory_zones
guest_numa_id: 9
rng: rng:
iommu: false iommu: false
src: /dev/urandom src: /dev/urandom
sgx_epc: sgx_epc:
- prefault: false - prefault: false
size: 1 size: 8
- prefault: false - prefault: false
size: 1 size: 8
fs: fs:
- num_queues: 1 - num_queues: 4
queue_size: 1 queue_size: 5
cache_size: 1 cache_size: 9
dax: true dax: true
tag: tag tag: tag
socket: socket socket: socket
id: id id: id
- num_queues: 1 - num_queues: 4
queue_size: 1 queue_size: 5
cache_size: 1 cache_size: 9
dax: true dax: true
tag: tag tag: tag
socket: socket socket: socket
@ -561,13 +666,13 @@ components:
pmem: pmem:
- mergeable: false - mergeable: false
file: file file: file
size: 6 size: 9
iommu: false iommu: false
id: id id: id
discard_writes: false discard_writes: false
- mergeable: false - mergeable: false
file: file file: file
size: 6 size: 9
iommu: false iommu: false
id: id id: id
discard_writes: false discard_writes: false
@ -582,9 +687,9 @@ components:
path: path path: path
net: net:
- tap: tap - tap: tap
num_queues: 4 num_queues: 7
iommu: false iommu: false
queue_size: 7 queue_size: 1
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
ip: 192.168.249.1 ip: 192.168.249.1
@ -592,9 +697,9 @@ components:
mac: mac mac: mac
mask: 255.255.255.0 mask: 255.255.255.0
- tap: tap - tap: tap
num_queues: 4 num_queues: 7
iommu: false iommu: false
queue_size: 7 queue_size: 1
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
ip: 192.168.249.1 ip: 192.168.249.1
@ -644,11 +749,14 @@ components:
items: items:
$ref: '#/components/schemas/SgxEpcConfig' $ref: '#/components/schemas/SgxEpcConfig'
type: array type: array
numa:
items:
$ref: '#/components/schemas/NumaConfig'
type: array
iommu: iommu:
default: false default: false
type: boolean type: boolean
required: required:
- cmdline
- kernel - kernel
type: object type: object
CpuTopology: CpuTopology:
@ -691,16 +799,77 @@ components:
- boot_vcpus - boot_vcpus
- max_vcpus - max_vcpus
type: object type: object
MemoryZoneConfig:
example:
hugepages: false
shared: false
mergeable: false
file: file
size: 4
hotplugged_size: 1
host_numa_node: 7
id: id
hotplug_size: 1
properties:
id:
type: string
size:
format: int64
type: integer
file:
type: string
mergeable:
default: false
type: boolean
shared:
default: false
type: boolean
hugepages:
default: false
type: boolean
host_numa_node:
format: uint32
type: integer
hotplug_size:
format: int64
type: integer
hotplugged_size:
format: int64
type: integer
required:
- id
- size
type: object
MemoryConfig: MemoryConfig:
example: example:
hugepages: false hugepages: false
shared: false shared: false
mergeable: false mergeable: false
balloon: false balloon: false
file: file
size: 7 size: 7
hotplugged_size: 3
zones:
- hugepages: false
shared: false
mergeable: false
file: file
size: 4
hotplugged_size: 1
host_numa_node: 7
id: id
hotplug_size: 1
- hugepages: false
shared: false
mergeable: false
file: file
size: 4
hotplugged_size: 1
host_numa_node: 7
id: id
hotplug_size: 1
hotplug_size: 9 hotplug_size: 9
hotplug_method: acpi hotplug_method: acpi
balloon_size: 2
properties: properties:
size: size:
format: int64 format: int64
@ -708,8 +877,9 @@ components:
hotplug_size: hotplug_size:
format: int64 format: int64
type: integer type: integer
file: hotplugged_size:
type: string format: int64
type: integer
mergeable: mergeable:
default: false default: false
type: boolean type: boolean
@ -725,6 +895,13 @@ components:
balloon: balloon:
default: false default: false
type: boolean type: boolean
balloon_size:
format: uint64
type: integer
zones:
items:
$ref: '#/components/schemas/MemoryZoneConfig'
type: array
required: required:
- size - size
type: object type: object
@ -759,10 +936,10 @@ components:
DiskConfig: DiskConfig:
example: example:
path: path path: path
num_queues: 3 num_queues: 1
readonly: false readonly: false
iommu: false iommu: false
queue_size: 2 queue_size: 6
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
direct: false direct: false
@ -802,9 +979,9 @@ components:
NetConfig: NetConfig:
example: example:
tap: tap tap: tap
num_queues: 4 num_queues: 7
iommu: false iommu: false
queue_size: 7 queue_size: 1
vhost_socket: vhost_socket vhost_socket: vhost_socket
vhost_user: false vhost_user: false
ip: 192.168.249.1 ip: 192.168.249.1
@ -856,9 +1033,9 @@ components:
type: object type: object
FsConfig: FsConfig:
example: example:
num_queues: 1 num_queues: 4
queue_size: 1 queue_size: 5
cache_size: 1 cache_size: 9
dax: true dax: true
tag: tag tag: tag
socket: socket socket: socket
@ -890,7 +1067,7 @@ components:
example: example:
mergeable: false mergeable: false
file: file file: file
size: 6 size: 9
iommu: false iommu: false
id: id id: id
discard_writes: false discard_writes: false
@ -978,7 +1155,7 @@ components:
SgxEpcConfig: SgxEpcConfig:
example: example:
prefault: false prefault: false
size: 1 size: 8
properties: properties:
size: size:
format: uint64 format: uint64
@ -989,6 +1166,55 @@ components:
required: required:
- size - size
type: object type: object
NumaDistance:
example:
distance: 6
destination: 3
properties:
destination:
format: uint32
type: integer
distance:
format: uint8
type: integer
required:
- destination
- distance
type: object
NumaConfig:
example:
distances:
- distance: 6
destination: 3
- distance: 6
destination: 3
cpus:
- 6
- 6
memory_zones:
- memory_zones
- memory_zones
guest_numa_id: 9
properties:
guest_numa_id:
format: uint32
type: integer
cpus:
items:
format: uint8
type: integer
type: array
distances:
items:
$ref: '#/components/schemas/NumaDistance'
type: array
memory_zones:
items:
type: string
type: array
required:
- guest_numa_id
type: object
VmResize: VmResize:
example: example:
desired_vcpus: 1 desired_vcpus: 1
@ -1007,6 +1233,18 @@ components:
format: int64 format: int64
type: integer type: integer
type: object type: object
VmResizeZone:
example:
id: id
desired_ram: 0
properties:
id:
type: string
desired_ram:
description: desired memory zone size in bytes
format: int64
type: integer
type: object
VmAddDevice: VmAddDevice:
example: example:
path: path path: path

View File

@ -1292,6 +1292,73 @@ func (a *DefaultApiService) VmResizePut(ctx _context.Context, vmResize VmResize)
return localVarHTTPResponse, nil return localVarHTTPResponse, nil
} }
/*
VmResizeZonePut Resize a memory zone
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param vmResizeZone The target size for the memory zone
*/
func (a *DefaultApiService) VmResizeZonePut(ctx _context.Context, vmResizeZone VmResizeZone) (*_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.resize-zone"
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 = &vmResizeZone
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()
localVarHTTPResponse.Body = _ioutil.NopCloser(_bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
/* /*
VmRestorePut Restore a VM from a snapshot. VmRestorePut Restore a VM from a snapshot.
* @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

View File

@ -22,6 +22,7 @@ Method | HTTP request | Description
[**VmInfoGet**](DefaultApi.md#VmInfoGet) | **Get** /vm.info | Returns general information about the cloud-hypervisor Virtual Machine (VM) instance. [**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 [**VmRemoveDevicePut**](DefaultApi.md#VmRemoveDevicePut) | **Put** /vm.remove-device | Remove a device from the VM
[**VmResizePut**](DefaultApi.md#VmResizePut) | **Put** /vm.resize | Resize the VM [**VmResizePut**](DefaultApi.md#VmResizePut) | **Put** /vm.resize | Resize the VM
[**VmResizeZonePut**](DefaultApi.md#VmResizeZonePut) | **Put** /vm.resize-zone | Resize a memory zone
[**VmRestorePut**](DefaultApi.md#VmRestorePut) | **Put** /vm.restore | Restore a VM from a snapshot. [**VmRestorePut**](DefaultApi.md#VmRestorePut) | **Put** /vm.restore | Restore a VM from a snapshot.
[**VmSnapshotPut**](DefaultApi.md#VmSnapshotPut) | **Put** /vm.snapshot | Returns a VM snapshot. [**VmSnapshotPut**](DefaultApi.md#VmSnapshotPut) | **Put** /vm.snapshot | Returns a VM snapshot.
[**VmmPingGet**](DefaultApi.md#VmmPingGet) | **Get** /vmm.ping | Ping the VMM to check for API server availability [**VmmPingGet**](DefaultApi.md#VmmPingGet) | **Get** /vmm.ping | Ping the VMM to check for API server availability
@ -568,6 +569,38 @@ No authorization required
[[Back to README]](../README.md) [[Back to README]](../README.md)
## VmResizeZonePut
> VmResizeZonePut(ctx, vmResizeZone)
Resize a memory zone
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**vmResizeZone** | [**VmResizeZone**](VmResizeZone.md)| The target size for the memory zone |
### 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)
## VmRestorePut ## VmRestorePut
> VmRestorePut(ctx, restoreConfig) > VmRestorePut(ctx, restoreConfig)

View File

@ -6,12 +6,14 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Size** | **int64** | | **Size** | **int64** | |
**HotplugSize** | **int64** | | [optional] **HotplugSize** | **int64** | | [optional]
**File** | **string** | | [optional] **HotpluggedSize** | **int64** | | [optional]
**Mergeable** | **bool** | | [optional] [default to false] **Mergeable** | **bool** | | [optional] [default to false]
**HotplugMethod** | **string** | | [optional] [default to acpi] **HotplugMethod** | **string** | | [optional] [default to acpi]
**Shared** | **bool** | | [optional] [default to false] **Shared** | **bool** | | [optional] [default to false]
**Hugepages** | **bool** | | [optional] [default to false] **Hugepages** | **bool** | | [optional] [default to false]
**Balloon** | **bool** | | [optional] [default to false] **Balloon** | **bool** | | [optional] [default to false]
**BalloonSize** | **int32** | | [optional]
**Zones** | [**[]MemoryZoneConfig**](MemoryZoneConfig.md) | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,19 @@
# MemoryZoneConfig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | |
**Size** | **int64** | |
**File** | **string** | | [optional]
**Mergeable** | **bool** | | [optional] [default to false]
**Shared** | **bool** | | [optional] [default to false]
**Hugepages** | **bool** | | [optional] [default to false]
**HostNumaNode** | **int32** | | [optional]
**HotplugSize** | **int64** | | [optional]
**HotpluggedSize** | **int64** | | [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)

View File

@ -0,0 +1,14 @@
# NumaConfig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**GuestNumaId** | **int32** | |
**Cpus** | **[]int32** | | [optional]
**Distances** | [**[]NumaDistance**](NumaDistance.md) | | [optional]
**MemoryZones** | **[]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)

View File

@ -0,0 +1,12 @@
# NumaDistance
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Destination** | **int32** | |
**Distance** | **int32** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -8,7 +8,7 @@ Name | Type | Description | Notes
**Memory** | [**MemoryConfig**](MemoryConfig.md) | | [optional] **Memory** | [**MemoryConfig**](MemoryConfig.md) | | [optional]
**Kernel** | [**KernelConfig**](KernelConfig.md) | | **Kernel** | [**KernelConfig**](KernelConfig.md) | |
**Initramfs** | Pointer to [**InitramfsConfig**](InitramfsConfig.md) | | [optional] **Initramfs** | Pointer to [**InitramfsConfig**](InitramfsConfig.md) | | [optional]
**Cmdline** | [**CmdLineConfig**](CmdLineConfig.md) | | **Cmdline** | [**CmdLineConfig**](CmdLineConfig.md) | | [optional]
**Disks** | [**[]DiskConfig**](DiskConfig.md) | | [optional] **Disks** | [**[]DiskConfig**](DiskConfig.md) | | [optional]
**Net** | [**[]NetConfig**](NetConfig.md) | | [optional] **Net** | [**[]NetConfig**](NetConfig.md) | | [optional]
**Rng** | [**RngConfig**](RngConfig.md) | | [optional] **Rng** | [**RngConfig**](RngConfig.md) | | [optional]
@ -19,6 +19,7 @@ Name | Type | Description | Notes
**Devices** | [**[]DeviceConfig**](DeviceConfig.md) | | [optional] **Devices** | [**[]DeviceConfig**](DeviceConfig.md) | | [optional]
**Vsock** | [**VsockConfig**](VsockConfig.md) | | [optional] **Vsock** | [**VsockConfig**](VsockConfig.md) | | [optional]
**SgxEpc** | [**[]SgxEpcConfig**](SgxEpcConfig.md) | | [optional] **SgxEpc** | [**[]SgxEpcConfig**](SgxEpcConfig.md) | | [optional]
**Numa** | [**[]NumaConfig**](NumaConfig.md) | | [optional]
**Iommu** | **bool** | | [optional] [default to false] **Iommu** | **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,12 @@
# VmResizeZone
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | | [optional]
**DesiredRam** | **int64** | desired memory zone size 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)

View File

@ -12,10 +12,12 @@ package openapi
type MemoryConfig struct { type MemoryConfig struct {
Size int64 `json:"size"` Size int64 `json:"size"`
HotplugSize int64 `json:"hotplug_size,omitempty"` HotplugSize int64 `json:"hotplug_size,omitempty"`
File string `json:"file,omitempty"` HotpluggedSize int64 `json:"hotplugged_size,omitempty"`
Mergeable bool `json:"mergeable,omitempty"` Mergeable bool `json:"mergeable,omitempty"`
HotplugMethod string `json:"hotplug_method,omitempty"` HotplugMethod string `json:"hotplug_method,omitempty"`
Shared bool `json:"shared,omitempty"` Shared bool `json:"shared,omitempty"`
Hugepages bool `json:"hugepages,omitempty"` Hugepages bool `json:"hugepages,omitempty"`
Balloon bool `json:"balloon,omitempty"` Balloon bool `json:"balloon,omitempty"`
BalloonSize int32 `json:"balloon_size,omitempty"`
Zones []MemoryZoneConfig `json:"zones,omitempty"`
} }

View File

@ -0,0 +1,22 @@
/*
* 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
// 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"`
}

View File

@ -0,0 +1,17 @@
/*
* 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
// 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"`
}

View File

@ -0,0 +1,15 @@
/*
* 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
// NumaDistance struct for NumaDistance
type NumaDistance struct {
Destination int32 `json:"destination"`
Distance int32 `json:"distance"`
}

View File

@ -14,7 +14,7 @@ type VmConfig struct {
Memory MemoryConfig `json:"memory,omitempty"` Memory MemoryConfig `json:"memory,omitempty"`
Kernel KernelConfig `json:"kernel"` Kernel KernelConfig `json:"kernel"`
Initramfs *InitramfsConfig `json:"initramfs,omitempty"` Initramfs *InitramfsConfig `json:"initramfs,omitempty"`
Cmdline CmdLineConfig `json:"cmdline"` Cmdline CmdLineConfig `json:"cmdline,omitempty"`
Disks []DiskConfig `json:"disks,omitempty"` Disks []DiskConfig `json:"disks,omitempty"`
Net []NetConfig `json:"net,omitempty"` Net []NetConfig `json:"net,omitempty"`
Rng RngConfig `json:"rng,omitempty"` Rng RngConfig `json:"rng,omitempty"`
@ -25,5 +25,6 @@ type VmConfig struct {
Devices []DeviceConfig `json:"devices,omitempty"` Devices []DeviceConfig `json:"devices,omitempty"`
Vsock VsockConfig `json:"vsock,omitempty"` Vsock VsockConfig `json:"vsock,omitempty"`
SgxEpc []SgxEpcConfig `json:"sgx_epc,omitempty"` SgxEpc []SgxEpcConfig `json:"sgx_epc,omitempty"`
Numa []NumaConfig `json:"numa,omitempty"`
Iommu bool `json:"iommu,omitempty"` Iommu bool `json:"iommu,omitempty"`
} }

View File

@ -0,0 +1,16 @@
/*
* 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
// VmResizeZone struct for VmResizeZone
type VmResizeZone struct {
Id string `json:"id,omitempty"`
// desired memory zone size in bytes
DesiredRam int64 `json:"desired_ram,omitempty"`
}

View File

@ -150,6 +150,22 @@ paths:
404: 404:
description: The VM instance could not be resized because it is not created. description: The VM instance could not be resized because it is not created.
/vm.resize-zone:
put:
summary: Resize a memory zone
requestBody:
description: The target size for the memory zone
content:
application/json:
schema:
$ref: '#/components/schemas/VmResizeZone'
required: true
responses:
204:
description: The memory zone was successfully resized.
500:
description: The memory zone could not be resized.
/vm.add-device: /vm.add-device:
put: put:
summary: Add a new device to the VM summary: Add a new device to the VM
@ -369,7 +385,6 @@ components:
VmConfig: VmConfig:
required: required:
- kernel - kernel
- cmdline
type: object type: object
properties: properties:
cpus: cpus:
@ -414,6 +429,10 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/SgxEpcConfig' $ref: '#/components/schemas/SgxEpcConfig'
numa:
type: array
items:
$ref: '#/components/schemas/NumaConfig'
iommu: iommu:
type: boolean type: boolean
default: false default: false
@ -448,6 +467,39 @@ components:
topology: topology:
$ref: '#/components/schemas/CpuTopology' $ref: '#/components/schemas/CpuTopology'
MemoryZoneConfig:
required:
- id
- size
type: object
properties:
id:
type: string
size:
type: integer
format: int64
default: 512 MB
file:
type: string
mergeable:
type: boolean
default: false
shared:
type: boolean
default: false
hugepages:
type: boolean
default: false
host_numa_node:
type: integer
format: uint32
hotplug_size:
type: integer
format: int64
hotplugged_size:
type: integer
format: int64
MemoryConfig: MemoryConfig:
required: required:
- size - size
@ -460,8 +512,9 @@ components:
hotplug_size: hotplug_size:
type: integer type: integer
format: int64 format: int64
file: hotplugged_size:
type: string type: integer
format: int64
mergeable: mergeable:
type: boolean type: boolean
default: false default: false
@ -477,6 +530,13 @@ components:
balloon: balloon:
type: boolean type: boolean
default: false default: false
balloon_size:
type: integer
format: uint64
zones:
type: array
items:
$ref: '#/components/schemas/MemoryZoneConfig'
KernelConfig: KernelConfig:
required: required:
@ -686,6 +746,41 @@ components:
type: boolean type: boolean
default: false default: false
NumaDistance:
required:
- destination
- distance
type: object
properties:
destination:
type: integer
format: uint32
distance:
type: integer
format: uint8
NumaConfig:
required:
- guest_numa_id
type: object
properties:
guest_numa_id:
type: integer
format: uint32
cpus:
type: array
items:
type: integer
format: uint8
distances:
type: array
items:
$ref: '#/components/schemas/NumaDistance'
memory_zones:
type: array
items:
type: string
VmResize: VmResize:
type: object type: object
properties: properties:
@ -701,6 +796,16 @@ components:
type: integer type: integer
format: int64 format: int64
VmResizeZone:
type: object
properties:
id:
type: string
desired_ram:
description: desired memory zone size in bytes
type: integer
format: int64
VmAddDevice: VmAddDevice:
type: object type: object
properties: properties: